Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

APACHE ERROR

Status
Not open for further replies.

johny2K

Technical User
Dec 19, 2001
184
0
0
CA
hi everyone,

does anyone has the same problem as this?

[root@redhat8-uk conf]# /etc/rc.d/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to addres0
no listening sockets available, shutting down
[FAILED]
[root@redhat8-uk conf]#

i am trying to startup apache.

thanks.
 
It seems to me like you are calling the script that calls /usr/sbin/httpd at boot up. The script does not take an arg on the command line so "start" is ignored. The error you are getting, usually means that httpd is already running or something else is listening to port 80 which is generally the case. If you are running RedHat, you should be able to use the command '/usr/sbin/apachectl start|stop|restart'.
 
In case you want to verify what process is already bound to port 80, try "fuser -n tcp 80". That will show you the PID and name of whatever is using it. That error sounds like you already have apache running though.

--
JR
 
hello there...

these are the things that popped-up....

[root@redhat8-uk /]# /usr/sbin/apachectl start|stop|restart
-bash: stop: command not found
-bash: restart: command not found
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
[root@redhat8-uk /]# fuser -n tcp 80
[root@redhat8-uk /]#

any idea?

 
Hi,

Try netstat -an | grep 80. Paste here the result, please?

regards,
feroz
 
I think you did the literal:
Code:
/usr/sbin/apachectl start|stop|restart
Try this instead:
Code:
/usr/sbin/apachectl start
or
Code:
/usr/sbin/apachectl stop
or
Code:
/usr/sbin/apachectl restart

Try the 'restart' one first. Also, are you sure you're doing this as 'root'? Since apache is running on a privileged port (<1024), it needs root privileges to get started (it drops privileges later and runs as www, nobody, something like that).

--
JR
 
This is a bug in redhat 8.0 get the fix for it.
 
here's what i got this time:

root 827 790 0 11:12 pts/0 00:00:00 grep tux
[root@redhat8-uk root]# netstat -an | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN

then;

[root@redhat8-uk root]# /usr/sbin/apachectl restart
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
[root@redhat8-uk root]# /usr/sbin/apachectl start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

ALSO, what's TUX? - does it ring you a bell! I saw it during startup.

Thanks.

 
Try running [tt]netstat -pnat | grep 80[/tt] which would show you which process is using it.

//Daniel
 
it shows:

[root@redhat8 net]# netstat -pnat | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
 
it shows:

[root@redhat8-uk net]# netstat -pnat | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
 
It's missing a column. Try to remove the [tt] | grep 80[/tt] part and examine the output manually.

//Daniel
 
RedHat 8 by default uses Apache 2.0.40. For some reason, that I do not know, Apache seems to listen on port 80 by default and that default loads before the httpd.conf file loads. Here is what I did to make my Apache work:

1) Remark out your Listen directive.

2) Use the ServerName directive to assign the port. i.e. ServerName
That should do it for you.
 
under &quot;/etc/httpd/conf/httpd.conf&quot;, i modified the ff:

#Listen *:80 (Remarked out)

ServerName redhat8:80 (Added port :80)


this one work in bringing up APACHE. but until now, i can't see the &quot;successful test page&quot; for APACHE. the page cannot be found.

i think, i'm getting there but would appreciate more inputs.
 
You need to add the DirectoryIndex directive. i.e.
DirectoryIndex index.html

You may also need to add the DocumentRoot directive. If I remember right this will probably be set for you already. If not set it like so:

DocumentRoot &quot;/var/ <-- or whatever directory you want for your root.

I am still a newbie to this myself so I say this with the up most respect for your position. It would be a good idea to get a book on Apache to help with these questions. The one I find most helpful is the &quot;Bible&quot; series from IDG Books. I found the solutions to these problems you are having from reading the first 5 chapters of the book.

If you are still having problems let us know.
 
It doesn't matter. The default install for RH8 w/apache creates the httpd.conf for you which includes all the directives for seeing the test page.

There was a bug in Apache when 8 first came out.
I would suggest running up2date and update the system or go to Redhats site and get the newest RPM for apache.

Then tell us if it works or not.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top