PHPを利用できるようにする

Includeディレクティブはコアモジュール。Include conf.d/php.confで/etc/httpd/conf.d/php.confを読み込み、下段の内容が追加されている。こうやって分けて書くと確かに管理しやすい。今にして思えば設定にとても苦労した過去がばかばかしい。

ServerRoot "/etc/httpd"
Listen 80
LoadModule mime_module modules/mod_mime.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule dir_module modules/mod_dir.so
User apache
Group apache
DocumentRoot "/var/www/html"
TypesConfig /etc/mime.types
Include conf.d/php.conf
AccessFileName .htaccess

Order allow,deny


AllowOverride All
Options ExecCGI
AddHandler cgi-script .cgi .rb
DirectoryIndex index.html index.cgi index.rb

LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php