Apache error when trying to use virtual hosts

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

Re: Apache error when trying to use virtual hosts

Postby pcs800 » 14. February 2011 03:13

Checking the log:

I deleted the contents of the log file, then tried to start apache with the new httpd-vhosts.config file, here are the contents of the log file.

[Sun Feb 13 18:08:51 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Sun Feb 13 18:08:51 2011] [notice] Child 904: Exit event signaled. Child process is ending.
[Sun Feb 13 18:08:51 2011] [warn] (OS 10038)An operation was attempted on something that is not a socket. : setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.
[Sun Feb 13 18:08:52 2011] [notice] Child 904: Released the start mutex
[Sun Feb 13 18:08:53 2011] [notice] Child 904: Waiting for 250 worker threads to exit.
[Sun Feb 13 18:09:21 2011] [notice] Parent: Forcing termination of child process 440

That's it. Seems be all from shutting down the service, none for the error at startup.
Ugg, what can I do to figure this out?
I am going to try your second suggestion, will post after I do so.
Thanks for the help so far everyone!
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Apache error when trying to use virtual hosts

Postby pcs800 » 14. February 2011 03:33

says -s is an illegal option and thn gives me a list of possible switches.
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Apache error when trying to use virtual hosts

Postby Sharley » 14. February 2011 05:42

pcs800 wrote:says -s is an illegal option
Thats absolutely correct as I did not write -s but apache -S so be aware that Apache and most things in XAMPP are case sensitive.

Your error.log file is not showing the apache start up entries which seems to indicate you have some serious issues with your XAMPP installation.

What version of XAMPP are you using?

Check in your Windows Task Manager that there are no processes running by apache.exe or httpd.exe or mysqld.exe and if you see any of those entries then Kill them, close the Task Manager and try and start Apache and MySQL using the XAMPP Control Panel - both should show a green running when they have started and make sure also that there are no ticks in the Svc check boxes.

Your log file should then have a set of entries similar to this, depending on your version
Code: Select all
[Sat [Sat Feb 12 13:29:13 2011] [notice] Server built: Jun 14 2008 19:02:12
[Sat Feb 12 13:29:13 2011] [notice] Parent: Created child process 2092
[Sat Feb 12 13:29:14 2011] [notice] Disabled use of AcceptEx() WinSock2 API
[Sat Feb 12 13:29:17 2011] [notice] Child 2092: Child process is running
[Sat Feb 12 13:29:17 2011] [notice] Child 2092: Acquired the start mutex.
[Sat Feb 12 13:29:17 2011] [notice] Child 2092: Starting 250 worker threads.
[Sat Feb 12 13:29:17 2011] [notice] Child 2092: Listening on port 443.
[Sat Feb 12 13:29:17 2011] [notice] Child 2092: Listening on port 80.
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 error when trying to use virtual hosts

Postby pcs800 » 15. February 2011 03:58

Ok I did the -S check. Here is whaty I get.

The first instance is while using the original httpd-vhosts.conf file, the second instance is with the new one (with your code) enabled.
It's like it skips it.
Image
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Apache error when trying to use virtual hosts

Postby pcs800 » 15. February 2011 03:59

Oh and version of xampp is 1.6.3a

And to be clear, you want me to stop the apache service, switch to the new httpd-vhosts.conf and then kill any instance of apache, httpd and mysql in task manager, uncheck SVC on the xampp control panel for apache and mysql, then start them via the control panel?
pcs800
 
Posts: 33
Joined: 22. September 2005 15:08

Re: Apache error when trying to use virtual hosts

Postby Sharley » 15. February 2011 07:41

pcs800 wrote:And to be clear, you want me to stop the apache service, switch to the new httpd-vhosts.conf and then kill any instance of apache, httpd and mysql in task manager, uncheck SVC on the xampp control panel for apache and mysql, then start them via the control panel?
No need to worry about this now as I have spotted the culprit causing your problems.


Problem solved.
You are using a non text editor to edit your conf files and this has caused an issue with the quote marks “ ” not being recognised by Apache in the httpd-vhost.conf file.

They should look like this if you had used a text editor like notepad etc. " " - can you spot the difference?

I picked this up when I copied my code which contained some copy and paste of your own very first posted code and entered it into a 1.6.3a version I have for testing and Apache failed to start with a system error not an Apache error which gave me the clue - I should not copy and paste other peoples code. ;)

Here is the code copy and pasted from your very first post
<VirtualHost 127.0.0.1>
ServerName http://www.site1.com
DocumentRoot C:/xampp/htdocs/site1folder
ErrorLog C:/xampp/htdocs/site1folder/errorlog
DirectoryIndex index.html index.php index.html
</VirtualHost>

<VirtualHost 127.0.0.1>
ServerName http://www.site2.com
DocumentRoot C:/xampp/htdocs/site2folder
ErrorLog C:/xampp/htdocs/site2folder/errorlog
DirectoryIndex index.html index.php index.html
</VirtualHost>


So to correct this simply use a text editor like notepad not a word processor like word or wordpad when editing any conf or ini files in XAMPP.

I have corrected the code here which all you need do is copy and paste over to your httpd-vhosts.conf file, save the file and restart Apache.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName site1.com
ServerAlias www.site1.com
DocumentRoot "C:/xampp/htdocs/site1folder"
ErrorLog "C:/xampp/htdocs/site1folder/error.log"
DirectoryIndex index.html index.php index.htm
</VirtualHost>

<VirtualHost *:80>
ServerName site2.com
ServerAlias www.sire2.com
DocumentRoot "C:/xampp/htdocs/site2folder"
ErrorLog "C:/xampp/htdocs/site2folder/error.log"
DirectoryIndex index.html index.php index.htm
</VirtualHost>
I have just tested all this in 1.6.3a exactly as you should now have it configured and Apache starts and the site1.com and site2.com as well as localhost work perfectly - you should also see the error.log file created in your site folders after you have started Apache.

The apache -S command gave a Syntax OK indication
Code: Select all
F:\xampp\apache\bin>apache -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443          localhost (C:/xampp/apache/conf/extra/httpd-ssl.conf:74)
*:80                   is a NameVirtualHost
         default server localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:46)
         port 80 namevhost localhost (C:/xampp/apache/conf/extra/httpd-vhosts.conf:46)
         port 80 namevhost site1.com (C:/xampp/apache/conf/extra/httpd-vhosts.conf:51)
         port 80 namevhost site2.com (C:/xampp/apache/conf/extra/httpd-vhosts.conf:59)
Syntax OK

C:\xampp\apache\bin>


Good luck and best wishes. :)
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 error when trying to use virtual hosts

Postby Sharley » 15. February 2011 12:40

On your other php5_module issue:
pcs800 wrote:...The Apache service named reported the following error:
>>> [Thu Feb 03 17:29:42 2011] [warn] module php5_module is already loaded, skipping...

...I checked for two instances of LoadModule php5_module, which there is not.
Do you have this LoadModule php5_module line in your httpd.conf file?

Where did you check for 2 instances of this line?
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

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 101 guests