CRON JOB - Httpd {HELP}

rahulw

Verified User
Joined
Sep 3, 2006
Messages
39
Hello All,


My VPS with DA , hangs its HTTPD service every 24 hours or so , but when i reload it , its live in seconds.

Please tell me how can i make cron job in Direct admin , to restart HTTPD service every 1 hour , each day .

I have tried using SSH (root access) cron ... -e ... and all VI editor opens and i mention * * * * * blah blah .. but when i exist pressing CTRL zz , it saves nothin in that file.


So please help me by using direct admin , how can i make a cron job to restart apache every hour

Thanks in Advance
 
Hello,

To "reload" HTTP every hour on Linux:

1) Type crontab -e and press ENTER.

2) In the window, press I to enter input mode, and type:
@hourly /sbin/service httpd reload

3) Then to save, press ESC to exit input mode, type :wq, and then press ENTER.

Hopefully that helps.

Phil
 
Last edited:
Hello Sir ,

Thanks for so prompt reply , i have done as you have said


[root@ns1 ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab


[root@ns1 ~]# crontab -l
@hourly /sbin/service httpd reload


I hope its fine now , and it reboots every hour .

Please let me know where can i see httpd logs , where it mentions that its rebooting every hour .. i mean apache logs ;)

thnx for help
 
Apache logs are stored into /var/log/httpd directory.


Thanks

but which file shall i post for you people to see my httpd error ;)

[r
oot@ns1 httpd]# ls
access_log error_log httpd ssl_mutex.24528 ssl_mutex.7606
access_log.1 error_log.1 ssl_engine_log ssl_mutex.28655 ssl_request_log
access_log.2 error_log.2 ssl_mutex.10031 ssl_mutex.32135
access_log.3 error_log.3 ssl_mutex.11340 ssl_mutex.5626
access_log.4 error_log.4 ssl_mutex.16007 ssl_mutex.5835
domains homedir.log ssl_mutex.18424 ssl_mutex.5854
 
In error_log you will see something like:
Code:
[Wed May 30 00:23:06 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8b mod_perl/1.30 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Wed May 30 00:23:06 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed May 30 00:23:06 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
 
these are few of last entries i see in error_log.1

[Sat May 26 00:11:06 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 00:11:06 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 00:11:06 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 00:12:02 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 00:12:04 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 00:12:04 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 00:12:04 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 01:37:08 2007] [error] [client 65.54.188.88] File does not exist: /var/www/html/robots.txt
[Sat May 26 03:46:13 2007] [error] [client 65.55.212.119] File does not exist: /var/www/html/robots.txt
[Sat May 26 03:46:13 2007] [error] [client 65.55.212.119] File does not exist: /var/www/html/docs/
[Sat May 26 04:45:35 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 04:45:37 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 04:45:37 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 04:45:37 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 06:24:11 2007] [error] [client 65.55.208.173] File does not exist: /var/www/html/robots.txt
[Sat May 26 06:48:00 2007] [error] [client 66.249.70.187] File does not exist: /var/www/html/robots.txt
[Sat May 26 08:31:11 2007] [error] [client 74.6.86.207] File does not exist: /var/www/html/robots.txt
[Sat May 26 08:44:10 2007] [error] [client 65.54.188.87] File does not exist: /var/www/html/robots.txt
[Sat May 26 08:44:10 2007] [error] [client 65.54.188.87] File does not exist: /var/www/html/docs/
[Sat May 26 10:48:43 2007] [error] [client 65.54.188.88] File does not exist: /var/www/html/robots.txt
[Sat May 26 11:18:07 2007] [error] [client 75.110.95.75] File does not exist: /home/black/public_html/
[Sat May 26 11:18:09 2007] [error] [client 75.110.95.75] File does not exist: /home/black/public_html/
[Sat May 26 11:51:20 2007] [error] [client 65.55.212.119] File does not exist: /var/www/html/robots.txt
[Sat May 26 14:46:34 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 14:46:36 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 14:46:36 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 14:46:36 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 14:47:06 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 14:47:07 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 14:47:07 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 14:47:07 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 14:47:20 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 14:47:21 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 14:47:21 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 14:47:21 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 14:47:31 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 14:47:32 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 14:47:32 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 14:47:32 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 14:47:37 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 14:47:38 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 14:47:38 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 14:47:38 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 15:27:31 2007] [error] [client 83.225.44.195] File does not exist: /home/black/public_html/
[Sat May 26 15:27:35 2007] [error] [client 83.225.44.195] File does not exist: /home/black/public_html/
[Sat May 26 17:01:02 2007] [error] [client 66.249.70.187] File does not exist: /var/www/html/robots.txt
[Sat May 26 18:32:52 2007] [notice] caught SIGTERM, shutting down
[Sat May 26 18:32:54 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat May 26 18:32:54 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat May 26 18:32:54 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat May 26 20:44:02 2007] [error] [client 66.249.70.187] File does not exist: /var/www/html/robots.txt
[Sat May 26 21:18:47 2007] [error] [client 82.128.11.178] File does not exist: /home/black/public_html/
[Sun May 27 00:10:07 2007] [notice] SIGHUP received. Attempting to restart
[Sun May 27 00:10:09 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sun May 27 00:10:09 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 27 00:10:09 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun May 27 00:11:01 2007] [notice] caught SIGTERM, shutting down
[Sun May 27 00:11:02 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sun May 27 00:11:02 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun May 27 00:11:02 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun May 27 01:58:03 2007] [notice] SIGHUP received. Attempting to restart



i wonder where are entries after may 27 ?? and plz tell me after looking at logs that why apache hangs ?
 
Entries after May 27 are in the error_log file ;)

