Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
chieuphu
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2004
Posts: 131

PostPosted: Thu Jun 01, 2006 7:47 pm    Post subject: Apache2 error Reply with quote

I got this error when starting apache
Code:
/etc/init.d/apache2 restart                                                                                                            /etc/conf.d
 * Re-caching dependency info (mtimes differ)...
 * Starting apache2...
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs

Please help
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Thu Jun 01, 2006 7:56 pm    Post subject: Reply with quote

how about the last few (~30) lines of /var/log/apache/error_log ?

Also, do you mean to be trying to listen on the SSL port? (that's what 443 is) - if you do, did you create yourself a key and sign it?
Back to top
View user's profile Send private message
chieuphu
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2004
Posts: 131

PostPosted: Thu Jun 01, 2006 8:09 pm    Post subject: Reply with quote

savage wrote:
how about the last few (~30) lines of /var/log/apache/error_log ?

Also, do you mean to be trying to listen on the SSL port? (that's what 443 is) - if you do, did you create yourself a key and sign it?


Yes I do want it to listen to SSL and do have a key and signed it.

Code:
[Thu Jun 01 12:58:32 2006] [error] [client 130.207.128.120] File does not exist: /home/httpd/htdocs/password/favicon.ico
[Thu Jun 01 12:58:33 2006] [error] [client 130.207.128.120] File does not exist: /home/httpd/htdocs/password/favicon.ico
[Thu Jun 01 12:59:14 2006] [notice] caught SIGTERM, shutting down
[Thu Jun 01 12:59:15 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Thu Jun 01 12:59:15 2006] [warn] RSA server certificate CommonName (CN) `password' does NOT match server name!?
[Thu Jun 01 12:59:15 2006] [warn] RSA server certificate CommonName (CN) `webmail' does NOT match server name!?
[Thu Jun 01 12:59:15 2006] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 01 12:59:15 2006] [notice] Digest: done
[Thu Jun 01 12:59:16 2006] [warn] RSA server certificate CommonName (CN) `password' does NOT match server name!?
[Thu Jun 01 12:59:16 2006] [warn] RSA server certificate CommonName (CN) `webmail' does NOT match server name!?
[Thu Jun 01 12:59:16 2006] [notice] Apache configured -- resuming normal operations
[Thu Jun 01 12:59:18 2006] [error] [client 130.207.128.120] Directory index forbidden by rule: /home/httpd/htdocs/password/
[Thu Jun 01 13:08:51 2006] [error] [client 130.207.128.120] Directory index forbidden by rule: /home/httpd/htdocs/password/
[Thu Jun 01 13:10:52 2006] [error] [client 130.207.128.120] Directory index forbidden by rule: /home/httpd/htdocs/password/
[Thu Jun 01 13:47:47 2006] [error] [client 130.207.128.120] Directory index forbidden by rule: /home/httpd/htdocs/password/
[Thu Jun 01 14:41:11 2006] [notice] caught SIGTERM, shutting down
[Thu Jun 01 14:41:13 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Thu Jun 01 14:41:14 2006] [warn] RSA server certificate CommonName (CN) `password' does NOT match server name!?
[Thu Jun 01 14:41:14 2006] [warn] RSA server certificate CommonName (CN) `webmail' does NOT match server name!?
[Thu Jun 01 14:41:14 2006] [notice] Digest: generating secret for digest authentication ...
[Thu Jun 01 14:41:14 2006] [notice] Digest: done
[Thu Jun 01 14:41:14 2006] [warn] RSA server certificate CommonName (CN) `password' does NOT match server name!?
[Thu Jun 01 14:41:14 2006] [warn] RSA server certificate CommonName (CN) `webmail' does NOT match server name!?
[Thu Jun 01 14:41:14 2006] [notice] Apache configured -- resuming normal operations
[Thu Jun 01 14:41:29 2006] [error] [client 130.207.128.120] Directory index forbidden by rule: /home/httpd/htdocs/password/
[Thu Jun 01 15:17:15 2006] [notice] caught SIGTERM, shutting down
[Thu Jun 01 15:17:16 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Thu Jun 01 15:17:16 2006] [warn] RSA server certificate CommonName (CN) `password' does NOT match server name!?
[Thu Jun 01 15:17:16 2006] [warn] RSA server certificate CommonName (CN) `webmail' does NOT match server name!?
[Thu Jun 01 15:17:17 2006] [notice] Digest: generating secret for digest authentication ...
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Thu Jun 01, 2006 8:18 pm    Post subject: Reply with quote

what about the output from
Code:

netstat -natp | grep LISTEN


It sounds like you have an httpd daemon running on :443 already. This command will show us what services you have running, and if one has port 443 open, you will be able to see what pid it has.
Back to top
View user's profile Send private message
chieuphu
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2004
Posts: 131

PostPosted: Thu Jun 01, 2006 8:24 pm    Post subject: Reply with quote

savage wrote:
what about the output from
Code:

netstat -natp | grep LISTEN

Code:

netstat -natp | grep LISTEN                                                                                                 /var/log/apache2
tcp        0      0 0.0.0.0:32769           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      1562/               
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      1562/               
tcp        0      0 0.0.0.0:680             0.0.0.0:*               LISTEN      1770/rpc.statd     
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      1562/               
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      1936/spamd.pid -aqx
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1758/               
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      1562/               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      17441/apache2       
tcp        0      0 0.0.0.0:2000            0.0.0.0:*               LISTEN      1562/               
tcp        0      0 0.0.0.0:2004            0.0.0.0:*               LISTEN      1562/               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2043/sshd           
tcp        0      0 0.0.0.0:694             0.0.0.0:*               LISTEN      1787/rpc.mountd     
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      1294/cupsd         
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1989/               
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      17441/apache2 


when I do ps -ef | grep apache, I see it running. So I kill that process and restart apache ok. But when I stop it, I have this error and the problem re-occur.

Code:
 ps -ef | grep apache                                                                                                             /var/log/apache2
root     17143     1  0 16:17 ?        00:00:00 /usr/sbin/apache2 -D DEFAULT_VHOST -D SSL -D PERL -D PHP5 -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -k start
17262 16720  0 16:19 pts/1    00:00:00 egrep apache
% sudo kill -9 17143                                                                                                               /var/log/apache2
% /etc/init.d/syslog-ng restart                                                                                                    /var/log/apache2
 * ERROR: must be root to run init scripts
% sudo /etc/init.d/apache2 start                                                                                                   /var/log/apache2
 * Starting apache2...                                                                                                                                    [ ok ]
% sudo /etc/init.d/apache2 stop                                                                                                    /var/log/apache2
 * Stopping apache2...
httpd (no pid file) not running                                                                                                                           [ ok ]
% sudo /etc/init.d/apache2 start                                                                                                   /var/log/apache2
 * Starting apache2...
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs               

When I start apache, my webpage does not seem to load with this error.
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Thu Jun 01, 2006 8:30 pm    Post subject: Reply with quote

for the fun of it, what happens if you use
Code:
su -
/etc/init.d/apache2 stop


instead of sudo?

Try starting and stopping it inside a shell with 'su -' instead of sudo. (once you have killed it again)

Another thing to try is apachectl to stop it instead of kill.

interestingly enough, it is not letting apache start the second time because it is already running :-)
Back to top
View user's profile Send private message
chieuphu
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2004
Posts: 131

