1. apacheのインストール # apt-get install apache2 php4 php4-common php4-cgi php4-dev libapache2-mod-php4 2.apacheの設定 DocumentRootとcgi-binの設定を変える。 /etc/apache2/sites-available/default を書き換える。 /var/www/ → /mnt/www/htdocs /usr/lib/cgi-bin/ → /mnt/www/cgi-bin/ # vi /etc/apache2/sites-available/default ----- :%s/\/var\/www\//\/mnt\/www\/htdocs\// :%s/\/usr\/lib\/cgi-bin/\/mnt\/www\/cgi-bin/ を実行する。 ----- # mkdir /mnt/www /mnt/www/htdocs /mnt/www/cgi-bin # chown -R www-data:www-data /mnt/www 3.PHPの設定 phpの設定ファイルを変更する。 # vi /etc/php4/apache2/php.ini ----- 以下のコメントアウトをはずす ;mbstring.language = Japanese ;mbstring.internal_encoding = EUC-JP ;mbstring.http_input = auto ;mbstring.http_output = SJIS ;mbstring.detect_order = auto ;mbstring.substitute_character = none 以下を変更 ;mbstring.encoding_translation = Off ↓ mbstring.encoding_translation = On ;default_charset = "iso-8859-1" ↓ default_charset = "Shift_JIS" output_buffering = Off ↓ output_buffering = On ;output_handler = ↓ output_handler = mb_output_handler magic_quotes_gpc = On ↓ magic_quotes_gpc = Off ----- Apache2の設定ファイルも更新 # vi /etc/apache2/apache2.conf ----- AddType application/x-httpd-php .php ----- 3.最後に再起動して終了。 # /etc/init.d/apache2 restart