php 如何在 AMAZON EC2 中编辑 httpd.conf 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15112424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to edit httpd.conf file in AMAZON EC2
提问by Sumit Bijvani
I am new on AMAZON EC2 Server, recently I have Installed PHP and MySQL and now I want to update file /etc/httpd/conf/httpd.conf
我是 AMAZON EC2 服务器的新手,最近我安装了 PHP 和 MySQL,现在我想更新文件 /etc/httpd/conf/httpd.conf
but the problem is, when I am going to update it, it display error like - Permission denied. What is the best way to update it?
但问题是,当我要更新它时,它会显示类似 - 的错误Permission denied。更新它的最佳方法是什么?
回答by Syed Priom
You have to change the file as root user. Do this:
您必须以 root 用户身份更改文件。做这个:
sudo nano /etc/httpd/conf/httpd.conf
Make your changes and save with ctrl+ O, Enter. Done.
进行更改并使用ctrl+ O,保存Enter。完毕。
回答by Sumit Bijvani
I have found solution and its working...
我找到了解决方案及其工作...
$ sudo nano /etc/httpd/conf/httpd.conf
$ sudo nano /etc/httpd/conf/httpd.conf
回答by rptwsthi
It would be prompting you a alert, that you can duplicate it. So
它会提示你一个警报,你可以复制它。所以
- So duplicate it, store it on desktop with same name
- Edit it for your use(remove comment '#')
- Save it
- Now replace the original file with this one
- it'll prompt for your password, provide that
- 所以复制它,将它存储在同名的桌面上
- 编辑它供您使用(删除注释“#”)
- 保存
- 现在用这个替换原始文件
- 它会提示你输入密码,提供
Now all updates you did are saved in httpd.confCheers
现在你做了所有的更新都保存在httpd.conf中干杯

