apache won't start after trying to set up v hosts

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

apache won't start after trying to set up v hosts

Postby w4vy » 08. February 2009 19:31

Hi everyone, I trust everyone's OK.

I was trying to set up virtual hosts because dnsexit.com who keep my dynamic IP address matched to my domain name gave me the opportunity to have another domain name (sort of thing) for free and so I picked a name and chose which domain (see) I wanted on the end and pointed it to my IP and started to have a go at setting up the v host.

This is where it didn't go to plan and now I am left with apache not starting at all. So I was hoping that someone could tell me what has happened to cause this please.

At the moment my v host .conf file has every line commented out which is OK as I just want apache to start again and then I'll have a go at setting up v hosts again.

These are the errors I get from event viewer :-

The Apache service named reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80.

The Apache service named reported the following error:
>>> no listening sockets available, shutting down.

The Apache service named reported the following error:
>>> Unable to open logs.

thanks in advance.

EDIT: portcheck.exe shows System using ports 80 and 443 but that doesn't help me much.
Image
User avatar
w4vy
 
Posts: 153
Joined: 04. June 2008 09:58
Location: England

Re: apache won't start after trying to set up v hosts

Postby Izzy » 08. February 2009 23:16

Yet another Vista ghost - SYSTEM in the port check usually means a system service or file is occupying the port and so Apache can't use that port until it is free.

First try and reboot and then see if the SYSTEM still occupies the ports and if so try the following.

You must be an admin or super admin to install and uninstall services and much more in Vista.

Try and uninstall all XAMPP components that are running as a service by running the uninstall_service bat files located in each of the apache and mysql folders.

Make sure you have disabled IIS from the Windows Control Panel and the UAC and no Skype on port 80/443:
viewtopic.php?p=134260#p134260

Then reboot the PC.

Port check should all be free at this point.

If not then go to
start>Run...>
type sc delete apache2.2 >OK

then type sc delete mysql >OK

Then reboot again.

The ports should all be free.

If so then try and start Apache and MySQL again - check the ports again and this time you should see that the XAMPP components are occupying the correct ports.

Try your vhosts file again and paste it here if you get into strife with it.

Good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: apache won't start after trying to set up v hosts

Postby w4vy » 09. February 2009 00:29

Hi Izzy, a reboot did the trick cheers m8. Here's my from my vhosts.conf file :-

#NameVirtualHost *:80 <---what do I do here

#<VirtualHost *:80> <---example.com there instead of * ?
#ServerAdmin webmaster@example.com
#DocumentRoot "X:/xampp/htdocs/example.com" **
#ServerName example.com
#ServerAlias http://www.example.com
#ErrorLog "logs/example.com-error.log"
#CustomLog "logs/example.com-access.log" common
#</VirtualHost>

**<---do I make a folder called examlpe.com inside the htdocs folder and would you be able to access the same domain via the original domain name with /example.com afterwards ? I wouldn't want that if that could be helped. thanks for your help :)
Image
User avatar
w4vy
 
Posts: 153
Joined: 04. June 2008 09:58
Location: England

Re: apache won't start after trying to set up v hosts

Postby Izzy » 09. February 2009 01:39

Don't use the examples, try and create your own entries with the values that you will be using.

Take a look at these search results that have some working examples that can be adapted to your suit own needs.

If the vhosts file you create still has issues then paste it here so I can take a look and make recommendations.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: apache won't start after trying to set up v hosts

Postby w4vy » 09. February 2009 18:52

Ok here is what I have so far in my vhosts file

Code: Select all
# httpd-vhosts.conf file Start

# 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 http://httpd.apache.org/docs/2.2/vhosts/
# for further details before you try to setup virtual hosts.

# Use name-based virtual hosting.

#NameVirtualHost *:80


