第一步:找到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/ 目錄下。
掃碼二維碼 獲取免費視頻學習資料
- 本文固定鏈接: http://www.wangchenghua.com/post/1358/
- 轉載請注明:轉載必須在正文中標注并保留原文鏈接
- 掃碼: 掃上方二維碼獲取免費視頻資料
查 看2022高級編程視頻教程免費獲取