404试图本地LAMP服务器上的本地主机访问时未找到错误 [英] 404 Not Found Error when trying to access localhost on local LAMP server

查看:195
本文介绍了404试图本地LAMP服务器上的本地主机访问时未找到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行Ubuntu。我的Apache2默认文件看起来像这样:

I'm running Ubuntu. My Apache2 default file looks like this:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                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 combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

我有这个文件在/ var名为index.php的/ WWW /

I have this file called Index.php in /var/www/

<?
phpinfo();
?>

当我访问 HTTP:在我的浏览器//本地主机/ ,我得到404 Not Found错误:

When I access http://localhost/ in my browser, I'm getting the 404 Not Found error:

请求的URL /没有被此服务器上找到。
在本地主机端口80的Apache / 2.2.16(Ubuntu的)服务器

The requested URL / was not found on this server. Apache/2.2.16 (Ubuntu) Server at localhost Port 80

我是什么做错了吗?其实,这工作时,我第一次安装LAMP,但它不工作了。

What am I doing wrong? This actually worked when I first setup LAMP but it's not working now.

推荐答案

在/ etc查看/启用站点的Apache2 /。好像我升级到10.10洗雪从该目录的符号链接。试试默认的符号链接到/ etc / apache2的/网站的可用/默认

Have a look in /etc/apache2/sites-enabled. It seems like my upgrade to 10.10 has wiped the symlinks from that directory. Try symlinking default to /etc/apache2/sites-available/default

sudo ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/default

这篇关于404试图本地LAMP服务器上的本地主机访问时未找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