Aspire Oneにapache2.2+PHP5を導入 - 3

まだここに書いてない設定があったので、残りもメモメモ。
以前の記事にも修正をしてあります。

DocumentRootの設定

にアクセスしたときに最初に表示されるディレクトリの設定です。

  • /apacheのインストールフォルダ/conf/httpd.conf

このファイルの下記の部分の「任意のフォルダ」を書き換えます。
サーバー上で動かしたいファイルのある場所を指定しましょう。
二箇所とも同じ場所を指定します。

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "任意のフォルダ"

#
# This should be changed to whatever you set DocumentRoot to.
#

DirectoryIndexの設定

URLでファイル名を指定しないときに、自動でindex.htmlやindex.phpなどの(通常トップにくる)ファイルをここで設定します。
下線部に、ファイルを直接指定しなかったときに読み込まれるファイル名.拡張子を指定しています。
http://d.hatena.ne.jp/minarai_wizard/みたいなときね。普通は、http://d.hatena.ne.jp/minarai_wizard/index.phpみたいな感じで指定しないと、特定のファイルは読み込まれません。)

下記は僕の設定です。最初に書いたものほど優先順位が高くなります。
phpファイルはDefaultでは指定されていないので、必要なら手動で追記。

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#

DirectoryIndex index.html index.php top.html top.php

mime_moduleの指定

下線部を

内に追記。
これでPHPPHPとして実行されます。

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi
AddType application/x-httpd-php .php