Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Auto shutdown e reiniciar o Apache httpd serviço daemon a hora predefinida

The core component of any websites, blogs, web services and web applications is the web server. O componente central de qualquer sites, blogs, web services e aplicações web é o servidor web. And Apache is the most popular HTTP server that powers the websites worldwide. E Apache é o mais popular servidor HTTP poderes que os sites em todo o 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. É importante assegurar que o uptime e contínuo funcionamento do Apache serviço ou daemon no servidor, como se HTTPD serviço é baixo, seu site será inacessível aos visitantes. 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. Diferentemente de acompanhamento utilizando serviço, ou script utilitário para verificar se o daemon é HTTPD up, servidor administrador também tem a opção para reiniciar o serviço Apache periodicamente.

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. Encerrar e reiniciar o Apache periodicamente em intervalos específicos contribui para assegurar que o Apache web serviço é sempre a correr em cima entalhe condição, sem efeito de uma eventual fuga de memória e de recursos hogging por conexões persistentes. 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. Importa também garantir que os web sites de paralisação está limitado a reiniciar o próximo calendário, no caso de os sorte que é assim que trava Apache indefinidamente e seu acompanhamento serviço não pode pegar o incidente.

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. Para desligar automaticamente e iniciar o Apache, podemos fazer uso de crontab (ou tarefa programada ou Agendador de tarefas do Windows Server) para agendar a tarefa no momento em que preferir. Simply edit the cron jobs with a root or whell user, and add in the following line: Basta editar o cron empregos com uma raiz ou whell usuário, e em acrescentar a seguinte linha:

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: Substituir m, h, d, m e w com valor de sua preferência, onde representam o seguinte significado:

m: min (0 - 59) m: min (0 - 59)
h: hour (0 - 23) h: hora (0 - 23)
d: day of month (1 - 31) d: dia do mês (1 - 31)
m: month (1 - 12) m: meses (1 - 12)
w: day of week (0 - 6) (Sunday=0) w: dia da semana (0 - 6) (domingo = 0)

For variables that you want to happen every time, set it as * (asterisk). Para as variáveis que você deseja que aconteça a cada momento, defini-lo como * (asterisco).

For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to: Por exemplo, para matar o daemon Apache e inicia-lo imediatamente em 1 AM todas as noites, para definir a linha 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: Para reiniciar o Apache HTTPD serviço no fim de semana, tais como a domingo às 12 horas, use o seguinte cron job:

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. Você pode introduzir "man crontab" para saber mais sobre cron postos de trabalho em Linux / Unix / FreeBSD / CentOS. To edit the crontab job list, simply enter “crontab -e” on the shell. Para editar o crontab trabalho lista, basta digitar "crontab-e" sobre o shell. Existing crontab will appear on a text editor, such as GNU nano. Crontab existentes serão exibidos em um editor de texto, tais como 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. Se for esse o caso, fazer as mudanças necessárias e, em seguida, pressione "Ctrl-X", siga em "Y" para salvar o arquivo, e siga por pressione Enter para aceitar a omissão do nome do ficheiro. The new crontab will be installed and in effect immediately. O novo crontab e serão instalados em vigor imediatamente.

Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors. Note que o caminho para apachectl podem ser diferentes em diferentes variante do Unix, Linux ou BSD sabores. Use one of the following command to find out where is Apache installed: Use um dos seguintes comando para descobrir onde está instalado o Apache:

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. Alguns Apache pode instalar em / usr / sbin / apachectl, ou você pode usar o httpd ou apachectl links simbólicos em / etc / rc.d / init.d / apachectl ou / etc / rc.d / init.d / httpd.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.

Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .



Leave a Reply Deixe uma resposta

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Você pode usar estas tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Subscreva sem comentar


Custom Search

New Articles Novos Artigos

Incoming Search Terms for the Article Incoming Termos de pesquisa para o artigo

restart apache Reinicie o Apache - -- restart httpd restart httpd - -- apache shutdown Apache shutdown - -- apache restart Reinicie o Apache - -- service apache restart Serviço de reiniciar o Apache - -- centos service autostart centos serviço automaticamente - -- apache auto restart Reinicie o Apache automática - -- how to restart apache a forma de reiniciar o Apache - -- centos autostart services centos automaticamente serviços - -- shutdown httpd shutdown httpd - -- restart apache service Reinicie o Apache serviço - -- apache service restart Reinicie o Apache serviço - -- service restart apache Serviço de reiniciar o Apache - -- auto restart apache Auto restart Apache - -- crontab restart apache crontab reiniciar o Apache - -- freebsd apache autostart FreeBSD Apache automaticamente - -- start apache service Apache iniciar serviço - -- cronjob restart apache cron restart Apache - -- crontab apachectl crontab apachectl - -- apache auto start Apache auto início - -- apache automatic restart Reinicie o Apache automático - -- CentOS autostart httpd CentOS automaticamente httpd - -- centos httpd autostart centos httpd automaticamente - -- auto start apache auto começo Apache - -- restart apache centos Reinicie o Apache CentOS - -- shutdown apache shutdown Apache - -- reboot apache reinicie o Apache - -- schedule apache restart Reinicie o Apache calendário - -- autostart httpd centos automaticamente httpd CentOS - -- cron restart apache cron restart Apache - -- centos apache autostart centos Apache automaticamente - -- centos autostart service centos automaticamente serviço - -- apache httpd shutdown Apache httpd shutdown - -- how to shutdown apache o modo de desligamento Apache - -- shutting down apache linux desligando o Apache Linux - -- centos auto restart centos auto restart - -- cron job restart apache job cron restart Apache - -- Linux Apache Memory Leak Linux Apache memória - -- start apache httpd iniciar o Apache httpd - -- centos autostart daemon centos automaticamente daemon - -- how to shutdown httpd o modo de desligamento httpd - -- cron job to restart apache cron job para reiniciar o Apache - -- cron auto restart apache Cron auto restart Apache - -- starting apache service começando Apache serviço - -- stop apache service parar o Apache serviço - -- centos auto start centos auto início - -- crontab apache restart Reinicie o Apache crontab - -- Apache restart service Reinicie o Apache serviço - -- linux shut down apache Linux encerradas Apache - -- set apache to autostart Apache para definir automaticamente - --