【原创】如何快速定位apache主配置文件httpd.conf物理位置?

blogdaren 2015-09-01 1评论 1807人次

1. 执行httpd -h查看帮助,其中有个有用的参数 " -V : show compile settings "

root@ligh-VirtualBox:~# httpd -h
Usage: httpd [-D name] [-d directory] [-f file]
             [-C "directive"] [-c "directive"]
             [-k start|restart|graceful|graceful-stop|stop]
             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed vhost settings
  -t -D DUMP_RUN_CFG : show parsed run settings
  -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
  -X                 : debug mode (only one worker, do not detach)

2. 执行“httpd -V | grep -iE 'root|config'”命令后得到如下结果:

 -D HTTPD_ROOT="/etc/httpd"
 -D AP_TYPES_CONFIG_FILE="etc/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

3. 直接看两副截图:

33.jpg

44.jpg

版权声明:除非注明,本文由( blogdaren )原创,转载请保留文章出处。

本文链接:【原创】如何快速定位apache主配置文件httpd.conf物理位置?

用户评论:

2015-09-01 11:15
不错

发表评论:

您的昵称:
电子邮件:
个人主页: