You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2013/03/14 11:44:06 UTC

[Httpd Wiki] Update of "TroubleshootingVhosts" by SeanTimmins

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "TroubleshootingVhosts" page has been changed by SeanTimmins:
http://wiki.apache.org/httpd/TroubleshootingVhosts?action=diff&rev1=4&rev2=5

  
  Secondly, and this cannot be stressed enough, use `apachectl -S` or `httpd -S` whenever any changes are made to the configuration. It outputs various lines of information that are vital to the troubleshooting of virtual host configurations. See [[#apachectl|below]] for further information.
  
- Thirdly, althought there are a couple of exceptions, if an access log is defined then httpd will ''always'' log something to it when it serves a request and an entry will always be logged in the error log on a 4xx return code. An error log entry will also normally be written on a 5xx return code, however when using 3rd party modules, CGIs or launguages such as php it is possible for these to be hijacked and nothing will be in the log. If you cannot find the access/error log entry then you are either looking in the wrong log or the request didn't actually reach the web server.
+ Thirdly, although there are a couple of exceptions, if an access log is defined then httpd will ''always'' log something to it when it serves a request and an entry will always be logged in the error log on a 4xx return code. An error log entry will also normally be written on a 5xx return code, however when using 3rd party modules, CGIs or launguages such as php it is possible for these to be hijacked and nothing will be in the log. If you cannot find the access/error log entry then you are either looking in the wrong log or the request didn't actually reach the web server.
  
  == Virtual Host Requirements ==
   * (httpd prior to v2.3.11) You ''must'' have a [[http://httpd.apache.org/docs/current/mod/core.html#namevirtualhost|NamedVirtualHost]] directive for each IP+port combination in use, it should be IP:port or *:port and should come before any of the actual virtual hosts.
@@ -112, +112 @@

  
    1. If there is no Name``Virtual``Host directive this line will not be present.
  
-   1. The 'default' virtual host is the one with server name 'foo.com'. It was defined in the file /etc/httpd/conf.d/vhosts.conf and started on line 9.
+   1. The 'default' virtual host is the one with server name 'foo.com'. It was defined in the file /etc/httpd/conf.d/vhosts.conf and started on line 11.
  
    1. A second entry refering to the default virtual host. It runs on port 80 and it's server name is foo.com. The file and start line are repeated.
  
@@ -147, +147 @@

    1. After the virtual hosts information, the output contains lines useful for debugging the global configuration.
  
  <<BR>>
-  In the ouput, if there are any duplicate server names or aliases (other than the default one and the namevhost immediately after it) then there are virtual hosts with duplicate names and only the first one in the list will work.
+  In the ouput, if there are any duplicate server names or aliases (other than the default one and the namevhost immediately after it) then there are virtual hosts with the same name (or Alias) and only the first one in the list will work.
  
   With httpd prior to v2.3.11, if you do not have a Name``Virtual``Host directive you will not see the line ending in `is a NameVirtualHost` and depending on the exact configuration you may see something similar to one of the following warnings:
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org