編輯 /etc/httpd/conf/httpd.conf 文件時要注意: 找到: AddType application/x-compress .Z AddType application/x-gzip .gz .tgz 在后面添加: AddType application/x-httpd-php .php(使Apcche支持PHP) AddType application/x-httpd-php-source .php5 找到: <IfModule dir_module> DirectoryIndex index.html </IfModule> 添加: <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> 找到: #ServerName www.example.com:80 修改為: ServerName 127.0.0.1:80或者ServerName localhost:80 記得要去掉前面的“#” 修改默認的Web站點目錄 找到:DocumentRoot "/usr/local/apache2/htdocs" 修改為:DocumentRoot "/home/www/WebSite" --該目錄為自己創建的目錄 找到:<Directory "/usr/local/apache2/htdocs"> 修改為:<Directory "/home/www/WebSite">