How can I find out where the httpd.conf file is located?

前端 未结 6 809
时光取名叫无心
时光取名叫无心 2021-02-04 13:01

How can I find out the path of the httpd.conf file on apache (PHP)? I do not know whether my script will be runned in windows apache or linux, i need to know where i can find th

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 13:43

    httpd -V

    It will shows all compile settings, in the middle of the results you will find:

    • The Apache root directory: /usr/local/apache
    • The Apache config file path from the root directory: conf/httpd.conf

    Apache conf file: /usr/local/apache/conf/httpd.conf

    root@host [~]# httpd -V Server version: Apache/2.4.16 (Unix) Server built: Dec 15 2015 10:01:02 Cpanel::Easy::Apache v3.32.6 rev9999 Server's Module Magic Number: ... Server loaded: APR 1.5.2, APR-UTIL 1.5.4 Compiled using: APR 1.5.2, APR-UTIL 1.5.4 Architecture: 64-bit Server MPM: prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled) -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=256 -D HTTPD_ROOT="/usr/local/apache" -D __SUEXEC_BIN="/usr/local/apache/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -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"

提交回复
热议问题