centos查看apache用的是哪个httpd.conf
1个回答
展开全部
果进程中无法找到尝试在启动脚本中寻找,适用于yum安装的apache,如下所示,可以看到启动时apache加载配置文件的位置,其中apache运行的站点目录可以在/etc/httpd/conf/httpd.conf中找到
#查看apache配置文件位置
sed -n '9,11p' /etc/init.d/httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd/httpd.pid
#查看apache站点目录
grep "DocumentRoot" /etc/httpd/conf/httpd.conf|grep -v "#"
DocumentRoot "/var/www/html"
3. 通过编译参数查找
apache_bin=$(find / -type f -name "httpd"|xargs -i ls -l {}|awk '{if($5>30000)print $NF}')
$apache_bin -V|grep HTTPD_ROOT
结果:-D HTTPD_ROOT="/etc/httpd"
#apache安装在/etc/httpd 目录下
#查看apache配置文件位置
sed -n '9,11p' /etc/init.d/httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd/httpd.pid
#查看apache站点目录
grep "DocumentRoot" /etc/httpd/conf/httpd.conf|grep -v "#"
DocumentRoot "/var/www/html"
3. 通过编译参数查找
apache_bin=$(find / -type f -name "httpd"|xargs -i ls -l {}|awk '{if($5>30000)print $NF}')
$apache_bin -V|grep HTTPD_ROOT
结果:-D HTTPD_ROOT="/etc/httpd"
#apache安装在/etc/httpd 目录下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询