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

3/8/2017来源:ASP.NET技巧人气:3281

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

[[email protected]]# ps -ef|grep httpd

root 8810 1 0 Mar02 ? 00:00:12 /usr/sbin/httpd apache 21571 8810 0 17:38 ? 00:00:05 /usr/sbin/httpd apache 21771 8810 0 19:01 ? 00:00:04 /usr/sbin/httpd apache 21772 8810 0 19:01 ? 00:00:04 /usr/sbin/httpd apache 21773 8810 0 19:01 ? 00:00:04 /usr/sbin/httpd apache 21781 8810 0 19:03 ? 00:00:04 /usr/sbin/httpd

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

[[email protected]]# httpd -S

VirtualHost configuration: 211.157.8.76:80 is a NameVirtualHost default server www.wapwu.com (/etc/httpd/conf/httpd.conf:1041) port 80 namevhost wap.wapwu.com (/etc/httpd/conf/httpd.conf:1041) port 80 namevhost admin.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 [[email protected] ~]#

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