GaetanZ GaetanZ - 1 year ago 158
Apache Configuration Question

How to debug an apache virtual host configuration?

Once again, I have a problem with my apache virtual host configuration. (The default configuration is used instead of my specific one).

The problem is not really the misconfiguration but how to solve it.

Does anyone has good advices to do resolve this kind of problem quickly?

Some more informations.

The default conf file is this one:

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from ::1/128


And the virtual host config that doesn't apply is this one:

<VirtualHost *:*>

ProxyPreserveHost On
ProxyPass / http://ip.ip.ip.ip:8088/
ProxyPassReverse / http://ip.ip.ip.ip:8088/


Answer Source

Syntax check

To check configuration files for syntax errors:

# Fedora, RHEL, CentOS, OSX
httpd -t

# Debian, Ubuntu
apache2ctl -t

# MacOS
apachectl -t

List virtual hosts

To list all virtual hosts, and their locations:

# Fedora, RHEL, CentOS, OSX
httpd -S

# Debian, Ubuntu
apache2ctl -S

# MacOS
apachectl -S
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download