本文翻译自:Lost httpd.conf file located apache [closed]
How can I find where my httpd.conf
file is located? 如何找到httpd.conf
文件的位置?
I am running an Ubuntu Linux server from the Amazon Web Services EC2 (Elastic Compute Cloud) and I can't find my Apache config. 我正在从Amazon Web Services EC2(弹性计算云)运行Ubuntu Linux服务器,但我找不到我的Apache配置。
#1楼
参考:https://stackoom.com/question/pCIn/丢失的httpd-conf文件位于apache-关闭
#2楼
Get the path of running Apache 获取运行Apache的路径
$ ps -ef | grep apache
apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2
Append -V
argument to the path 在路径中附加-V
参数
$ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
Reference: 参考:
http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location
#3楼
See http://wiki.apache.org/httpd/DistrosDefaultLayout for discussion of where you might find Apache httpd configuration files on various platforms, since this can vary from release to release and platform to platform. 有关在各种平台上可能找到Apache httpd配置文件的位置的讨论,请参阅http://wiki.apache.org/httpd/DistrosDefaultLayout ,因为这可能因发行版和平台而异。 The most common answer, however, is either /etc/apache/conf or /etc/httpd/conf 但是,最常见的答案是/ etc / apache / conf或/ etc / httpd / conf
Generically, you can determine the answer by running the command: 通常,您可以通过运行命令来确定答案:
httpd -V httpd -V
(That's a capital V). (那是首都V)。 Or, on systems where httpd is renamed, perhaps apache2ctl -V
或者,在重命名httpd的系统上,也许是apache2ctl -V
This will return various details about how httpd is built and configured, including the default location of the main configuration file. 这将返回有关如何构建和配置httpd的各种详细信息,包括主配置文件的默认位置。
One of the lines of output should look like: 其中一行输出应如下所示:
-D SERVER_CONFIG_FILE="conf/httpd.conf" -D SERVER_CONFIG_FILE =“conf / httpd.conf”
which, combined with the line: 其中,结合线:
-D HTTPD_ROOT="/etc/httpd" -D HTTPD_ROOT =“/ etc / httpd”
will give you a full path to the default location of the configuration file 将为您提供配置文件的默认位置的完整路径