Pocketstudio.jp :: Logbook :: Linux :: Fedora Core 3のメモ
 Contributed at:   2004/11/15 (Mon) 17:27

■ /linux/FedoraCore3/ FedoraCore3 付属 httpd の関連ファイル・操作メモ


  • 起動【 /etc/rc.d/init.d/httpd start 】
    # /etc/rc.d/init.d/httpd start
    httpd を起動中:                                            [  OK  ]
    
  • 停止【 /etc/rc.d/init.d/httpd stop 】
    # /etc/rc.d/init.d/httpd stop
    httpd を停止中:                                            [  OK  ]
    
  • 再起動【 /etc/rc.d/init.d/httpd restart 】
    # /etc/rc.d/init.d/httpd start
    httpd を停止中:                                            [  OK  ]
    httpd を起動中:                                            [  OK  ]
    
  • SuEXEC が入っているか?有効か?
    # rpm -qf /usr/sbin/suexec
    httpd-suexec-2.0.52-3
    
     rpm パッケージでインストールしていたようだ。apache のエラーログからも確認。
    # tail /var/log/httpd/error_log
    [Mon Nov 15 16:20:19 2004] [notice] mod_python: Creating 4 session mutexes based on 256 max processe
    s and 0 max threads.
    [Mon Nov 15 16:20:20 2004] [notice] Apache/2.0.52 (Fedora) configured -- resuming normal operations
    [Mon Nov 15 16:21:44 2004] [notice] caught SIGTERM, shutting down
    [Mon Nov 15 16:21:45 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Mon Nov 15 16:21:45 2004] [notice] Digest: generating secret for digest authentication ...
    [Mon Nov 15 16:21:45 2004] [notice] Digest: done
    [Mon Nov 15 16:21:45 2004] [notice] LDAP: Built with OpenLDAP LDAP SDK
    [Mon Nov 15 16:21:45 2004] [notice] LDAP: SSL support unavailable
    [Mon Nov 15 16:21:45 2004] [notice] mod_python: Creating 4 session mutexes based on 256 max processe
    s and 0 max threads.
    [Mon Nov 15 16:21:46 2004] [notice] Apache/2.0.52 (Fedora) configured -- resuming normal operations
    
  • 設定ファイルのパス /etc/httpd/conf/httpd.conf
  • その他設定ファイル /etc/httpd/conf.d/*
    # ls -l /etc/httpd/conf.d/
    合計 112
    -rw-r--r--  1 root root      392 10月 16 00:41 README
    -rw-r--r--  1 root root     3420  6月 16 09:46 auth_mysql.conf
    -rw-r--r--  1 root root     3512  9月 23 20:59 auth_pgsql.conf
    -rw-r--r--  1 root mailman   688 10月 19 02:53 mailman.conf
    -rw-r--r--  1 root root      778 10月 16 00:41 manual.conf
    -rw-r--r--  1 root root      330  8月 17 18:58 mrtg.conf
    -rw-r--r--  1 root root     1827 10月  3 21:41 perl.conf
    -rw-r--r--  1 root root      448 10月 21 03:53 php.conf
    -rw-r--r--  1 root root     1438 10月 12 19:15 python.conf
    -rw-r--r--  1 root root       96 10月 14 22:18 squirrelmail.conf
    -rw-r--r--  1 root root    10918 10月 16 00:41 ssl.conf
    -rw-r--r--  1 root root      352  8月 19 06:44 webalizer.conf
    -rw-r--r--  1 root root      299 10月 16 00:41 welcome.conf
    
     /etc/httpd/conf.d/ 配下にあるファイルは httpd.conf の指定(Include conf.d/*.conf)によって、すべて読み込まれる。各種 .conf ファイルの有無はインストールされているパッケージによって左右されるようだ
    • mrtg.conf, webalizer.conf は Alias(別名) とアクセス制限がかけられている。
    • ssl.conf は mod_ssl モジュールを組み込んだ為。https:// 〜としてアクセス可能。初期状態(デフォルト)では証明書は localhost.localdomain としてホスト名が定義されている。
  • DocumentRoot (ドキュメント・ルート=http://URL/ としてアクセスした時に表示される場所= /var/www/html
     初期状態では【 Fedora Core Test Page 】と画面が表示されている。
     また、/var/www/html には何もファイルは置かれていない。
    # ls -la /var/www/html/
    合計 16
    drwxr-xr-x  2 root root 4096 10月 16 00:41 .
    drwxr-xr-x  9 root root 4096 11月 13 20:17 ..
    
     ファイルが無くてもページが表示されているのは /etc/httpd/conf.d/welcome.conf があるため。ファイルがなかった場合、というより Forbidden(403) として表示権限が無い場合(index.html などが無い場合も含む)。
     『 Fedora Core Test Page 』の実体は /var/www/error/noindex.html
    # cat /etc/httpd/conf.d/welcome.conf
    #
    # This configuration file enables the default "Welcome"
    # page if there is no default index page present for
    # the root URL.  To disable the Welcome page, comment
    # out all the lines below.
    #
    <LocationMatch "^/+$">
        Options -Indexes
        ErrorDocument 403 /error/noindex.html
    </LocationMatch>
    
     お約束の表示テスト『 vi /var/www/html/index.html 』を設置。
    # vi /var/www/html/index.html
    <html>
    <body>
    Hello, world!
    </body>
    </html>
    
     ファイル保存後 http://192.168.11.253/ (このサーバのIP) にアクセス。『 Hello, world! 』が表示されているのを確認。
     DirectoryIndex で指定されているのは 『 index.html index.html.var 』のみ。ファイルが無いと先の noindex.html ページが表示されてしまう。混乱を避けるためには /etc/httpd/conf.d/welcome.html を削除しておいたほうが良いかもしれない。  
  • ログの出力 /var/log/httpd 配下。/etc/logrotate.d/http によって、/var/log/httpd/*.log ファイルがローテートされる設定にある。標準のままなので毎週日曜日午前4時2分に実行(/etc/crontab → /etc/cron.daily/ 配下のスクリプト実行されるのが毎日4時2分。標準のローテート指定 /etc/logrotate.conf では weekly(毎週),rotate 4 (過去4回分まで保存される)設定。

    [分類 /linux/FedoraCore3 ] 固定リンク

  •  
     書込記録 - Calendar -
    11月(November)
    Sun Mon Tue Wed Thu Fri Sat
     
    15
           
    2004
    11月
     お品書き[ BLOG ] - Weblog -
     過去ログ書庫 - Archives -

      "ポケットスタジオ" Copyright ©1997-2004 Pocketstudio.jp. Some rights reserved.