Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto Shutdown dan Restart Apache HTTPD Service Daemon di Preset Sisa
The core component of any websites, blogs, web services and web applications is the web server. Komponen inti dari setiap website, blog, layanan web dan aplikasi web adalah server web. And Apache is the most popular HTTP server that powers the websites worldwide. Dan Apache merupakan server HTTP paling populer yang digunakan pada situs-situs di seluruh dunia. It's important to ensure that the uptime and continuous running of Apache service or daemon on the server, as if HTTPD service is down, your website will be unaccessible to the visitors. Sangat penting untuk memastikan bahwa uptime dan terus menjalankan layanan Apache atau daemon pada server, seolah-olah layanan HTTPD sedang down, website Anda akan unaccessible untuk para pengunjung. Other than using monitoring service, script or utility to check if the HTTPD daemon is up, server administrator also has a choice to restart the Apache service periodically. Selain menggunakan layanan monitoring, script atau utilitas untuk memeriksa apakah daemon HTTPD habis, administrator server juga memiliki pilihan untuk me-restart layanan Apache secara berkala.
Shutdown and restart Apache periodically at specific interval helps to ensure that Apache web service is always running in top notch condition, without effect of possible memory leak and resource hogging by persistent connections. Shutdown dan restart Apache secara berkala pada selang waktu tertentu membantu untuk memastikan bahwa layanan web Apache selalu berjalan dalam kondisi kedudukan tertinggi, tanpa efek kemungkinan kebocoran memori dan sumber daya memonopoli oleh koneksi persistent. It also ensure that the web sites downtime is limited to the next restart schedule, just in case it's so unlucky that Apache hangs indefinitely and your monitoring service can't pick up the incident. Hal ini juga memastikan bahwa situs web downtime adalah terbatas pada jadwal restart berikutnya, hanya dalam kasus itu sangat beruntung bahwa Apache menggantung tanpa batas waktu dan layanan monitoring Anda tidak dapat mengambil kejadian.
To shutdown and start Apache automatically, we can make use of crontab (or Scheduled Task or Task Scheduler in Windows Server) to schedule the task at the time prefer. Untuk shutdown dan memulai Apache secara otomatis, kita dapat menggunakan crontab (atau Terjadwal Tugas atau Task Scheduler di Windows Server) untuk menjadwalkan tugas pada waktu itu lebih suka. Simply edit the cron jobs with a root or whell user, and add in the following line: Cukup mengedit cron pekerjaan dengan root atau user whell, dan tambahkan baris berikut:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl restart
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Ganti m, h, d, m dan w dengan nilai preferensi Anda, di mana mereka mewakili makna sebagai berikut:
m: min (0 – 59) m: min (0 - 59)
h: hour (0 – 23) h: jam (0 - 23)
d: day of month (1 – 31) d: hari bulan (1 - 31)
m: month (1 – 12) m: month (1 - 12)
w: day of week (0 – 6) (Sunday=0) w: hari minggu (0 - 6) (Sunday = 0)
For variables that you want to happen every time, set it as * (asterisk). Untuk variabel yang Anda inginkan terjadi setiap waktu, mengaturnya sebagai * (asterisk).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Misalnya, untuk membunuh daemon Apache dan mulai segera di 1 pagi setiap malam, mengatur baris crontab:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl restart
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: Untuk me-restart Apache HTTPD layanan pada akhir pekan, seperti Minggu 12 siang, gunakan tugas cron berikut:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl restart
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Anda dapat memasukkan "man crontab" untuk mempelajari lebih lanjut tentang cron jobs di Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Untuk mengedit crontab daftar pekerjaan, cukup masukkan "crontab-e" pada shell. Existing crontab will appear on a text editor, such as GNU nano. Ada crontab akan muncul pada editor teks, seperti GNU nano. If this is the case, make the necessary changes, then press “Ctrl-X”, follow by “Y” to save the file, and follow by Enter press to accept the default file name. Jika hal ini terjadi, membuat perubahan yang diperlukan, kemudian tekan "Ctrl-X", diikuti dengan "Y" untuk menyimpan file, dan ikuti oleh Masukkan tekan untuk menerima nama file default. The new crontab will be installed and in effect immediately. Crontab baru akan dipasang dan berlaku segera.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Perlu diketahui bahwa jalan untuk apachectl mungkin berbeda pada berbagai varian dari Unix, Linux atau BSD rasa. Use one of the following command to find out where is Apache installed: Gunakan salah satu dari perintah berikut untuk mencari tahu di mana Apache diinstal:
find / apachectl | grep apachectl find / apachectl | grep apachectl
whereis apachectl whereis apachectl
Some Apache may install in /usr/sbin/apachectl, or you can use the httpd or apachectl symbolic links in /etc/rc.d/init.d/apachectl or /etc/rc.d/init.d/httpd. Beberapa dapat menginstal Apache di / usr / sbin / apachectl, atau Anda dapat menggunakan apachectl httpd atau link simbolik di / etc / rc.d / init.d / apachectl atau / etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman ini adalah mesin diterjemahkan dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Terjemahan mesin mungkin sulit untuk mengerti. Please refer to Silakan merujuk ke original English article artikel asli bahasa Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- Start, Stop and Restart Crond Daemon in Linux Mulai, Berhenti dan Restart crond Daemon di Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Memulai Apache HTTPD Gagal Karena Tidak dapat Buka atau Tidak seperti mod_bwlimited, mod_log_bytes atau mod_bandwidth File
- Automatically Shutdown Computer With Auto Shutdown Genius Otomatis Shutdown Komputer Dengan Auto Shutdown Genius
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Instalasi Web Server di FreeBSD 6.0 dengan Apache 2.2, MySQL 5.0 dan PHP 5 - Bagian 4
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Cara Nonaktifkan Linux dan Unix Cron Jobs (Crontab) Email Pengirim
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH Cara Restart (Berhenti atau Mulai) cPanel Service (cpsrvd) melalui Telnet atau SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Instalasi Web Server di FreeBSD 6.0 dengan Apache 2.2, MySQL 5.0 dan PHP 5 - Bagian 5
- Request URL /server-status or 404 Page Not Found Apache Error Meminta URL / server-status atau 404 Halaman Tidak Ditemukan Apache Error
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Restart atau Shutdown Windows (XP, 2000 dan Vista) dari Command Line atau One-Click Shortcut
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel Tidak dapat atau tidak dapat Start atau Restart POP3 Mail Service









































