How to find the current apache webserver config:
- Find the main httpd process
ps axuww | grep 'root.*http[d]'
which should yield something like
root 1480 0.0 0.0 90788 7756 - SsJ 20:25 0:00.03 /usr/local/sbin/httpd
Lookout for the command, note if any config file is stated e.g. /usr/sbin/httpd -f /etc/apache2/conf/httpd.conf
- If no startup configfile is referenced with
-f
, we have to find the default config directory:
/usr/sbin/httpd -V
Server version: Apache/2.4.25
...
-D HTTPD_ROOT="/usr/local"
-D SERVER_CONFIG_FILE="etc/apache24/httpd.conf"
We are looking for the compiletime variables HTTPD_ROOT and SERVER_CONFIG_FILE. If the latter is not an absolute filepath, as above, it is expanded by the HTTPD_ROOT dir path; if SERVER_CONFIG_FILE is empty it defaults to $HTTPD_ROOT/conf/httpd.conf
.
- Parsing the main configfile
We should have located the runtime configfile and are now parsing for the relevant directives. Among these are
- ServerRoot
- Include or IncludeOptional
- DocumentRoot
- Alias / ScriptAlias
- and all and Containers
Firstly we have to locate the directory container for phpmyadmin. Therefore parse all configfiles that are referenced by the Include directives for 'php'. In the good old days you had a Alias/ScriptAlias directive and a corresponding or Container for PHP together with a SetHandler
directive. Nowadays you could have a php-fpm daemon running on your system which is connected through proxy_fcgi.