怎样在Linux中查看apache是用那个httpd.conf

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

[root@WAPBJ01 ~]# 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选项,如:

[root@WAPBJ01 ~]# 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命令,找出配置文件路径

[root@WAPBJ01 ~]# /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
[root@WAPBJ01 ~]# 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值