谢谢回答,是自己搭建的,php5, apache2.4.10,mysql5 然后服务器是linode ubuntu12.4.10.安装过程顺序是 apache、php、mysql。安装完之后,可以访问。我想修改一下目录,在/etc/apach2/sites-aliveble/000-default.conf,文件中修改了 DocumentRoot,就这样了。然后修改新目录的权限为755,index.php文件权限为644,还是不起作用。
000-default.conf中增加Directory节点也不起作用。
chown -R www:www path
默认路径需要root是拥有者。如果你需要修改默认路径,最好使用virtual host来做。
打开 /etc/apache2/httpd.conf
修改为<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot 这里填写你想用的路径
<Directory "这里填写你想用的路径">
allow from all Options + Indexes
</Directory>
</VirtualHost>