PostPosted: Fri Jun 02, 2006 3:08 pm    Post subject: Reply with quote

savage wrote:
for the fun of it, what happens if you use
Code:
su -
/etc/init.d/apache2 stop


instead of sudo?

Try starting and stopping it inside a shell with 'su -' instead of sudo. (once you have killed it again)

Another thing to try is apachectl to stop it instead of kill.

interestingly enough, it is not letting apache start the second time because it is already running :-)


I try that. Same thing happens.
The funny things is that now my webpage does not load any more. On the browser, it does not say page not found or any thing. It stucks in loading till time out.
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Fri Jun 02, 2006 8:07 pm    Post subject: Reply with quote

okay - when you say you cannot access your home page, and you say that it times out, I assume you are using some name for your computer, and it is not resolving.

Do you have a static ip address? If you do, does your /etc/hosts file point the name of your box to your ip address?

can you ping the hostname (whatever you use) to access the website?

if you all of the above work, run the `netstat -nat` command again, and verify that your box has port 80 open. If it does, try `telnet localhost 80` and type "GET / http/1.0" (without the quotes), and see if you get something as a response. If you do, try going to the _non_secure website in a browser.

I was noticing in your error logs that it was trying to access "/home/httpd/htdocs/password/", but it has been forbidden in your apache config file.

Let's first figure out if name resolution is working on your box, then we will troubleshoot your apache.
Back to top
View user's profile Send private message
chieuphu
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2004
Posts: 131

PostPosted: Fri Jun 02, 2006 8:25 pm    Post subject: Reply with quote

savage wrote:
okay - when you say you cannot access your home page, and you say that it times out, I assume you are using some name for your computer, and it is not resolving.

Do you have a static ip address? If you do, does your /etc/hosts file point the name of your box to your ip address?

can you ping the hostname (whatever you use) to access the website?

if you all of the above work, run the `netstat -nat` command again, and verify that your box has port 80 open. If it does, try `telnet localhost 80` and type "GET / http/1.0" (without the quotes), and see if you get something as a response. If you do, try going to the _non_secure website in a browser.

I was noticing in your error logs that it was trying to access "/home/httpd/htdocs/password/", but it has been forbidden in your apache config file.

Let's first figure out if name resolution is working on your box, then we will troubleshoot your apache.

I restart the box and it works. Dont know what happened. Thanks very much for your help. :)
Back to top
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Fri Jun 02, 2006 8:28 pm    Post subject: Reply with quote

marvelous. Happy to help.

Probably would be a good idea to figure out what happened specifically. Usually, you don't want things like that happening without you being able to account for it. Make sure you can account for all of your open ports and running processes.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4983
Location: Gothenburg, Sweden

PostPosted: Fri Jun 02, 2006 9:02 pm    Post subject: Reply with quote

Moved from Portage & Programming to Networking & Security.
_________________
Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum