Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

apache

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 this file in order to find a parameter from there. thanks!

like image 787
user1700262 Avatar asked Nov 12 '12 09:11

user1700262


2 Answers

This is a classic way to locate httpd.conf file:

# find / -name 'httpd.conf' -print

Also you can file locate the file using

locate httpd.conf
like image 69
Ganatra Avatar answered Sep 24 '22 01:09

Ganatra


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"

like image 34
Rajeshkumar Avatar answered Sep 25 '22 01:09

Rajeshkumar