# 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 *:80>
    ServerAdmin webmaster@d-and-b-computer-services.linkpc.net
    DocumentRoot "X:/xampp/htdocs2"
    ServerName d-and-b-computer-services.linkpc.net
    ServerAlias www.d-and-b-computer-services.linkpc.net
    ErrorLog "logs/d-and-b-computer-services.linkpc.net-error.log"
    CustomLog "logs/d-and-b-computer-services.linkpc.net-access.log" common
</VirtualHost>

##<VirtualHost *:80>
##    ServerAdmin webmaster@dummy-host/site-2.mail.w4vy.co.uk
##    DocumentRoot "X:/xampp/apache/htdocs/dummy-host/site-2.w4vy.co.uk"
##    ServerName dummy-host/site-2.w4vy.co.uk
##    ErrorLog "logs/dummy-host/site-2.w4vy.co.uk-error.log"
##    CustomLog "logs/dummy-host/site-2.w4vy.co.uk-access.log" common
##</VirtualHost>

# Virtual Hosts httpd-vhosts.conf file End


cheers
Image
User avatar
w4vy
 
Posts: 153
Joined: 04. June 2008 09:58
Location: England

Re: apache won't start after trying to set up v hosts

Postby Izzy » 09. February 2009 19:32

Code: Select all
# httpd-vhosts.conf file Start

# 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 http://httpd.apache.org/docs/2.2/vhosts/
# for further details before you try to setup virtual hosts.

# Use name-based virtual hosting.

#NameVirtualHost *:80

# 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 *:80>
##    ServerAdmin webmaster@dummy-host/site-2.mail.w4vy.co.uk
##    DocumentRoot "X:/xampp/apache/htdocs/dummy-host/site-2.w4vy.co.uk"
##    ServerName dummy-host/site-2.w4vy.co.uk
##    ErrorLog "logs/dummy-host/site-2.w4vy.co.uk-error.log"
##    CustomLog "logs/dummy-host/site-2.w4vy.co.uk-access.log" common
##</VirtualHost>

# Virtual Hosts httpd-vhosts.conf file End

## ^^^Everything above here including this line can be deleted if you wish to make it tidy.^^^

NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName d-and-b-computer-services.linkpc.net
ServerAlias www.d-and-b-computer-services.linkpc.net
ServerAdmin webmaster@d-and-b-computer-services.linkpc.net
DocumentRoot "X:/xampp/htdocs2"
<Directory "X:/xampp/htdocs2" >
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/d-and-b-computer-services.linkpc.net-error.log"
CustomLog "logs/d-and-b-computer-services.linkpc.net-access.log" common
</VirtualHost>
The localhost path is to your default Apache htdocs folder - change it to your own default Apache htdocs folder.

The DocumentRoot for your vhost ServerName d-and-b-computer-services.linkpc.net can be any folder on your PC.

You may want to abbreviate the log file names for convenience.

Indenting is not required. left align just makes it easier for editing.

Save the file and restart Apache.

If the domain is registered then make sure it points to your ISP provided IP number at your domain name registrar or dynamic IP service if you are accessing the server from the Internet and make sure at least port 80 is forwarded and open.

Make sure your ISP does not block port 80.

For local access then you need to add this to your
C:\Windows\system32\drivers\etc\HOSTS file:
127.0.0.1 d-and-b-computer-services.linkpc.net

and add your network IP also if required for example
192.0.0.10 d-and-b-computer-services.linkpc.net

You should be able to test it locally after editing the hosts file by going to http://d-and-b-computer-services.linkpc.net
in your browser and seeing your website that is in the xampp\htdocs2 folder.

You should also be able to go to http://localhost and see the XAMPP Welcome Page that is in the xampp\htdocs folder.

If the above works then simply add another virtualhost in the format above if the DocumentRoot is outside of the default Apache htdocs folder.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: apache won't start after trying to set up v hosts

Postby w4vy » 09. February 2009 22:13

cheers izzy I now know how to set up the v host file which is good but now I need another domain name because the one they gave me makes google throw a malware fit. cheers though ;)
Image
User avatar
w4vy
 
Posts: 153
Joined: 04. June 2008 09:58
Location: England


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 97 guests