我该如何找到我的httpd.conf
文件所在位置?
我在亚马逊网络服务 EC2(弹性计算云)上运行 Ubuntu Linux 服务器,但无法找到 Apache 配置文件。
我该如何找到我的httpd.conf
文件所在位置?
我在亚马逊网络服务 EC2(弹性计算云)上运行 Ubuntu Linux 服务器,但无法找到 Apache 配置文件。
获取正在运行的Apache的路径
$ ps -ef | grep apache
apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2
在路径末尾添加-V
参数
$ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
参考资料:
http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location
sudo /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
命令时,我遇到了一些警告错误:“Invalid Mutex directory”。因此,我使用了正确的命令sudo apachectl -V | grep SERVER_CONFIG_FILE
。请为我翻译这段内容。 - NineCattoRules参考http://wiki.apache.org/httpd/DistrosDefaultLayout,讨论了在不同平台上可能会找到Apache httpd配置文件的位置,因为这可能因版本和平台而异。然而,最常见的答案是 /etc/apache/conf 或 /etc/httpd/conf。
通用地,您可以通过运行以下命令来确定答案:
httpd -V
(这是一个大写的 V) 或者,在 httpd 被重命名的系统上,也许是 apache2ctl -V
这将返回有关如何构建和配置 httpd 的各种详细信息,包括主配置文件的默认位置。
其中一行输出应该类似于:
-D SERVER_CONFIG_FILE="conf/httpd.conf"
与以下行结合使用:
-D HTTPD_ROOT="/etc/httpd"
将为您提供配置文件默认位置的完整路径。
apache2ctl -V
命令,并查找列在其中的路径。 - james-see
find / -name httpd.conf
来查找 httpd.conf 文件。 - prograhammer/etc/httpd/conf/httpd.conf
。有关更详细信息,请参阅以下链接:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Reference_Guide/s1-apache-config.html - danwildlocate httpd.conf
。 - Sudip Bhandari