[Linux-bruxelles] restart Apache2 failed (port 80 already in use)

Didier MISSON didier.misson at total.com
Mar 16 Juin 16:52:39 CEST 2009


linux-bruxelles-bounces+didier.misson=total.com at lists.bxlug.be wrote on 
16/06/2009 15:08:18:

> I apologize for responding in English (I hope Google Translate helps!):

Thanks for your reply.
I know it's not easy to read french ;-)

 
> In your example, ntp is using UDP:123, rather than TCP:80, though it
> does match your grep command due to other output (IPV6 host?). A 
> more precise netstat command to confirm if port 80 is in use is:
> 
> % netstat -an | egrep ":80 " | grep "^tcp"
> tcp6       0      0 :::80                   :::*                   
 LISTEN  

I don't make definition for IP V6, but perhaps default definition ?

 
 
> Normally, with a webserver it would report LISTEN, though it is 
> possible that you may see another state (CLOSE_WAIT) if a service 
> has shut down incorrectly. If the netstat state shows LISTEN, a more
> precise way to find out what is listening on a particular port is touse 
lsof:
> 
> % sudo lsof -i TCP:80
> COMMAND   PID     USER   FD   TYPE  DEVICE SIZE NODE NAME
> apache2 27663     root    3u  IPv6 3586415       TCP *:www (LISTEN)

Ok, I will try this command, the next time I have problem

-1- the Apache2 server was running (I can access to web page)
-2- aptitude update  and  dist-upgrade
-3- aptitude failed to restart Apache2 ...
-4- this port 80 seem in use ...
-5- I try manually to restart Apache2 : failed: port 80 in use
-6- I stop ntpd
-7- Apache2 accept to restart
...
...
(and 1h after, sever blocked (I don't understand why) )

 
> It should normally output nothing, even with NTP running. If I 
> understand your post, apache worked fine after stopping NTP, which I
> think may be a coincidence.
> 
> It is possible that in your apache2 configuration is set to listen 
> on port 80 in two different locations. Try this command:

Normally no, as I don't modify the Apache2 configuration,
and this configuration is running several month ago,
and I have restart this Ubuntu 8.04 server several time without this 
problem.


 
> % grep -ir "^listen" /etc/apache2
> /etc/apache2/ports.conf:Listen 80

ok, I will check this.

 
> You should only see one Listen statement for port 80, and possibly 
> one Listen for port 443 (SSL). If you see more than one Listen 
> statement for port 80, try commenting one of them out. 
> 
> Best of Luck,
> Thomas

Thanks Thomas,

I probably try to check this...
Probably... because my server is yet blocked ! Can't remotly access...
I must reinstall it in DEBIAN (troll inside) and not Ubuntu.

But I don't like that I don't understand why it is blocked...
(Out of Memory)

It's a other problem.
;-)



 
> 2009/6/16 Didier MISSON <didier.misson at total.com>
> 
> Bonjour, 
> 
> Je fais une mise à jour de mon serveur Ubuntu 8.04 : 
> et il bloque au restart d' Apache2 : 
> 
> 
> Dépaquetage de la mise à jour de apache2 ... 
> Paramétrage de apache2-utils (2.2.8-1ubuntu0.8) ... 
> Paramétrage de apache2.2-common (2.2.8-1ubuntu0.8) ... 
> 
> Paramétrage de apache2-mpm-prefork (2.2.8-1ubuntu0.8) ... 
>  * Starting web server apache2 
>                                                                 
>  (98)Address already in use: make_sock: could not bind to address 
0.0.0.0:80 
> no listening sockets available, shutting down 
> 
> 
> Unable to open logs 
>                                                                     
>               [fail] 
> invoke-rc.d: initscript apache2, action "start" failed. 
> 
> 
> 
> Paramétrage de apache2 (2.2.8-1ubuntu0.8) ... 
> Lecture des listes de paquets... Fait 
> Construction de l'arbre des dépendances 
> Lecture des informations d'état... Fait 
> Lecture de l'information d'état étendu 
> Initialisation de l'état des paquets... Fait 
> Construction de la base de données des étiquettes... Fait 
> 
> 
> root at abrasd03:~# ps -A|grep apa 
> root at abrasd03:~# /etc/init.d/apache2 start 
>  * Starting web server apache2 
>        (98)Address already in use: make_sock: could not bind to address 
> 0.0.0.0:80 
> no listening sockets available, shutting down 
> Unable to open logs 
>                                                                     
>               [fail] 
> 
> 
> Je trouve une commande en cherchant dans Google pour voir qui 
> utiliserait ce port : 
> 
> 
> root at abrasd03:~# netstat --listening --programs --numeric-ports | grep 
80 
> udp6       0      0 fe80::21c:c0ff:fe43:123 :::*                    
>            3735/ntpd       
> 
> root at abrasd03:~# ntpq -p 
>      remote           refid      st t when poll reach   delay   offset 
 jitter
> 
==============================================================================
>  ntp1.belbone.be 195.13.23.6      2 u   21   64    3   10.695  -312.96   
2.872
>  ntp2.belbone.be 195.13.23.6      2 u   50   64    1   11.648  -331.05   
0.001
>  syrte8.obspm.fr 145.238.203.14   2 u   36   64    1   31.552  -318.08   
0.001
> ... 
> 
> Effectivement, je fais un stop de ntpd 
> et alors Apache2 redémarre sans problème avec la commande habituelle 
> /etc/init.d/apache2 start 
> 
> Je redémarre ensuite ntp, et pas de problème. 
> 
> Question : comment ce fait-il que ntpd bloquait le port 80 ? 
> 
> Merci, 
> 
> Bon après-midi, 
> 
> -- 
> Didier MISSON
> 
> Total Petrochemicals  Research Feluy
> IT - IS  Telecom
> Zone Industrielle C
> B - 7181 Feluy
> Belgium
> Phone : +32(0)64-51-4860
> Fax : +32(0)64-51-4243
> mailto:didier.misson at total.com 
> 
> ¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨°ºo§oº°¨¨¨¨
> --
> Linux-bruxelles mailing list
> Linux-bruxelles at lists.bxlug.be
> http://lists.bxlug.be/mailman/listinfo/linux-bruxelles

> 
> 
> 
> -- 
> // thomas
> 
> 
> -- 
> Linux-bruxelles mailing list
> Linux-bruxelles at lists.bxlug.be
> http://lists.bxlug.be/mailman/listinfo/linux-bruxelles
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: </pipermail/linux-bruxelles/attachments/20090616/a17c3b73/attachment-0002.html>


Plus d'informations sur la liste de diffusion Linux-bruxelles