PDA

View Full Version : Service httpd restart FAILED what is wrong ?



benzersiz
02-14-2009, 03:18 PM
[root@ns1 ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: Warning: DocumentRoot [/home/alkoliyiz/domains/alkoliyiz.info/pu blic_html] does not exist
Warning: DocumentRoot [/home/alkoliyiz/domains/alkoliyiz.info/private_html] does not exist
Warning: DocumentRoot [/home/knight/domains/knight-silkroadonline.com/public_htm l] does not exist
Warning: DocumentRoot [/home/knight/domains/knight-silkroadonline.com/private_ht ml] does not exist
Warning: DocumentRoot [/home/mardin/domains/mardinli.net/public_html/mp3ara] doe s not exist
Warning: DocumentRoot [/home/mardin/domains/mardinli.net/public_html/programlar] does not exist
Warning: DocumentRoot [/home/mardin/domains/mardinli.net/public_html/video] does not exist
Warning: DocumentRoot [/home/bekir/domains/malatyaforum.com/public_html/haber] d oes not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/forum] does not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/haber] does not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/m\xfcz ik] does not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/oyun] does not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/radyo] does not exist
Warning: DocumentRoot [/home/bekir44/domains/productionsz.net/public_html/video] does not exist
Warning: DocumentRoot [/home/eceerken/domains/eceerken.gen.tr/public_html/sohbet ] does not exist
Warning: DocumentRoot [/home/ecesohbet/domains/ecesohbet.com/public_html/radyo] does not exist
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.133:80 has no VirtualHosts
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.133:443 has no VirtualHosts
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.132:80 has no VirtualHosts
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.132:443 has no VirtualHosts
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.131:80 has no VirtualHosts
[Sun Feb 15 01:12:36 2009] [warn] NameVirtualHost 212.174.173.131:443 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(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


HOW CAN I FIX IT ?

floyd
02-14-2009, 03:32 PM
netstat -npa | grep LISTEN

benzersiz
02-14-2009, 03:45 PM
yeah i saw it there are logs dhould i send to here ?

floyd
02-14-2009, 03:54 PM
yeah i saw it there are logs dhould i send to here ?

Saw what in the logs?

I am asking you run the command to see what is listening on port 80 that is preventing apache from binding to port 80.

benzersiz
02-14-2009, 03:56 PM
[root@ns1 ~]# netstat -npa | grep LISTEN
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 3031/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 3031/dovecot
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 8497/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 8386/exim
tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 8377/directadmin
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 3031/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 3031/dovecot
tcp 0 0 0.0.0.0:975 0.0.0.0:* LISTEN 2913/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2894/portmap
tcp 0 0 212.174.173.133:53 0.0.0.0:* LISTEN 9201/named
tcp 0 0 212.174.173.132:53 0.0.0.0:* LISTEN 9201/named
tcp 0 0 212.174.173.131:53 0.0.0.0:* LISTEN 9201/named
tcp 0 0 212.174.173.130:53 0.0.0.0:* LISTEN 9201/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 9201/named
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 8418/proftpd: (acce
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 8252/cupsd
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 9201/named
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 8386/exim
tcp 0 0 :::80 :::* LISTEN 8410/httpd
tcp 0 0 :::22 :::* LISTEN 8346/sshd
tcp 0 0 ::1:953 :::* LISTEN 9201/named
tcp 0 0 :::443 :::* LISTEN 8410/httpd
unix 2 [ ACC ] STREAM LISTENING 13667 8497/mysqld /var/lib/mysql/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 12601 8396/gpm /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 13414 8453/dbus-daemon-1 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 6212 3021/acpid /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 6238 3031/dovecot /var/run/dovecot/dict-server
unix 2 [ ACC ] STREAM LISTENING 6240 3031/dovecot /var/run/dovecot/login/default
unix 2 [ ACC ] STREAM LISTENING 6245 3031/dovecot /var/run/dovecot/auth-worker.3033

blueice
02-15-2009, 11:48 AM
Saw what in the logs?

I am asking you run the command to see what is listening on port 80 that is preventing apache from binding to port 80.
and me i have the same problem last days. Hapen every day.
in port 80 listen:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20827/log

blueice
02-15-2009, 12:10 PM
and me i have the same problem last days. Hapen every day.
in port 80 listen:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20827/log
also this is the prosess for port 80:
apache 20827 0.0 0.0 6316 2736 ? S 08:55 0:00 /usr/sbin/apache/log

but with:
server:~# ls /usr/sbin/apache/log
ls: /usr/sbin/apache/log: No such file or directory

floyd
02-16-2009, 04:19 PM
tcp 0 0 :::80 :::* LISTEN 8410/httpd
tcp 0 0 :::443 :::* LISTEN 8410/httpd


Looks like its listening on port 80 to me.

floyd
02-16-2009, 04:20 PM
also this is the prosess for port 80:
apache 20827 0.0 0.0 6316 2736 ? S 08:55 0:00 /usr/sbin/apache/log

but with:
server:~# ls /usr/sbin/apache/log
ls: /usr/sbin/apache/log: No such file or directory

This is definitely not normal.

Try:

ls -l /proc/20827

Meesterlijk
02-18-2009, 01:40 AM
I have the exact same thing on just one FreeBSD server since feb. 14th.

79369 apache 1 132 0 3904K 3212K RUN 17.4H 97.85% perl5.8.8
The process is hard to kill, but at nightly httpd restart apache will fail to start and will stay down until that process is killed manually.

Does anyone found a cause for this?

blueice
02-18-2009, 02:10 AM
I have the exact same thing on just one FreeBSD server since feb. 14th.

79369 apache 1 132 0 3904K 3212K RUN 17.4H 97.85% perl5.8.8
The process is hard to kill, but at nightly httpd restart apache will fail to start and will stay down until that process is killed manually.

Does anyone found a cause for this?

Thanks
Robert
i have do this:

***************
cd /usr/local/directadmin
mv custombuild custombuild.old
wget http://files.directadmin.com/services/custombuild/1.1/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
./build update_data
#if you want to customize your options.conf (eg, setup suPhp/cgi, do it here.)
./build all d
*****************
(in simple words recompile the apache but with totaly redownload all the files and settings)

Until now all work good.

laMEd
02-18-2009, 02:45 AM
I got the same problem every day for 3 days in a row. What to do?

Meesterlijk
02-18-2009, 02:50 AM
I got the same problem every day for 3 days in a row. What to do?

Which OS do you use?
Tell me your httpd version?
Also, do you use atmail, you have an old version of Roundcube left in /var/www/html ?

laMEd
02-18-2009, 03:18 AM
I got the same problem every day for 3 days in a row. What to do?

Which OS do you use?
Tell me your httpd version?
Also, do you use atmail, you have an old version of Roundcube left in /var/www/html ?

It is Debian

I did the custom build thats suggested in this thread and it does not show any version number now.

Well I got roundcube 0.1.1 in /var/www/html

I also updated DA through the panel update option few days back

Meesterlijk
02-18-2009, 03:24 AM
I did the custom build thats suggested in this thread
When, today or yesterday and httpd crashed afterwards last night?

You see nothing when you do this on the commandline?: httpd -v
Check the 'system information' in DA.

Aslo, update Roundcube with custombuild.

Meesterlijk
02-18-2009, 04:00 AM
It appears it concerns a mambo hack, see http://www.webhostingtalk.com/showthread.php?t=478039

Look for a .txt file in /tmp probably starts with a number and delete it.

Also, insert this inyour php.ini file:


disable_functions = "exec,system,passthru,readfile,escapeshellarg,proc_close,proc_open,dl,popen"

and restart httpd

Update or remove that awefull mambo stuff ;)

floyd
02-18-2009, 04:58 AM
Its also good to check if there is a crontab for apache. There should not be.

laMEd
02-18-2009, 09:58 AM
Apache version is 2.2.9

So the httpd crashed again few hours after the custombuild

I updated the roundcube now

There is no mambo/joomla/xoops installed on that box

There is no .txt file in the /tmp folder


jel:/tmp# ls
mysql.sock sess_6b3de4ab193aa4248e0204416572b415
pear sess_7b3da53654947f9898b9444d404504fa
sess_064c1111bfe2688de8468eff08cce2ec sess_8808b7326557c3b1ae2c154b35c36e9c
sess_10a86ffeaadb9c0bc970433012719333 sess_933c98f96a01ecf9313e9cfe64c93bef
sess_153a30e38bbeb0b3481ce4d57cc38837 sess_984afc1e960648975609195f32f4ca75
sess_343f2cc8d9f4307d7a0c01d7c34f3d7b sess_9e06a8cc2745db5fb55d14aefa63d9ff
sess_42bf3e40808e4373bd5bb5381bfe7910 sess_a051a3191713fa82101400b3704e8e78
sess_43161c9f393d30bcf67b2aa44ef0d0dd sess_cc68097ac751dd12fa7e83f377362740
sess_433426b1780986d0f5e1467126ec8646 sess_e64f39d868229f66902b068bec8375b6
sess_5a6393bc4559cde71ae0626225c192d6 sess_ec7f5d79570d5b0b5a7eb4818bb372d9
sess_6aad8419f572d1c532115052f1e428b4


My crontab



jel:/tmp# crontab -l
0 5 15 * 0 /usr/local/sysbk/sysbk -q

Aero
02-23-2009, 08:52 AM
Hi, I've been having the same problem, on two servers actually. With one we just removed directadmin completely, but with the other one that's not an option.

Every night when Directadmin does the "Tally", it restarts apache. But it doesn't stop apache correctly somehow and port 80 (and sometimes port 443 too) are still in use by a not-working apache process. Apache won't restart because ports in use is a critical error and it just closes again:

httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

Quick manual fix:

Search for ports in use:
# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 6617 apache 4u IPv6 527364 TCP *:www (LISTEN)

Kill the process using the PID:
# kill -9 6617


After that you can restart apache normally. But I'm really hoping directadmin can provide us with a permanent solution.

Here's wat seems to be a solution: http://help.directadmin.com/item.php?id=31. But it's an old help file, those files/paths are not available on my server. Plus I'm using Debian as well, and the commands there are for redhat/freebsd. :( Is this custombuild thing doing the same as described on that help-page?

scsi
02-23-2009, 09:54 AM
chmod 0 /etc/init.d/httpd

Aero
02-24-2009, 09:02 AM
chmod 0 /etc/init.d/httpd
chmod 0 removes all privileges for all. - How does that fix the problem exactly?

scsi
02-24-2009, 11:43 AM
It will stop it from restarting apache.

nobaloney
02-24-2009, 11:47 AM
Which generally means it will stop all programs from managing apache; including when a server boot, shuts down, or restarts. It will probably stop DirectAdmin from restarting apache even when you want it to.

Jeff

scsi
02-24-2009, 11:51 AM
You can use apachectl instead :)

