Apachi Error OS10048 (Port and IP address issue)

I have the following error on starting Apachi, I am aware that I must change the port however what do I change the IP address to?  

<OS 10048>Only one usage of each socket address (protocal/network address/port) is
normally permitted. :make_sock: could not bind to address 0.0.0.0:80 no listening
sockets available, shutting down.
Unable to open logs

NOTE: My PC is for development only and not a web server.
LVL 2
Ryan BayneWordPress DeveloperAsked:
Who is Participating?
 
samriConnect With a Mentor Commented:
hi,

if the firewall is on a separate device/machine, then it should not contribute to this problem.

I ran a search on Google - http://www.google.com/search?q=OS+10048+xp+apache+%22could+not+bind%22&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

and followed two links -- which mentioned something about Skype.

http://www.apachelounge.com/forum/viewtopic.php?p=8292
http://www.oneafrikan.com/archives/2006/06/16/apache2-install-setup-on-windows-xp-pro/

If this may be related, or maybe other software that behave in similar manner -- so alternative would be to reconfigure that offending software to use different port (anything other than 80/tcp.  Or, get Aapche to Listen to different port.  

If you could not find the culprit -- then you need to sort out with setting apache to Listen to other port then -- let say "Listen 90".  This would not be too much issue with your development -- hopefully your web codes are using relative linking.  So instead of typing http://localhost/, now you need to use http://localhost:90/ (if port 90 is being used).

give it a go.

cheers.
0
 
namolCommented:
The IP address 0.0.0.0 is telling us that apache is binding to all unassigned address at port 80. Try making the IP address 127.0.0.1 in your httpd.conf file and then restart apache. The line should be similiar to this: Listen 0.0.0.0:80 so you would change it to Listen 127.0.0.1:80
0
 
samriCommented:
what is your OS/Version?

Is is possible to see what is the current apache config for "Listen" directive.

recommendation from namol would cause Apache to start and would listen on 127.0.0.1 (loopback), which should work if you are working on the server itself.  but if you are working a separate machine, then you may not be able to connect to apache.

by default the configuration should have:
Listen 80  

which would cause apache to bind to port 80/tcp on all active network interfaces running tcp/ip.

cheers.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Ryan BayneWordPress DeveloperAuthor Commented:
I'm using XP and using Apachi and PHP for development and testing on this computer only. The files are uploaded to the server later. The apachi symbol should show in the tray yes because sometimes when I change the port to a random number and Start it I do not get an error yet I do not have that try icon.

This is the only two lines with one of them not active I changed the port to random numbers but it doesnt seem...
#Listen 12.34.56.78:80
Listen 80

So is it a must that it uses port 80 I need to find out whats using that port and stop it but then what if that program needs port 80!
0
 
samriCommented:
>> #Listen 12.34.56.78:80
this would tells apache to bind to port 80/tcp on IP address 12.34.56.78.  should be fine if your machine had a fix ip.  otherwise may cause problem if your ip is coming from DHCP.

>> Listen 80
would tell apache to listen to port 80/tcp on all active interface.

if apache failed to start -- the apache monitor in your windows stytray is shodwing red, then open a dos prompt, and do a "telnet localhost 80" assuming that your apache is running on port 80.

you should get a blank screen.  if any program is running on port 80.  otherwise you would get error:
Connecting To localhost...Could not open a connection to host on port 80 : Connect failed

alternately you could do a "netstat -n" to view the network connection:

  Proto  Local Address          Foreign Address        State
  TCP    127.0.0.1:80           127.0.0.1:3683         TIME_WAIT
  TCP    192.168.1.253:80       192.168.1.254:45712    TIME_WAIT

* in my case I had apache running (Listen 80 in the config file)

Or you could grab TCPview tool from microsoft -- which would let you see active program and any network connection.  nice tool.

http://www.microsoft.com/technet/sysinternals/utilities/tcpview.mspx
0
 
Ryan BayneWordPress DeveloperAuthor Commented:
I'll bump the points up a little once again.
TCPView doesnt show port 80 being used or any port under a 4 digit number!

Could my error message be caused by something else. I would not have thought it would be this difficult to install and use a program on the same machine.
0
 
samriCommented:
no issue with the points.  however, bigger pts would lure more help. pts are like 'rewards' here :)

well I am a bit puzzled too.  Do you have Windows firewall running that may be preventing apache to bind to port 80.  If you do had it running, disable it for a while, or add exclusion to allow apache to listen on port 80.

I had ran apache on XPSP2 on a number of machine and so far things are good -- never ran into this kind of issue.

any other application/services that may be running -- firewall, antivirus, vpn client, etc.


Personally, I would try to reinstall.  I knew that this may not be a favorable choice sometimes, but it would be useful to ensure that we start from scratch.

http://apache.leakage.org/httpd/binaries/win32/

http://apache.leakage.org/httpd/binaries/win32/apache_2.2.6-win32-x86-no_ssl.msi
http://apache.leakage.org/httpd/binaries/win32/apache_2.2.6-win32-x86-openssl-0.9.8e.msi
0
 
Ryan BayneWordPress DeveloperAuthor Commented:
Ye I did consider reinstallation I just get the feeling thats not it. I do have a firewall running but then I assumed because I'm only developing on this machine and using Apachi PHP MySQL for development and testing that firewalls or my router to go even further, would not be an issue.

I'll go into all that see what happens when they are disabled thanks for the advice.
0
 
Ryan BayneWordPress DeveloperAuthor Commented:
OK One last question then I think we might be able to wrap this up/

http://localhost:90  allows Apachi to run START without error, but still the icon is not in the tray so thats a problem but that directory appears in the brower with the list of files so maybe its not!

PHP files display as '?' is this a problem with my PHP configuration because if so the
 http://localhost:90  is good and I'll dish out the points lol
0
 
samriCommented:
assuming that you had apache installed with the default option.  It would be installed in the following folder "C:\Program Files\Apache Software Foundation\Apache2.2"

Look in the folder "C:\Program Files\Apache Software Foundation\Apache2.2\bin"

there should be a file named "ApacheMonitor.exe"

Run this file -- this is the icon that you would have in the windows systray.

Copy or create a link to this file to your Startup folder to make ApacheMonitor to be running every time you login to the machine.

you could copy/shortcut into "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" so that any user who logged in would get the icon.

the PHP portion -- are you saying you are seeing the PHP code instead of the "result" from the php?  if this is the case, probably the PHP setup/configuration is the problem.  relook at that.  THe readme that comes with PHP should give you some idea on how to setup apache and php together.


cheers.




0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.