Httpd automatically stop at night, please help me

dhq2008

New member
Joined
Dec 15, 2010
Messages
6
Hi All,

After ISP changed my webserver IP on linux to set up hardware firewall, httpd service usually stops at night. I can access to web server by SSH and checked the existence of Httpd by command:

Code:
service httpd start
Starting httpd: [Wed Dec 15 06:19:42 2010] [warn] NameVirtualHost xxx.xxx.xxx.xxx:443 has no VirtualHosts
(30)Read-only file system: httpd: could not open error log file /var/log/httpd/error_log.
Unable to open logs

/var/log/httpd/error_log file is empty and the content of /var/log/httpd/error_log.1 is:

Code:
 tail error_log.1
[Sun Dec 12 00:10:01 2010] [warn] NameVirtualHost xxx.xxx.xxx.xxx:443 has no VirtualHosts
[Sun Dec 12 00:10:02 2010] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Sun Dec 12 00:10:02 2010] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations
[Sun Dec 12 00:11:01 2010] [notice] caught SIGTERM, shutting down
[Sun Dec 12 00:11:02 2010] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Sun Dec 12 00:11:02 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Dec 12 00:11:03 2010] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Sun Dec 12 00:11:03 2010] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations
[Sun Dec 12 04:02:04 2010] [notice] SIGHUP received.  Attempting to restart
[Sun Dec 12 04:02:04 2010] [warn] NameVirtualHost xxx.xxx.xxx.xxx:443 has no VirtualHosts

I can't restart httpd service and have to reboot linux server.
I also check the task schedule in linux by command:
Code:
crontab -l

but not find anything.

Please help me to solve the problem.
Thanks!
 
Why is it a read only filesystem?

Seems like you have something screwed up on your server.
 
@scsi: thank for reply.
Actually, I don't know why it is read-only. Could you tell me some reasons and solutions for that?

httpd service only shutdown one time per night. After changing IP on my server at data center, support user at data center also got new license for direct admin. I'm new comer in linux and monitor the server by ssh.
 
Thanks all, but httpd always crashes at "04:02:06 2010" at the server. It's strange for me. I checked the task schedule by command:

Code:
crontab -l
but not found any thing.

If due to hard disk, I thinks It can crash any time in day, not at 04:02:06 everyday( about 9PM in my computer).

I will scan and fix the hard disk errors by command: fsck.
Could you tell me other commands to check schedule task in linux?
Thanks!
 
Thanks all, but httpd always crashes at "04:02:06 2010" at the server.[/CODE]
That's most likely the time the logs are rotated and apache restarted; commands are in /etc/cron.daily.

I don't know which of your partitions is being mounted read-only because you didn't post your partition table information.

It's reasonable that your hard disk problem would occur only when cron.daily is run.

Does your /etc/fstab file have a read-only setting for the partition that's being mounted read-only? If not, then it's likely that the drive has a bad partition table or a bad disk allocation table, and the kernel is mounting the partition read-only to protect it's contents.

If you run fsck on a mounted partition you could more damage to a damaged drive than you already have. If you unmount the drive and run fsck on it, then chances are you won't do as much damage but you could.

I highly recommend backing up the entire partition before moving forward. For the most safety and convenience the entire drive.

I also recommend doing it on location and with a new drive handy.

See this Wikipedia article for the reason the word is often used to replace a certain profanity.

Jeff
 
@jlasman: Exactly for "That's most likely the time the logs are rotated and apache restarted; commands are in /etc/cron.daily."

via less /var/log/cron, I saw some information:

Code:
Dec 13 03:59:01 XXX crond[12999]: (root) CMD (/usr/local/directadmin/dataskq)
Dec 13 04:00:01 XXX crond[13011]: (root) CMD (echo 'action=check&value=license' >> /usr/local/directadmin/data/task.queue)
Dec 13 04:00:01 XXX crond[13012]: (root) CMD (/usr/local/directadmin/dataskq)
Dec 13 04:01:01 XXX crond[13020]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 04:01:01 XXX crond[13021]: (root) CMD (/usr/local/directadmin/dataskq)
Dec 13 04:02:01 XXX crond[13030]: (root) CMD (run-parts /etc/cron.daily)
Dec 13 04:02:01 XXX crond[13031]: (root) CMD (/usr/local/directadmin/dataskq)
Dec 13 04:02:01 XXX anacron[13035]: Updated timestamp for job `cron.daily' to 2010-12-13
Dec 13 04:51:29 XXX crond[2705]: (CRON) STARTUP (V5.0)
Dec 13 04:51:29 XXX anacron[2718]: Anacron 2.3 started on 2010-12-13
Dec 13 04:51:29 XXX anacron[2718]: Normal exit (0 jobs run)

and check "cat /etc/crontab":
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
[B]02 4 * * * root run-parts /etc/cron.daily[/B]
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

the script in /etc/cront.daily:

Code:
0anacron   cups       makewhatis.cron  prelink  tmpwatch
0logwatch  logrotate  mlocate.cron     rpm

my question is: what is task of cron.daily in this situation? how to determine which script cause the problem? the best solution to solve the problem? how to remove the cron.daily and is it damaged for system?

I check in direct admin tool but not found any daily task. other information:

Code:
ls -l /etc/fstab
-rw-r--r-- 1 root root 506 Jul  7 08:03 /etc/fstab

Code:
ls -l /usr/sbin/httpd
-rwxr-xr-x 1 root root 4048090 Jul  7 09:44 /usr/sbin/httpd

/etc/fstab and /usr/sbin/httpd located in a same partion.

Thanks!
 
The logrotate script in cron.daily does stop and attempt to restart apache to rotate the logs. So the time it happens is reasonable. Why is it not restarting? Because your main partition is mounted read-only? Why is it mounted read-only? Probably because of a hardware problem; it's not easy to tell.

Under the circumstances I'd recommend running fsck in single-mode, which you can only do with local access to the server, either with a KVM-over-internet function (which must be installed by your colocation company) or by someone standing there, at your server.

Jeff
 
@jlasman: thank you very much.
After run fsck command in single mode, problem still happen :confused:
Many system files are blocked during running fsck command. how to completely resolve the problem?
 
@jlasman: thank you very much.
After run fsck command in single mode, problem still happen :confused:
Many system files are blocked during running fsck command. how to completely resolve the problem?
Backup and replace the drive.

Jeff
 
Back
Top