Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto pagsasara at i-restart ang Apache HTTPD Serbisyo diyablo sa mga preset na Time
The core component of any websites, blogs, web services and web applications is the web server. Ang mga pangunahing bahagi ng anumang mga website, blog, web serbisyo at web application ay ang web server. And Apache is the most popular HTTP server that powers the websites worldwide. At Apache ay ang pinaka-popular na server HTTP na nagpapatakbo sa mga website sa buong mundo. 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. Ito ay mahalaga upang masiguro na ang mga uptime at tuloy-tuloy na tumatakbo ng Apache serbisyo o mga demonyo sa server, tulad ng kung HTTPD serbisyo ay down, ang inyong website ay unaccessible sa mga bisita. 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. Iba Pang kaysa sa paggamit ng serbisyo sa pagmamanman, script o utility na alamin kung ang HTTPD demonyo ay up, server administrator din ay may pagpipilian na muling simulan ang Apache serbisyo sa pana-panahon.
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 at i-restart ang Apache pana-panahon sa pagitan ng mga tiyak na makakatulong upang matiyak na ang serbisyo ng Apache web ay laging tumatakbo sa itaas bingaw kondisyon, walang epekto ng posibleng tumagas memorya at mapagkukunan hoging sa pamamagitan ng patuloy na koneksyon. 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. Ito rin ay matiyak na ang mga web site na downtime ay limitado lamang sa susunod na i-restart ang schedule, baka sakaling ito kaya buwisit na Apache hangs walang katapusan at ang iyong mga serbisyo sa pagmamanman ay hindi maaaring kunin ang insidente.
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. Upang shutdown at simulan ang Apache awtomatikong, maaari kaming gumawa ng paggamit ng crontab (o Naka-schedule ang Gawain o Task scheduler sa Windows Server) sa iskedyul ng mga gawain sa oras na ginusto. Simply edit the cron jobs with a root or whell user, and add in the following line: Kailangan lang i-edit ang trabaho cron sa isang ugat o whell user, at idagdag sa mga sumusunod na linya:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / Apache / bin / apachectl i-restart ang
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Palitan ang m, h, d, m at w sa halaga ng iyong mga kagustuhan, na kung saan ang kumakatawan sa mga ito ang mga sumusunod na kahulugan:
m: min (0 – 59) m: min (0-59)
h: hour (0 – 23) h: oras (0-23)
d: day of month (1 – 31) d: araw ng buwan (1 - 31)
m: month (1 – 12) m: buwan (1 - 12)
w: day of week (0 – 6) (Sunday=0) w: araw ng linggo (0-6) (Linggo = 0)
For variables that you want to happen every time, set it as * (asterisk). Para sa mga variable na gusto mong mangyari sa bawat oras, itakda ito bilang * (asterisk).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Halimbawa, upang patayin ang Apache diyablo at simulan ito kaagad sa 1 gabi-gabi, itakda ang crontab na linya sa:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * * * * * / usr / local / Apache / bin / apachectl i-restart ang
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: Upang i-restart ang Apache HTTPD serbisyo sa katapusan ng linggo, tulad ng Linggo 12 tanghali, gamitin ang sumusunod na trabaho cron:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * * * 0 / usr / local / Apache / bin / apachectl i-restart ang
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Maaari mong input "ng tao crontab" upang malaman ang higit pa tungkol sa mga trabaho cron sa Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Upang i-edit ang crontab listahan ng trabaho, ipasok lamang "crontab-e" sa shell. Existing crontab will appear on a text editor, such as GNU nano. Umiiral na crontab ay lilitaw sa isang text editor, tulad ng 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. Kung ito ang kaso, gumawa ng mga nararapat na pagbabago, at pagkatapos ay pindutin ang "Ctrl-X", sundin sa pamamagitan ng "Y" upang i-save ang file, at sundin ng pindutin ang Enter upang tanggapin ang mga default na pangalan ng file. The new crontab will be installed and in effect immediately. Ang bagong crontab ay naka-install at sa epekto kaagad.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Tandaan na ang landas sa apachectl ay maaaring naiiba sa mga iba't ibang iba ng Unix, Linux o BSD flavors. Use one of the following command to find out where is Apache installed: Gamitin ang isa sa mga sumusunod na command upang alamin kung saan ay Apache na naka-install:
find / apachectl | grep apachectl hanapin / 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. Ang ilang mga Apache ay maaaring i-install sa / usr / sbin / apachectl, o maaari mong gamitin ang httpd o apachectl sinasagisag mga link sa / etc / rc.d / init.d / apachectl o sa / etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. MAHALAGA: Ang pahina ng makina ay isinalin at ibinigay "bilang ganito" walang warranty. Machine translation may be difficult to understand. Machine pagsasalin ay maaaring mahirap maintindihan. Please refer to Mangyaring sumangguni sa original English article orihinal na Ingles na artikulo whenever possible. hangga't maaari.
Related Articles Mga Kaugnay na Akda
- Start, Stop and Restart Crond Daemon in Linux Simulan, Stop at i-restart ang Crond diyablo sa Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Simula sa Apache HTTPD Nabigong Dahil sa hindi Puwede Buksan o Hindi ganoong mod_bwlimited, mod_log_bytes o mod_bandwidth file
- Automatically Shutdown Computer With Auto Shutdown Genius Awtomatikong pagsasara Computer Sa Auto pagsasara likas na talino
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Pag-install ng Web Server sa FreeBSD 6.0 sa Apache 2.2, MySQL 5.0 at PHP 5 - Part 4
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Paano na-disable ang Linux Unix at cron Trabaho (Crontab) Email Pagpapadala
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH Paano i-restart (Stop o Start) cPanel Service (cpsrvd) sa pamamagitan ng Telnet o SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Pag-install ng Web Server sa FreeBSD 6.0 sa Apache 2.2, MySQL 5.0 at PHP 5 - Part 5
- Request URL /server-status or 404 Page Not Found Apache Error Kahilingan sa URL / server-status o 404 Page Not Found Error sa Apache
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel Hindi o Hindi Start o i-restart POP3 Mail Service
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut O i-restart ang pagsasara ng Windows (XP, 2000 at Vista) mula sa Command Line o One-click Shortcut









































