Fedora core1 Apache VirtualHost 2.0.48 rpm

  Red Hat Linux 9 から Fedora core1 に 乗り換えるにあたり デフォルト rpm パッケージを 2.0.47 から 2.0.48

  テストバージョンにアップデートしていたため httpd.conf が いままでに見たことない ファイルになっていました。 

  試しに手を出したがなかなか設定ができず 2 時間も費やしてしまいました。 英語がわからん 

  結局あきらめ 同じディレクトリ内の httpd.conf.BAK を編集し設定いたしました。

   ck の環境下では必要な バーチャルホストに対応した設定をします。


httpd.conf

  設定ファイル場所  /etc/httpd/conf/httpd.conf   

  トップページのファイルを /home/ck/public_html/ 以下に置くものとする

  rpm パッケージの場合デフォルトでは /var/www/html/ 以下に通常は配置するが

  管理の利便性のために /home に 変更します。

  # cp /etc/httpd/conf/httpd.conf.bak /etc/httpd/conf/httpd.conf   // コピーします

  変更箇所 httpd.conf

  行番号は追加でコメントアウト後 変更を追加してますので ずれが生じてます 参考程度で 

  デフォルトがどのようだったか憶えておくために デフォルトのは消さずに ( # コメントアウト ) 直後にコメント行を追加しています。 

  バーチャルホストの場合デフォルトからの変更を下記のようにしました。

  # はコメントアウトした行 赤字は設定のため追記した部分 

===============================================================



   244: #ServerAdmin root@localhost

   245: ServerAdmin webmaster@shoukun.com             // 管理者のメルアド

   259: #ServerName new.host.name:80                  // コメントアウトになっているのを確認

   275: #DocumentRoot "/var/www/html"

   276: DocumentRoot "/home"                                                  

   301: #<Directory "/var/www/html">

   302: <Directory "/home">

   316: #Options Indexes FollowSymLinks                   // 左記の青字は下の設定で抜く

   317: Options FollowSymLinks IncludesNoExec ExecCGI MultiViews   

   352: #UserDir disable

   358: UserDir /home/*/public_html 

   363:

 
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

# <Limit GET POST OPTIONS>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>

 

   378:
 
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews SymLinksIfOwnerMatch ExecCGI IncludesNoExec
// 上記の青字を抜く
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

   399: #DirectoryIndex index.html index.html.var

   400: DirectoryIndex index.html index.shtml         // index.php は入れない  rpmPHP を入れているため

   592: #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"  

   599:

 
#<Directory "/var/www/cgi-bin">
# AllowOverride None
# Options None
# Order allow,deny
# Allow from all
#</Directory>

   606:

 
<Directory "/home/*/public_html/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>

   767: #LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ・・・

   768: LanguagePriority ja en ca cs da de el eo es et fr he hr it ko ・・・      // ja を先頭に

   787: #AddDefaultCharset UTF-8

   788: AddDefaultCharset none

   865: #AddHandler cgi-script .cgi

   866: AddHandler cgi-script .cgi                    // cgi を有効に

   1062: #NameVirtualHost *:80

   1063: NameVirtualHost 218.***.**.***:80

   1079:

 
<VirtualHost 218.***.**.***:80>
DocumentRoot /home/ck/public_html
ServerName ck.shoukun.com
</VirtualHost>
<VirtualHost 218.***.**.***:80>
   ServerAdmin webmaster@shoukun.com
   DocumentRoot /home/shoukun/public_html
   ServerName www.shoukun.com
   ServerAlias shoukun.com
   ScriptAlias /search /home/shoukun/public_html/cgi-bin
</VirtualHost>
             
<VirtualHost 218.***.**.***:80>
   ServerAdmin webmaster@*******.net
   DocumentRoot /home/*******/public_html
   ServerName www.*******.net
   ServerAlias *******.net
   ScriptAlias /search /home/*******/public_html/cgi-bin
</VirtualHost>

これ移行上記青字のように記述すればいくつでも対応可能です。

========================================================================

   以上で設定完了です Apache を再起動すれば完了だと思いますが 念のためいつもサーバーを再起動しています。

   PS,

   個人のみのサイトでバーーチャル機能を使う場合はユーザーディレクトリ以下に 例:) /home/ck/*** のように 

   ***ディレクトリをバーチャルを使用する分作成して 358. 378. 606. 行目と 1079 行目以下を適当に変更すると

   FTP での管理が少しやりやすいかと思います。

 


Copyright(C) 2000-2004, 初心者のServer構築法とWindowsネットワーク All Rights Reserved
webmaster@shoukun.com