Apache Not starting After Editing Vhosts File

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Apache Not starting After Editing Vhosts File

Postby khantroll » 29. December 2010 19:26

Hello. I am trying to host a webserver from my home using XANPP for Windows, mainly using this series of tutorials: http://diyws.ath.cx/
I copied his hosts and vhosts examples, replacing my site name in all the relevant fields. After I made the changes to the vhosts file, I could no longer start the apache web server. When I press the start button in the XAMPP control panel, the text area says "Busy" followed by "Apache Started". It does not change to running, and the admin button never becomes available, however.

Here is the example vhost from the tutorial

Code: Select all
 # Virtual Hosts
  #
  # If you want to maintain multiple domains/hostnames on your
  # machine you can setup VirtualHost containers for them. Most configurations
  # use only name-based virtual hosts so the server doesn't need to worry about
  # IP addresses. This is indicated by the asterisks in the directives below.
  #
  # Please see the documentation at
  # URL:http://httpd.apache.org/docs/2.2/vhosts/
  # for further details before you try to setup virtual hosts.
  #
  # You may use the command line option '-S' to verify your virtual host
  # configuration.
  #
  # Use name-based virtual hosting.
  NameVirtualHost *:8080
  #
  # VirtualHost example:
  # Almost any Apache directive may go into a VirtualHost container.
  # The first VirtualHost section is used for all requests that do not
  # match a ServerName or ServerAlias in any <VirtualHost> block.

  <VirtualHost *:8080>
    DocumentRoot c:/xampp/htdocs
    ServerName localhost
    <Directory />
      Options ExecCGI FollowSymLinks Includes Indexes
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    <IfModule dir_module>
      DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
    </IfModule>
  </VirtualHost>

  <VirtualHost *:8080>
    DocumentRoot c:/web/diyws
    ServerName diyws.ath.cx
    <Directory />
      Options ExecCGI FollowSymLinks Includes Indexes
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    <IfModule dir_module>
      DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
    </IfModule>
    ErrorLog "c:/web/diyws/logs/error_log.txt"
    CustomLog "c:/web/diyws/logs/access_log.txt" common

  </VirtualHost>


I greatly appreciate any help anyone can offer. Thank you in advance.
khantroll
 
Posts: 2
Joined: 29. December 2010 17:32

Re: Apache Not starting After Editing Vhosts File

Postby WilliL » 29. December 2010 20:19

Code: Select all
 # Virtual Hosts

  #
  # Use name-based virtual hosting.
  NameVirtualHost *:8080
 
  <VirtualHost *:8080>
    DocumentRoot c:/xampp/htdocs
    ServerName localhost
    <Directory />
      Options ExecCGI FollowSymLinks Includes Indexes
      AllowOverride All
      Order allow,deny
      Allow from all
    </Directory>
    <IfModule dir_module>
      DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
    </IfModule>
  </VirtualHost>


did you install apache listening on port 8080?
usually it is installed on port 80..
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Apache Not starting After Editing Vhosts File

Postby khantroll » 29. December 2010 20:29

I think you are right, but changing it didn't fix this particular error. Thanks for the suggestion though.
khantroll
 
Posts: 2
Joined: 29. December 2010 17:32

Re: Apache Not starting After Editing Vhosts File

Postby Sharley » 29. December 2010 20:34

A couple of issues with the tutorial so I have included perhaps what you may find to be a working example I created for another member in this topic:
viewtopic.php?f=16&t=43109

If you follow the above example and check out the comments then you may see what is wrong with the tutorial - you should use port 80 not port 8080 or else everytime you write a URI you would have to use port 8080 like so:
http://diyws.ath.cx:8080/
which can be a real pain.

The <Directory> directive must always be the same path as the DocumentRoot.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Apache Not starting After Editing Vhosts File

Postby WilliL » 29. December 2010 20:35

have a look to error.log
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 132 guests