Aero
02-24-2009, 03:16 PM
That's not really a solution, they need to be able to restart the server normally.

Is there any way to contact the DirectAdmin support directly? Because our hosting provider has pretty much said "It's not our problem".

nobaloney
02-25-2009, 11:27 AM
You get support from your DirectAdmin supplier. Lifetime licenses from DirectAdmin include limited support for the first X months (I don't remember how many). If you buy DirectAdmin with period licenses, you get full support from DirectAdmin staff.

If you pay your provider for DirectAdmin, then support is supposed to be up to them. Perhaps if they say it's not their problem you can ask them to remove their DirectAdmin license, and give you a discount, and then buy a license yourself from DirectAdmin. You should expect to pay more, though, because data centers pay less for DirectAdmin licenses since they're supposed to do their own support, and support is really the most expensive part of any control panel.

You can certainly ask DirectAdmin if they'll help you; they may. You can reach them here (http://www.directadmin.com/support.html).

Jeff

Aero
02-25-2009, 03:08 PM
Thanks for that info, I'm starting to get the feeling our hosting provider is trying to get us to pay for a SLA... Anyway, they're switching us to a new VPS now, hopefully that will solve our problem as well.

On another forum this solution was offered, and it sounds like it could be a good solution for the problem: http://help.directadmin.com/item.php?id=181

Haven't tried it, because they're moving our stuff now, but hopefully that will be of help to others with the same problem. :)

