Apache と Apache-SSL の自動起動

Debian 起動時に Apache と Apache-SSL が自動で起動されるように設定する.
デフォルトで作られるので,特に再構築時にやる必要は無し

設定

  1. 起動用のシェルスクリプト作成.
    # vi /etc/init.d/apache
    # vi /etc/init.d/apache-ssl
    
    Apache のシェルスクリプトはここ, Apache-SSL のシェルスクリプトはここ
  2. 実行ファイルにする.
    # chmod 755 /etc/init.d/apache
    # chmod 755 /etc/init.d/apache-ssl
    
  3. 自動で起動されるようにする.
      # update-rc.d apache start 80 2 3 4 5 .
      # update-rc.d apache-ssl start 80 2 3 4 5 .
    
    このコマンドの詳細については man update-rc.d(8) を参照のこと. # 以下のコマンドが実行されているのと同じ.
    # ln -s /etc/init.d/apache /etc/rc2.d/S80apache
    # ln -s /etc/init.d/apache /etc/rc3.d/S80apache
    # ln -s /etc/init.d/apache /etc/rc4.d/S80apache
    # ln -s /etc/init.d/apache /etc/rc5.d/S80apache
    # ln -s /etc/init.d/apache-ssl /etc/rc2.d/S80apache-ssl
    # ln -s /etc/init.d/apache-ssl /etc/rc3.d/S80apache-ssl
    # ln -s /etc/init.d/apache-ssl /etc/rc4.d/S80apache-ssl
    # ln -s /etc/init.d/apache-ssl /etc/rc5.d/S80apache-ssl
    

最終更新日: 2014/05/12 (渡辺 健介) フォーマット修正 Copyright © 2014 epcore