Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto Shutdown in zopet začeti Apache httpd Service Daemon na Preset Time
The core component of any websites, blogs, web services and web applications is the web server. Jedro sestavni del vsake spletne strani, bloge, spletnih storitev in spletnih aplikacij, je spletni strežnik. And Apache is the most popular HTTP server that powers the websites worldwide. In je Apache najbolj priljubljena HTTP strežnik, ki poganja spletne strani po vsem svetu. 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. Pomembno je zagotoviti, da uptime in neprekinjeno delovanje službe Apache ali daemon na strežniku, kot da httpd storitev navzdol, bo vaša spletna stran je nedosegljiva za obiskovalce. 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. Razen uporabljajo za spremljanje storitev, skript ali uporabni za preverjanje, če je do httpd daemon, skrbnika strežnika tudi izbiro, da znova zaženete storitev Apache občasno.
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. Ustavitev dela ali obratovanja ter zopet začeti Apache v rednih časovnih presledkih posebne interval pomaga zagotoviti, da storitev Apache ujeti vedno teče v vrhu zarezo stanju, brez učinka možnih pomnilnika in virov, ki jih vztrajno Pregib povezav. 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. Prav tako zagotovijo, da se izpadov spletne strani, omejena na naslednjem vnovičnem zagonu razporedu, samo v primeru, da je tako nesrečna, da Apache visi za nedoločen čas in vaše spremljanje storitev ne more pobrati incident.
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. Za zaustavitev in začeti Apache samodejno, lahko naredimo uporabi crontab (ali Scheduled Task ali penzum tabela v operacijskem sistemu Windows Server) načrtovati naloge v času ljubše. Simply edit the cron jobs with a root or whell user, and add in the following line: Preprosto urejanje delovnih mest z cron root ali uporabnika whell, in dodajte v naslednjo vrstico:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl znova
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Zamenjaj m, h, d, m in w z vrednostjo svoji želji, če predstavljajo naslednji pomen:
m: min (0 – 59) m: min (0 - 59)
h: hour (0 – 23) h: ura (0 - 23)
d: day of month (1 – 31) d: dan v mesecu (1 - 31)
m: month (1 – 12) m: mesec (1 - 12)
w: day of week (0 – 6) (Sunday=0) w: dan v tednu (0 - 6) (nedelja = 0)
For variables that you want to happen every time, set it as * (asterisk). Za spremenljivke, ki želite, da se zgodi vsakič, jo nastavite kot * (zvezdica).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Na primer, da bi ubil daemon Apache in začeti takoj po 1 vsak večer, nastavite crontab postavka:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl znova
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: Če želite znova zagnati Apache httpd storitev na konec tedna, kot je nedelja ob 12. uri, uporabite naslednje delo cron:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl znova
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Lahko input "man crontab", če želite izvedeti več o cron delovnih mest v Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Če želite urediti seznam delovnih mest crontab, preprosto vnesite "crontab-e" na lupini. Existing crontab will appear on a text editor, such as GNU nano. Obstoječe crontab bo pojavil na urejevalnik besedila, kot je nano GNU. 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. Če je tako, da potrebne spremembe, nato pritisnite tipko "Ctrl-X", sledi z "Y", da shranite datoteko in sledite s Vpišite pritisnite, da sprejmete privzeto ime datoteke. The new crontab will be installed and in effect immediately. Novi crontab bo nameščena in dejansko takoj.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Upoštevajte, da je pot do apachectl lahko različni na različnih različico Unix, Linux in BSD okuse. Use one of the following command to find out where is Apache installed: Uporabimo eno od naslednjih zapoved izvedeti, kjer je nameščen Apache:
find / apachectl | grep apachectl odkriti / 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. Nekateri Apache lahko namesti v / usr / sbin / apachectl, ali lahko uporabite httpd apachectl ali simbolne povezave v / etc / rc.d / init.d / apachectl ali / etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. POMEMBNO: stran je stroj prevod in če "kot je" brez garancije. Machine translation may be difficult to understand. Strojno prevajanje je lahko težko razumeti. Please refer to Prosimo, da original English article original angleški člen whenever possible. kadar je to mogoče.
Related Articles Povezani članki
- Start, Stop and Restart Crond Daemon in Linux Start, Stop in Znova Crond Daemon v Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Od Apache httpd ne zadostovati zaradi ne morem plan ali ne Taka mod_bwlimited, mod_log_bytes ali mod_bandwidth Files
- Automatically Shutdown Computer With Auto Shutdown Genius Samodejno Shutdown računalnik z Auto Shutdown Genius
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Napeljati ujeti pomočnik v vdovščina po smrti svobodnika 6.0 s Apache 2.2, MySQL 5.0 ter PHP 5 - 4. del
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Kako v onesposobiti Linux in Unix Cron Jobs (crontab) E-pošta Pošiljanje
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH Kako v zopet začeti (zapora ali začetek) cPanel Service (cpsrvd) preko Telnet ali SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Napeljati ujeti pomočnik v vdovščina po smrti svobodnika 6.0 s Apache 2.2, MySQL 5.0 ter PHP 5 - 5. del
- Request URL /server-status or 404 Page Not Found Apache Error Request URL / server-status ali 404 Page Not Found Apache zmota
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Zopet začeti ali ustavitev dela ali obratovanja okno (XP, 2000 ter razgled) s zapoved črta ali One-Click Shortcut
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel nezmožen ali ne morem začetek ali zopet začeti POP3 Mail Service









































