在Linux中如何查看apache使用的是哪个httpd.conf_VMware, Unix及操作系统讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  VMware, Unix及操作系统讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1988 | 回复: 0   主题: 在Linux中如何查看apache使用的是哪个httpd.conf        下一篇 
barry
注册用户
等级:中校
经验:1534
发帖:236
精华:2
注册:2012-1-13
状态:离线
发送短消息息给barry 加好友    发送短消息息给barry 发消息
发表于: IP:您无权察看 2015-5-4 9:30:49 | [全部帖] [楼主帖] 楼主

第一步:找到apache启动命令:

ps -ef|grep httpd
root     10575   1  0 19:45 ?    00:00:03 /usr/sbin/httpd -k start
myuser   15356   2982   0   Jan19   ?   00:00:00   /home/apache/bin/httpd -f /home/apache/conf/httpd.conf -k start

如果看到 httpd命令使用了-f选项,则可以直接得到配置文件目录。

如果httpd命令没有使用-f选项,如:

ps -ef|grep httpd
root     10575     1  0 19:45 ?        00:00:03 /usr/sbin/httpd -k start
apache   10577 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start
apache   10583 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start
apache   10584 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start
apache   10587 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start
apache   10590 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start
apache   10591 10575  0 19:45 ?        00:00:00 /usr/sbin/httpd -k start

则执行第二步。

第二步:执行httpd -S命令,找出配置文件路径

/usr/sbin/httpd -S

VirtualHost configuration:
211.157.8.76:80        is a NameVirtualHost
default server wap.wapwu.com (/etc/httpd/conf/httpd.conf:1041)
port 80 namevhost wap.wapwu.com (/etc/httpd/conf/httpd.conf:1041)
port 80 namevhost wapu.wapwu.com (/etc/httpd/conf/httpd.conf:1052)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          211.157.8.76 (/etc/httpd/conf.d/ssl.conf:88)
Syntax OK

从apache输出的日志信息中可以看到配置文件是在/etc/httpd/conf/ 目录下。

--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论