トップ/ Linuxのお部屋

Index/ previous/ next


Webサーバの設定

  1. ソフトウェア
  2. Apache/1.2.6 PHP/FI-2.0を使用します。


  3. [/etc/httpd/conf/access.conf]の変更
  4. [access.conf]は、公開制御を指定したり、各種操作の許可と制限を指定するファイルです。
    デフォルトでは、CGI、SSIの機能が制限されているので、有効にするようにします。

    --- access.conf Tue Apr 13 17:53:39 1999
    +++ access.conf Fri Apr 16 16:33:28 1999
    @@ -20,13 +20,13 @@
     # Note that "MultiViews" must be named *explicitly* --- "Options All"
     # doesn't give it to you (or at least, not yet).
    
    -Options Indexes FollowSymLinks
    +Options FollowSymLinks ExecCGI Includes
    
     # This controls which options the .htaccess files in directories can
     # override. Can also be "All", or any combination of "Options", "FileInfo",
     # "AuthConfig", and "Limit"
    
    -AllowOverride None
    +AllowOverride ALL
    
     # Controls who can get stuff from this server.
    
    @@ -40,7 +40,7 @@
    
     <Directory /home/httpd/cgi-bin>
     AllowOverride None
    -Options ExecCGI
    +Options ExecCGI Includes
     </Directory>
    
     # Allow server status reports, with the URL of http://servername/server-status
    
    
    Options
    ディレクトリごとに利用可能な機能を指定します。
      FollowSymlinks:シンボリックリンクを参照可能にします。
      ExecCGI:CGIを許可します。
      Includes:SSIを許可します。
    
    AllowOverride
    ディレクトリの[.htaccess]の指定を[access.conf]の指定より優先させるかどうか指定します。
    優先させる場合は、
      AllowOverride ALL
    とします。
    
    

  5. [/etc/httpd/conf/srm.conf]の変更
  6. [srm.conf]は、提供する文書を置くディレクトリ、CGIスクリプトを置くディレクトリなどを指定するファイルです。
    デフォルトでは、CGIとSSIの拡張子のタイプが指定されていないようなので、指定します。

    --- srm.conf    Tue Apr 13 17:53:52 1999
    +++ srm.conf    Tue Apr 20 15:24:58 1999
    @@ -158,10 +158,13 @@
    
     # To use CGI scripts:
     #AddHandler cgi-script .cgi
    +AddType application/x-httpd-cgi .cgi
    +AddType application/x-httpd-cgi .pl
    
     # To use server-parsed HTML files
    -AddType text/html .shtml
    -AddHandler server-parsed .shtml
    +#AddType text/html .shtml
    +AddType text/x-server-parsed-html .shtml
    +#AddHandler server-parsed .shtml
    
     # To use PHP
     AddType application/x-httpd-php .phtml
    
    AddType
    指定した拡張子にファイルの種類を割り当てます。
    
    

  7. 補足
  8. エラーログ [/var/log/httpd/error_log]
    再起動 kill -HUP (PID)

参考資料

Linuxネットワーク
小山 裕司,斎藤 靖,江後田 基広,川井 俊,木村 稔,小島 三弘,佐々木 浩,中込 知之,播口 陽一,トッパン,1998