Errors installing Apache web server on Windows XP alongside IIS 6.0

Ok this might have more relevance that just to Windows XP and/or IIS 6.0 but its how I found it.

I’m doing a piece of work at the moment (retrofitting something for a website) that takes advantage of some Apache modules. The site PHP/MySql (essentially WAMP) and in the past I have just worked with PHP in the WIMP environment. It was my first go at installing Apache and it didn’t go well. Firstly, the installer said consult install.txt for help installing (that will be the file that the installer creates – correct? f**king brilliant thinking that). I’m not having a go at the Apache web server, I don’t know enough about it to form an opinion, but put the install instructions somewhere they can be read BEFORE you install it.

Anyway, having eventually installed with a domain name of ‘localhost’, a server name of ‘bluebox’ (my machine name) and my email address for the admin email (makes sense), and choosing to install it as a service on port 80, off I went. Now I knew ahead of time that there was going to be a conflict with port 80 with IIS but having read a bit knew that I could resolve that later by some tweaking to httpd.conf file, I went ahead with port 80 (I’ll jsut change it 8080 later).

The install completes and it attempts to start the service for the first time; Two errors and the crux of the post:

httpd.exe: Could not reliably determine the server’s fully qualified domain name
, using 192.168.0.2 for ServerName

Eventually traced this down to the fact that installer seems to have just ignored that I’d chosen localhost for the server name and left the line commented out in httpd.conf.

# Look forServerName localapache:8080

… and remove the #. And its using a different server name to the one I specified in the installer (er why???). Ok localapache:8080 is fine by me. First problem solved.

(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:8080
no listening sockets available, shutting down
Unable to open logs

This is common with services that do anything with standard ports (80 for example). The solution is to find what is listening on the port that the service wants to listen on and kill it, or do some port reassingment. To find this open a command prompt and type:

netstat -a -o

For info the -a switch displays all connections and listening ports and the -o switch identifies the process id that is lisenting on that port. Now keep in mind that my httpd.conf is now set to use localapache on port 8080 so in my case I’m looking for anything listening on that port. Sure enough I find one. Take note of the process ID and open up Task Manager and click the Processes tab. Click the PID column to order on that column and scroll down to find your offending process. A common offender is Skype listening on port 80 (if you have Apache set to listen on port 80 instead of 8080 as in my example). In my case it was the Sql Server Reporting Service on port 8080. Stopped those two services in the services manager (don’t just kill them .. close them properly and while your there maybe set them to not start automatically). Started the Apache service and sure enough it started. Opened a browser and browsed to http://localapache:8080 and got the lovely “It Worked” message.

Hopefully this will be useful to others.

As an aside, it is a bit crap that Skype has a thunking mechanism to use port 80 or 443 if it can’t get through the firewall on its port of choice. But contrary to popular belief this can be turned off. In Skype goto Tools -> Options -> Advanced -> Connection … and uncheck the box marked Use port 80 and 443 as alternates for incoming connections.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s