我通过这个安装了apache:
apt-get install apache2 apache2-doc apache2-utils
和服务器正在运行,但不幸的是,当我在/ var / www中创buildindex.html文件仍然有结果:“404未find”。 文件httpd.conf是空的,并在apache.conf我没有看到任何文件夹来configuration。
日志将在/ var / log / apache2中find
默认的文档根目录是/ var / www,这应该正确设置
你怎么试图访问您的浏览器中的网站?
您应该检入/etc/apache2/sites-enabled/000-default 。 这是您将findDocumentRoot和其他指令的地方。
检查/etc/apache2/sites-enabled/
在defualtconfiguration文件的最后一行(apache2.conf)中有一个Include语句
# Include the virtual host configurations: Include sites-enabled/
你的服务器看起来并没有被正确安装。 你在安装Debian或apache2时是否遇到任何错误? 如果是这样,你应该重新安装Debian。 如果Apache是错误的,你应该这样做(假设你是root的):
apt-get update ## to make sure that you have the latest repository details apt-get upgrade ## to make sure your server is up to date (no incompatibilities or other) apt-get purge apache2 ## completely remove apache and any other config files related to it apt-get install apache2 ## re-install apache
然后,您可以使用编辑器编辑在/ etc / apache2 / sites-enabled / 000-default中find的默认configuration。 如果configuration文件仍然丢失,请回顾安装日志,可能是您错过了某个错误。