【发布时间】:2016-01-15 01:54:20
【问题描述】:
我刚刚部署了 LAMP 以准备安装 Elgg。在我部署了 apache 和 php 之后,我想通过创建 info.php 文件来测试我的进度。我将文件放在 /var/www/ 并尝试从浏览器访问它,结果却报错:
Not Found
The requested URL /info.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at 192.168.0.9 Port 80
当我在 /var/www/html 中放置相同的文件时,它工作并显示了 Apache 和 php 安装设置。谁能向我解释为什么?用于教育目的。
【问题讨论】:
-
因为默认情况下
/var/www/html是默认的文档根目录。如果您只想使用 /var/www/,则必须更改 httpd.conf -
您的配置文件夹的根目录为
DocumentRoot。在我位于httpd.conf中的服务器上/etc/httpd/conf/。