xywuyiba8 发表于 2016-12-31 09:13:59

Apache命令行参数

  除了基本的apache操作命令外,apache还支持很多命令行参数。具体如下:
  1. 显示版本
  -v用于显示僬侥版本信息即编译时间,-V显示详细信息

$ ./httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Mar 19 2010 10:50:51
$ ./httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Mar 19 2010 10:50:51
Server's Module Magic Number: 20051115:24
Server loaded:APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:   Worker
threaded:   yes (fixed thread count)
forked:   yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/opt/taobao/install/httpd"
-D SUEXEC_BIN="/opt/taobao/install/httpd/bin/suexec"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
  2. 日志处理
  -e level设置日志级别;-E file将出错信息输出到指定文件
  示例:httpd -E /home/admin/log/apache.log
  3. 指定配置文件
  -f file使用指定文件作为apache的配置文件
  示例:httpd -f /home/admin/conf/httpd.conf
  4. directive配置:在读取配置文件之前或者之后,处理directive的配置
  -C "directive"在读取配置文件之前处理;-c "directive"读取后再处理;
  示例:httpd -C "DocumentHome" /home/doc
   httpd -c "DocumentHome" /home/doc
  5. 指定ServerRoot目录
  -d directory:指定一个新的ServerRoot目录
  示例:httpd -d  /home/serverRoot
  待续
页: [1]
查看完整版本: Apache命令行参数