查看操作系统信息
lsb_release -a
查询apache版本
apachectl -v
nginx重启
nginx -c /usr/local/etc/nginx/nginx.conf
查看apache配置文件位置
httpd -V
#httpd -V
Server version: Apache/2.2.21 (Unix)
Server built: Feb 9 2012 17:33:51
Server’s Module Magic Number: 20051115:30
Server loaded: APR 1.4.2, APR-Util 1.3.10
Compiled using: APR 1.4.2, APR-Util 1.3.10
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with….
-D APACHE_MPM_DIR=”server/mpm/prefork”
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_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=”/usr/local/httpd2.2.21″
-D SUEXEC_BIN=”/usr/local/httpd2.2.21/bin/suexec”
-D DEFAULT_PIDLOG=”logs/httpd.pid”
-D DEFAULT_SCOREBOARD=”logs/apache_runtime_status”
-D DEFAULT_LOCKFILE=”logs/accept.lock”
-D DEFAULT_ERRORLOG=”logs/error_log”
-D AP_TYPES_CONFIG_FILE=”conf/mime.types”
-D SERVER_CONFIG_FILE=”conf/httpd.conf”
其中HTTPD_ROOT和SERVER_CONFIG_FILE 就可以确定httpd.conf的路径了