lol @ me ..

Here is the log for today , and it wont be out of place to mention here that apache hanged today also , ( 4 hours back )

[Sat Jun 2 00:10:09 2007] [notice] SIGHUP received. Attempting to restart
[Sat Jun 2 00:10:12 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 00:10:12 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 00:10:12 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 00:11:02 2007] [notice] caught SIGTERM, shutting down
[Sat Jun 2 00:11:04 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 00:11:04 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 00:11:04 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 03:12:00 2007] [error] [client 83.131.2.25] request failed: error reading the headers
[Sat Jun 2 03:43:46 2007] [error] [client 84.205.231.4] File does not exist: /var/www/html/igdnew.xml
[Sat Jun 2 07:51:14 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:51:39 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:51:45 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:51:48 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:51:56 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:55:40 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 07:56:02 2007] [error] [client 208.70.7.97] File does not exist: /home/black/public_html/
[Sat Jun 2 08:32:53 2007] [error] [client 66.249.70.187] File does not exist: /var/www/html/robots.txt
[Sat Jun 2 08:32:53 2007] [error] [client 66.249.70.187] File does not exist: /home/black/public_html/
[Sat Jun 2 12:39:35 2007] [notice] caught SIGTERM, shutting down
[Sat Jun 2 12:39:38 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 12:39:38 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 12:39:38 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 15:17:20 2007] [error] [client 82.253.220.241] File does not exist: /var/www/html/pics/BlackCreampieMakesAGooey*****Mess_14F75/blackcreampie14.jpg
[Sat Jun 2 15:18:20 2007] [error] [client 82.253.220.241] Invalid URI in request \x13BitTorrent protocol
[Sat Jun 2 15:18:20 2007] [error] [client 82.253.220.241] File does not exist: /var/www/html/400.shtml
[Sat Jun 2 16:59:12 2007] [notice] caught SIGTERM, shutting down
[Sat Jun 2 16:59:14 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 16:59:14 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 16:59:14 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 17:21:42 2007] [notice] caught SIGTERM, shutting down
[Sat Jun 2 17:21:45 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 17:21:45 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 17:21:45 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 17:27:54 2007] [notice] SIGHUP received. Attempting to restart
[Sat Jun 2 17:27:55 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 17:27:55 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 17:27:55 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 17:31:45 2007] [notice] SIGHUP received. Attempting to restart
[Sat Jun 2 17:31:45 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 17:31:45 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 17:31:45 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 17:32:06 2007] [notice] SIGHUP received. Attempting to restart
[Sat Jun 2 17:32:06 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Sat Jun 2 17:32:06 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 2 17:32:06 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sat Jun 2 17:42:33 2007] [crit] (98)Address already in use: make_sock: could not bind to port 443


Please let me know the exact fault :confused:
 
Here is my TOP output , may it also help :(

Code:
top - 17:49:34 up 5 days,  5:07,  1 user,  load average: 0.20, 0.13, 0.15
Tasks:  69 total,   1 running,  68 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.5% us,  1.0% sy,  0.0% ni, 95.0% id,  1.5% wa,  0.0% hi,  0.0% si
Mem:    262144k total,   116440k used,   145704k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      16   0  1620  600  520 S    0  0.2   0:05.95 init
26243 root      15   0  1524  544  456 S    0  0.2   0:00.78 syslogd
26254 root      16   0  4016 1128  832 S    0  0.4   0:00.30 sshd
26265 root      15   0  2072  812  684 S    0  0.3   0:00.02 xinetd
26275 root      18   0  2144 1124  964 S    0  0.4   0:00.00 mysqld_safe
26298 mysql     15   0 42212  21m 2768 S    0  8.2   0:20.73 mysqld
26299 mysql     15   0 42212  21m 2768 S    0  8.2   0:38.99 mysqld
26300 mysql     20   0 42212  21m 2768 S    0  8.2   0:00.00 mysqld
26301 mysql     16   0 42212  21m 2768 S    0  8.2   0:00.00 mysqld
26302 mysql     16   0 42212  21m 2768 S    0  8.2   0:00.00 mysqld
26303 mysql     20   0 42212  21m 2768 S    0  8.2   0:00.00 mysqld
26304 mysql     16   0 42212  21m 2768 S    0  8.2   0:25.73 mysqld
26305 mysql     16   0 42212  21m 2768 S    0  8.2   0:14.61 mysqld
26306 mysql     16   0 42212  21m 2768 S    0  8.2   0:00.00 mysqld
26307 mysql     15   0 42212  21m 2768 S    0  8.2   0:03.34 mysqld
26322 root      16   0   892  248  212 S    0  0.1   0:13.84 da-popb4smtp
26333 nobody    15   0  6492  852  668 S    0  0.3   0:00.51 directadmin
 
This is the problem:
Code:
[Sat Jun 2 17:42:33 2007] [crit] (98)Address already in use: make_sock: could not bind to port 443
 
This is the problem:
Code:
[Sat Jun 2 17:42:33 2007] [crit] (98)Address already in use: make_sock: could not bind to port 443


So how can i resolve it ?? Kindly let me know in detail ..

But this issue

Code:
[Sat Jun 2 17:42:33 2007] [crit] (98)Address already in use: make_sock: could not bind to port 443

is seen only for today , but my Apache hangs each day :confused: ??
 
any help after analyzing my logs , and finding out the real error will be appreciated !! :(
 
Back
Top