Page 1 of 1

Server dies when virtual hosts are specified

PostPosted: 06. October 2006 14:15
by bborun
I am trying to run up four virtual hosts on a customer's WinXPSP2 box. Everything is fine until I specify a virtual host - even the default vhost.

When I start Apache it dies within 1-2 seconds. There is no error log entry only an entry in the Event Viewer->System, which tells me that the
Apache service died with an service specific error code of 1 (0x1).

I have search the forum for an answer, to this problem without success. Can someone please shed some light on my problem, one way or another?

PostPosted: 06. October 2006 14:21
by Wiedmann
only an entry in the Event Viewer->System,

Look into "Event Viewer->Application".

PostPosted: 06. October 2006 16:21
by bborun
Look into "Event Viewer->Application".


There is no event logged against the Apache2 application. The only message logged is in the System log and it reads:

The Apache2 service terminated with service-specific error 1 (0x1).

PostPosted: 06. October 2006 17:19
by Wiedmann
Then start Apache with the batchfile ("apache_start.bat").

PostPosted: 06. October 2006 18:54
by bborun
apache_start.bat just quits:

C:\Program Files\xampp>.\apache_start.bat
Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .

PostPosted: 06. October 2006 23:26
by Izzy
Normally when you run xampp-start.bat it would give you any errors it found when trying to start, like this:
Code: Select all
Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...
apache.exe: Syntax error on line 501 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 63 of C:/xampp/apache/conf
/extra/httpd-vhosts.conf: Expected </Directory"> but saw </Directory>

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .

I purposely added a " to the <Directory> directive to simulate an error message for you.

Another method to check your xampp\apache\conf\extra\httpd-vhosts.conf configuration is correct is to issue the apache -S command at a dos console in xampp\apache\bin and to check the xampp\apache\conf\httpd.conf has correct syntax issue the command apache -t in the same way.

The returned messages might give some clues for you.

If you are not sure what they mean you are most welcome to paste them here so they can be analysed.

PostPosted: 06. October 2006 23:56
by bborun
Izzy,

Thanks for the help. I followed your Instructions, and the following is the output:

C:\Program Files\xampp\apache\bin>.\apache -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 localhost (C:/Program Files/xampp/apache/conf/extra/httpd
-ssl.conf:74)
*:80 is a NameVirtualHost
default server www.newenglandcoating.net (C:/Program Files/xampp/apache
/conf/extra/httpd-vhosts.conf:36)
port 80 namevhost www.newenglandcoating.net (C:/Program Files/xampp/apa
che/conf/extra/httpd-vhosts.conf:36)
Syntax OK

C:\Program Files\xampp\apache\bin>.\apache -t
Syntax OK

C:\Program Files\xampp\apache\bin>


PostPosted: 07. October 2006 00:10
by Izzy
Those look fine so your problems are not with virtual hosts nor is it a httpd.conf issue. So you have to investigate taking a new approach.

You don't have another server trying to use port 80 - xampp-portcheck.exe should give all ports as being free.

If all else fails then it might be a corrupt installation somehow. So if you uninstall by deleting the whole XAMPP directory you installed to. Then after a PC reboot (not required but often helps) reinstall XAMPP.

I had some issues with the installer version once upon a time and changed my install method to the 7Zip version and had a perfect install and upgrade each time. Also you have more control over where you can install to, as opposed to the installer method.

Sorry I can't be more help but without an error message to work with it is very difficult to try and fathom it all out remotely.

Good luck.

PostPosted: 07. October 2006 00:26
by bborun
The port check was fine. I also tried to activate virtual hosting on my own development box running WinXP SP2 and it failed in exactly the same way.

I normally run apache under FreeBSD. This is the first time I have been asked to run up a WinXP based apache server supporting virtual hosts and the lack of joy is definitely disconcerting. I will try your suggestion regarding a zip installation.

Thanks again for the help, guys.

PostPosted: 07. October 2006 14:36
by Wiedmann
Code: Select all
Apache 2 is starting ...

Apache konnte nicht gestartet werden

You have defined a wrong ErrorLog?

PostPosted: 07. October 2006 23:51
by Izzy
If you have defined an error log incorrectly in your virtual hosts container then you should see an error similar to this in the file:
xampp\apache\logs\error.log
Code: Select all
[date of event] [crit] (22)Invalid argument: unable to replace stderr with error_log
[date of event] [crit] (2)No such file or directory: unable to replace stderr with /dev/null