获取运行Apache的路径
$ ps -ef | grep apache
apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2
将-V
参数附加到路径
$ /usr/sbin/apache2 -V | grep SERVER_CONfig_FILE
-D SERVER_CONfig_FILE="/etc/apache2/apache2.conf"
参考:http ://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf- location