Auto Shutdown and Restart Apache HTTPD Service Daemon at Preset Time Apacheのhttpdサービスの自動再起動をシャットダウンし、デーモンのプリセット時間
The core component of any websites, blogs, web services and web applications is the web server.のコアコンポーネントのすべてのウェブサイト、ブログ、 WebサービスとWebアプリケーションは、ウェブサーバーです。 And Apache is the most popular HTTP server that powers the websites worldwide.とApache HTTPサーバーが最も人気が全世界のウェブサイトを大国です。 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.それを確保するための重要な連続稼働時間は、 Apacheのサービスまたはデーモンを実行して、サーバー上の、 httpdサービスがダウンした場合、お客様のウェブサイトを訪問されるアクセスできません。 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.他の監視サービスを使用しても、スクリプトまたはユーティリティをチェックする場合は、上のhttpdデーモンは、サーバーの管理者には、 Apacheサービスを再起動して定期的に選択してください。
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. Apacheの再起動をシャットダウンし、定期的に特定の間隔を確保するために役立ちますがApacheのWebサービスは、常にトップへ切り欠きの状態で実行され、メモリリークが発生する可能性の効果以上にとると資源の持続的接続されています。 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.また、ウェブサイトを確認してダウンタイムスケジュールは限られて、次の再起動し、念のためにハングアップすることはとても不幸なことApacheの監視サービスを無期限として事件をピックアップすることはできません。
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. Apacheを起動を自動的にシャットダウンして、私たちも使用できるようにcrontabに(またはスケジュールされたタスクまたはタスクスケジューラをWindowsサーバー)をスケジュールするタスクは、時間を好む。 Simply edit the cron jobs with a root or whell user, and add in the following line:単純にcronジョブを編集して、ルートまたはwhellユーザと、次の行を追加します:
mhdmw /usr/local/apache/bin/apachectl restart mhdmw / usr /ローカル/ Apacheの/ビン/ apachectlを再起動
Replace m, h, d, m and w with value of your preference, where they represent the following meaning:置き換えるメートル、 h 、 d再生、 MとWの値の設定は、どこを表すものは、次の意味:
m: min (0 - 59)メートル:分( 0 -5 9)
h: hour (0 - 23) h :時間( 0 -2 3)
d: day of month (1 - 31) d :日の月日( 1 -3 1)
m: month (1 - 12)メートル:月日( 1 -1 2)
w: day of week (0 - 6) (Sunday=0)ワット:曜日( 0 -6 ) (日曜日= 0 )
For variables that you want to happen every time, set it as * (asterisk).変数を指定しますが起こるたびに、設定することとして* (アスタリスク)です。
For example, to kill the Apache daemon and start it immediately at 1 AM every night, set the crontab line to:たとえば、 Apacheのデーモンを殺すと午前1時に開始してすぐに毎晩、 crontabに設定しての行を:
0 1 * * * /usr/local/apache/bin/apachectl restart 0 1 * * * / usr /ローカル/ Apacheの/ビン/ apachectlを再起動
To restart Apache HTTPD service on weekend, such as Sunday 12 noon, use the following cron job:週末のApacheのhttpdサービスを再起動するなど、日曜日12時、次のcronジョブを使用して:
0 12 * * 0 /usr/local/apache/bin/apachectl restart 0 12 * * 0 / usr /ローカル/ Apacheの/ビン/ apachectlを再起動
You can input “man crontab” to learn more about cron jobs in Linux/Unix/FreeBSD/CentOS.入力することができます"男のcrontab "のcronジョブの詳細については、 Linux / Unix版/ FreeBSDの/ CentOS版です。 To edit the crontab job list, simply enter “crontab -e” on the shell. crontabのジョブのリストを編集するには、単純入力" crontab - eで"上のシェルです。 Existing crontab will appear on a text editor, such as GNU nano.は、既存のcrontabが表示されるなどのテキストエディタの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.このような場合には、必要な変更は、キーを押しては" Ctrl - x "のは、以下を" Y "をファイルを保存して、以下を入力すると、デフォルトのファイル名を押して受け入れる。 The new crontab will be installed and in effect immediately.新しいcrontabにすぐに効果がインストールされることとします。
Note that the path to apachectl may be different on different variant of Unix, Linux or BSD flavors.に注意して、パスする方法が異なる場合があります異なるその他のUnix 、 LinuxやBSDのフレーバーです。 Use one of the following command to find out where is Apache installed:のいずれかを使用は、以下のコマンドを確認するにはどこにApacheのインストール:
find / apachectl | grep apachectl検索/ 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.いくつかのApacheの5月のインストール/ usr / sbinに/ apachectlか、または使用することができますapachectl httpdあるいはシンボリックリンクを/ etc / rc.d / init.dに/ apachectl又は/ etc / rc.d / init.dに/のhttpdです。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toをご覧ください original English articleオリジナルの英語記事索引 whenever possible.可能な限りです。
Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。
Related Articles関連記事
- Start, Stop and Restart Crond Daemon in Linuxスタート]ボタン、デーモンを停止し、再起動するLinuxのcrond
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 FreeBSDの6.0をインストールするWebサーバーのApache 2.2 、 MySQL 5.0以降およびPHP 5 -パート4
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Apacheの起動に失敗しましたのhttpdのためにそのようなことはできません。 mod_bwlimited開いたり、ファイルmod_log_bytesまたはmod_bandwidth
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apacheの警告namevirtualhost * : 80がないとエラーが発生スタート]ボタンをvirtualhosts
- Install mod_evasive for Apache to Prevent DDOS Attacks Apacheのインストールを防止するためmod_evasive DDoS攻撃
- Restart or Shutdown Windows (XP, 2000 and Vista) from Command Line or One-Click Shortcut Windowsの再起動またはシャットダウン( XPの場合は、 2000年とビスタ)より1つのコマンドラインまたはショートカットをクリックします
- Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header Apache Webサーバのセキュリティ向上させる:ヘッダーの使用を無効にservertokensとserversignature
- Automatically Shutdown Computer With Auto Shutdown Geniusコンピュータを自動的にシャットダウン時の自動シャットダウンの天才
- cPanel WHM Failed to Receive Status Information From Apache Error cpanel whmのステータス情報を受信するに失敗しましたからApacheのエラーが発生
- Apache Status (whm-server-status) in cPanel WebHost Manager Returns Blank Page Apacheのステータス( whm -サーバの状態)で空白のページcpanelウェブホスティングサービスマネージャを返します。












