丢失的httpd.conf文件位于apache [关闭]

本文介绍在Ubuntu Linux服务器上,特别是从Amazon Web Services EC2运行时,如何找到Apache配置文件httpd.conf的位置。通过使用ps、grep和apache2ctl命令,可以获取运行中的Apache路径,并通过附加-V参数获取详细的配置信息,包括主配置文件的默认位置。

本文翻译自: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 将为您提供配置文件的默认位置的完整路径

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值