Home > 玄箱 > 玄箱/HG Debian化apache2の設定方法

玄箱/HG Debian化apache2の設定方法

  • 2007-07-30 (月) 4:06
  • 玄箱

まず、apt-getで apache2をインストール

# apt-get install apache

次に、パールををインストール

# apt-get install libapache-mod-perl

そして、httpd.confを編集

# vi /etc/apache/httpd.conf

httpd.conf編集箇所

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

DirectoryIndex index.html index.htm index.cgi index.pl index.php
index.xhtml index.shtml

HostnameLookups Off

HostnameLookups On

LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw

LanguagePriority ja en da nl et fr de el it ko no pl pt pt-br ltz ca es sv tw

#AddHandler cgi-script .cgi

AddHandler cgi-script .cgi .pl

httpd.conf追加箇所
#<Directory /home/*/public_html>〜<Directory>の下あたり
<Directory /var/www/phpMyAdmin>
AllowOverride All
</Directory>

#AddHandler cgi-script .cgi .plの下あたり
#AddHandler send-as-is asis
AddHandler send-as-is asis

次に、デフォルト設定ファイルを編集

# vi /etc/apache/sites-available/default

編集例。

DocumentRoot /var/www/
<directory>
Options FollowSymLinks
AllowOverride All</directory>

#wwwでもCGIを使えるようにする
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
# This directive allows us to have apache2′s default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
#cgiエイリアスを変更
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
#<Directory “/usr/lib/cgi-bin”>
<Directory “/var/www/cgi-bin”>
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler image/gif .gif
AddHandler image/jpeg .jpeg .jpg .jpe
AddHandler image/png .png
AddHandler text/html .html .htm
</Directory>

次に、パールのパスのシンボリックリンクを追加
# cd /usr/local/bin
# ln -s /usr/bin/perl perl

mod_rewriteを使いたければ、rewriteのシンボリックリンクを追加
# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

そして再起動
# /etc/init.d/apache2 restart

Home > 玄箱 > 玄箱/HG Debian化apache2の設定方法

The Associates
Search
Feeds
Meta
一番大好きなドラマー後藤マスヒロ氏のホムペ

Return to page top