gisha
02-25-2009, 11:37 PM
Got the same problem on 2 servers of mine (start about 2 weeks ago) every few days i need to use kill -9 in order to kill the apache and then restart it. i think it's might be a problem with the last version of directadmin (some kind of bug or someting), i'm using directadmin for about 4-5 years and never had this kind of problem before.

Anyone can confirm that it will be solved in the next version of directadmin (some kind of bug fix or someting) ?

Thanks.

hostpc.com
02-26-2009, 02:54 AM
killall -9 exim
service httpd restart
service exim restart

That should solve the issue, if not, just reboot from the command line, or via the DA interface

Aero
02-26-2009, 06:42 AM
@hostpc.com: that works, but that's not a permanent fix for the problem (almost daily crashing apache).

@gisha: I doubt it. If you have the exact same problem with ports in use like in this older help doc (http://help.directadmin.com/item.php?id=31).. look at the date there, 2004. I'm amazed this is still an issue today, you'd think they would update those scripts to restart apache properly especially because the tally happens daily.

Gisha, maybe you can try out this other solution (http://help.directadmin.com/item.php?id=181), looks like it could help in restarting apache properly.

nobaloney
02-26-2009, 09:20 AM
@hostpc.com: that works, but that's not a permanent fix for the problem (almost daily crashing apache).
If you check a lot of threads in these forums you'll see that apache and exim clash on port 80. So it actually is a permanent fix. Install it into your httpd control script as part of the restart section. Stopping exim momentarily each time you restart apache is NOT a problem.

Jeff

DirectAdmin Support
03-01-2009, 11:28 AM
Hello,

I belive roundcube 0.1 may be playing a role in the issue. Please ensure you do not have roundcube 0.1 running.
Here are some tips to secure your system:
http://help.directadmin.com/item.php?id=247

The "/usr/sbin/apache/log" program, or the "www" program that were bound to port 80 are *highly* suspicious, especially when they don't exist. (they're not ours)

When checking /tmp for suspicious files, use "ls -la /tmp" to ensure you're seeing the username of the files as well.. you'll be looking for files chowned to apache or webapps. Usually, you should only be seeing sess_* files owned by them. Anything else would be worth taking note of.

If something else is bound to port 80 that isn't /usr/sbin/httpd, then the issue isnt the restart script or apache but rather that something else managed to bind to it. They may be using the same issue intentionally that exim accidently runs into when apache gets restarted an exim is bound to 80.
http://help.directadmin.com/item.php?id=247
But I'm still suspecting roundecube 0.1.

Another thing, is ensure you don't have any cronjobs by apache or webapps:
crontab -u webapps -l
crontab -u apache -l

should not show any cronjobs.

John

smtalk
03-01-2009, 12:18 PM
You should check:

netstat -lnp | grep :80

Then:


lsof -p PID

switch
04-02-2009, 09:26 PM
Hi, I've been having the same problem, on two servers actually. With one we just removed directadmin completely, but with the other one that's not an option.

Every night when Directadmin does the "Tally", it restarts apache. But it doesn't stop apache correctly somehow and port 80 (and sometimes port 443 too) are still in use by a not-working apache process. Apache won't restart because ports in use is a critical error and it just closes again:

httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

Quick manual fix:

Search for ports in use:
# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 6617 apache 4u IPv6 527364 TCP *:www (LISTEN)

Kill the process using the PID:
# kill -9 6617


After that you can restart apache normally. But I'm really hoping directadmin can provide us with a permanent solution.

Here's wat seems to be a solution: http://help.directadmin.com/item.php?id=31. But it's an old help file, those files/paths are not available on my server. Plus I'm using Debian as well, and the commands there are for redhat/freebsd. :( Is this custombuild thing doing the same as described on that help-page?

Hey Aero I'm having the exact same problem with this. Have you been able to find an actual fix? My problem is only one one server, and is _exactly_ the same as you describe.

Aero
04-04-2009, 12:20 AM
Hey Aero I'm having the exact same problem with this. Have you been able to find an actual fix? My problem is only one one server, and is _exactly_ the same as you describe.No, we are now sponsored (by the same webhoster), and they would take care of all tech issues. But they also thought it would be better if we wouldn't use directadmin at all because of this problem. I guess they don't know how to fix it either, lol.

But, it does seem to be the apache-exim clash. On another webhosters-forum it was suggested to try this: http://help.directadmin.com/item.php?id=181
Basically the same as some of the offered solutions above, make sure apache does graceful restarts. I couldn't try out any of the solutions, so I don't know which works.

But imho it should be also fixed by DirectAdmin, changing the tally-script that checks for this problem with restarting apache. As this is something that runs daily, you'd expect a script that does not potentially crash your website.