Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Automatinis išjungimas ir paleiskite Apache HTTPD Paslaugos Daemon ne tikru laiku
The core component of any websites, blogs, web services and web applications is the web server. Esminę jokių svetainių, interneto dienoraščius, interneto paslaugų ir interneto taikomųjų programų serveryje. And Apache is the most popular HTTP server that powers the websites worldwide. Ir Apache yra populiariausias HTTP serverį, kad įgaliojimai svetainių visame pasaulyje. 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. Svarbu užtikrinti, kad veiksnumo ir nuolat veikia Apache paslaugą ar demonas serveryje, nes jei HTTPD paslauga yra neveiksnus, jūsų svetainė bus nepasiekiamas lankytojams. 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. Kitos nei naudojant stebėsenos paslaugą, scenarijų ar komunalinių patikrinti, ar HTTPD demonas up, serverio administratorius turi pasirinkti paleisti Apache tarnyba periodiškai.
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. Išjunkite ir iš naujo paleisti Apache reguliariai ne tikram laikui padeda užtikrinti, kad Apache web paslauga visada veikia aukščiausios klasės sąlyga, be poveikio galima Atminties nutekėjimas ir išteklių Žuvo dėl nuolatinių ryšių. 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. Ji taip pat užtikrina, kad svetaines prastovos laikas ribotas iki kito naujo tvarkaraščio, tiesiog tuo atveju, tai taip nesiseka, kad Apache stringa neribotai ir savo stebėjimo tarnyba negali pasiimti incidentas.
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. Išjungti ir paleisti Apache automatiškai, mes galime naudoti crontab (arba suplanuotų užduočių arba užduočių grafikas Windows Server), planuoti užduoties metu nori. Simply edit the cron jobs with a root or whell user, and add in the following line: Tiesiog redaguoti cron darbą su root arba whell vartotojo ir įtraukti į šią eilutę:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr / local / apache / bin / apachectl naujo
Replace m, h, d, m and w with value of your preference, where they represent the following meaning: Pakeisti M, H, D, M ir W su verte savo pasirinkimą, jeigu jie atstovauja šias reikšmes:
m: min (0 – 59) m: min (0 - 59)
h: hour (0 – 23) h: valanda (0 - 23)
d: day of month (1 – 31) D: mėnesio dieną (1 - 31)
m: month (1 – 12) M: Mėnuo (1 - 12)
w: day of week (0 – 6) (Sunday=0) W: Savaitės diena (0 - 6) (sekmadienis = 0)
For variables that you want to happen every time, set it as * (asterisk). Kintamiesiems, kad norite vykti kiekvieną kartą, jį kaip * (pažymėti žvaigždute).
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Pavyzdžiui, jei norite žudyti Apache demonas ir paleisti jį iš karto 1 val kiekvieną naktį, nustatyti crontab linija:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr / local / apache / bin / apachectl naujo
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job: Norėdami perkrauti Apache HTTPD paslaugos savaitgalį, pavyzdžiui, sekmadienis 12 val, naudokite šiuos cron job:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr / local / apache / bin / apachectl naujo
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS. Galite įvesti "žmogus crontab" norėdami sužinoti daugiau apie cron užsakymai Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Norėdami redaguoti crontab darbą, tiesiog įrašykite "crontab-e" ant korpuso. Existing crontab will appear on a text editor, such as GNU nano. Esamos crontab pasirodys teksto redaktorių, pavyzdžiui, 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. Jei tai yra, padaryti būtinus pakeitimus, paspauskite "Ctrl-X", po pagal "Y", kad išsaugoti failą ir vykdykite Enter spaudos priimti numatytąjį failo vardą. The new crontab will be installed and in effect immediately. Naujas crontab bus įdiegta ir įsigalioja nedelsiant.
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Atkreipkite dėmesį, kad kelias į apachectl gali skirtis dėl skirtingų variantų Unix, Linux ar BSD skonių. Use one of the following command to find out where is Apache installed: Apie tokią komandą, naudokite vieną, kad sužinoti, kur yra įdiegtas Apache:
find / apachectl | grep apachectl Ieškoti / 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. Kai Apache galite įdiegti į / usr / sbin / apachectl, arba galite naudoti httpd arba apachectl simbolines nuorodas / etc / rc.d / init.d / apachectl arba / etc / rc.d / init.d / httpd.
IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Automatinis vertimas gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.
Related Articles Susiję straipsniai
- Start, Stop and Restart Crond Daemon in Linux Start, stop ir restart Crond Daemon Linux
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Starting Apache HTTPD nepavyko, todėl negali atidaryti, arba nėra tokios mod_bwlimited, mod_log_bytes arba mod_bandwidth Failai
- Automatically Shutdown Computer With Auto Shutdown Genius Automatiškai shutdown kompiuterio Auto Shutdown Genius
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Diegimas web serveris FreeBSD 6,0 su Apache 2.2, MySQL 5.0, PHP 5 - 4 dalis
- How to Disable Linux and Unix Cron Jobs (Crontab) Email Sending Kaip išjungti Linux ir UNIX cron Darbas (crontab) Email siuntimas
- How to Restart (Stop or Start) cPanel Service (cpsrvd) via Telnet or SSH Kaip paleisti (Stop arba pradžios) Cpanel tarnybos (cpsrvd) per Telnet arba SSH
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Diegimas web serveris FreeBSD 6,0 su Apache 2.2, MySQL 5.0, PHP 5 - 5 dalis
- Request URL /server-status or 404 Page Not Found Apache Error Prašymas URL / serverio statuso arba 404 Page Not Found Apache klaida
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Paleiskite arba uždaryti Windows (XP, 2000 ir Vista) iš komandų eilutės arba One-Click Santrumpa
- cPanel Unable or Cannot Start or Restart POP3 Mail Service Cpanel nesugeba arba negali paleisti ar paleisti POP3 pašto paslaugos









































