替换/ var / www / html目录后,apache不再起作用 [英] after replacing /var/www/html directory, apache does not work anymore
问题描述
我正在设置aws ec2实例。安装apache之后,它具有/ var / www / html。然后,我用包含自己的php文件的html目录替换了html。现在index.php文件不再可以从浏览器访问。我在网上搜索,找不到任何解决方案。如果有人可以提供帮助,我将不胜感激。
I'm setting up an aws ec2 instance. After installing apache, it has /var/www/html. Then I replaced the html with my own html directory which contains my php files. Now index.php file is not accessible from browser anymore. I searched online, and could not find any solution. I would really appreciate if anyone can help.
我可以访问test.php或test.html。但是无法访问index.php,而实际上该默认情况下应该在没有给出名称的情况下默认加载。
I can access test.php or test.html. But can not access index.php which actually should be loaded by default without giving the name.
如果此信息有用,我复制的目录是wordpress。现在,浏览器仅显示空白页面。
The directory I copied over is wordpress, if this information is useful. And right now, the browser just shows a blank page.
推荐答案
检查文件的权限
ls -lR /var/www
可能是Apache用户(例如www-data)没有权限。
It may be that the Apache user (e.g. www-data) does not have permissions to them.
chmod 744 -R /var/www/html
也尝试重新启动Apache。
And try restarting Apache too.
/etc/init.d/apache2 restart
这篇关于替换/ var / www / html目录后,apache不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!