失去了httpd。apache配置文件位于

时间:2022-12-19 16:56:25

How can I find where my httpd.conf file is located?

我怎么才能找到我的httpd。配置文件位于?

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配置。

2 个解决方案

#1


604  

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

#2


192  

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. The most common answer, however, is either /etc/apache/conf or /etc/httpd/conf

请参阅http://wiki.apache.org/httpd/DistrosDefaultLayout以讨论在不同平台上可能找到Apache httpd配置文件的位置,因为不同版本和平台之间可能存在差异。然而,最常见的答案是/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). 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

将为您提供配置文件的默认位置的完整路径吗

#1


604  

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

#2


192  

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. The most common answer, however, is either /etc/apache/conf or /etc/httpd/conf

请参阅http://wiki.apache.org/httpd/DistrosDefaultLayout以讨论在不同平台上可能找到Apache httpd配置文件的位置,因为不同版本和平台之间可能存在差异。然而,最常见的答案是/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). 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

将为您提供配置文件的默认位置的完整路径吗