本文翻譯自: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 / confGenerically, 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
将為您提供配置檔案的預設位置的完整路徑