404找不到Apache服务器

时间:2012-11-22 06:04:07

标签: apache http-status-code-404

我正在尝试设置我的网站,每当我尝试使用我的域名进行连接时,我都会收到“404 Not Found”

当我尝试使用我的IP访问该网站时,它可以正常工作。

我在Debian x64上。

有人可以帮我解决这个问题。

如果您需要更多信息,请询问。

Httpd.conf

Apache2.conf

3 个答案:

答案 0 :(得分:2)

你的网站在哪里?在本地网络或托管服务提供商处?

在任何情况下,您都需要根据您的要求将您的网络服务器IP添加到DNS服务器(本地或www),而不知道您的网络服务器在本地或全球的位置,很难给您答案

答案 1 :(得分:1)

虚拟主机应如下所示:

    <VirtualHost *:80>
        ServerAdmin nicholas_brown@rocketmail.com
        DocumentRoot /home/web/websites/special-faces.net
        ServerName special-faces.net
        ServerAlias www.special-faces.net
        ErrorLog /home/web/website_logs/errorlog.txt
        CustomLog /home/web/website_logs/accesslog.txt common

        <Directory "/home/web/websites/special-faces.net">
            Order allow,deny
            Allow from all
        </Directory>

     </VirtualHost>

如果您想使用.htaccess文件,请在&#34;允许所有&#34;之后添加。行:

    Allowoverride all

答案 2 :(得分:0)

对于服务器版本:Apache / 2.4.16及更高版本,

<VirtualHost localhost.com:80>
        ServerName localhost.com
        ServerAlias localhost.com
        ServerAdmin webmaster@localhost
        RewriteEngine On

        DocumentRoot /var/www/html
        DocumentRoot /home/<user name where code will be placed>/public_html/html
        <Directory /var/www/html>
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combinedtimezone

</VirtualHost>