php – 404 Not Found尝试访问本地LAMP服务器上的localhost时出错

我正在运行Ubuntu.我的Apache2文件如下所示:

<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 / www /中有一个名为Index.PHP文件

<?
PHPinfo();
?>

当我在浏览器中访问http://localhost/时,我收到404 Not Found错误

在此服务器上找不到请求的URL /.
位于localhost端口80的Apache / 2.2.16(Ubuntu)服务器

我究竟做错了什么?当我第一次设置LAMP时,这实际上有效但现在不能正常工作.

解决方法:

看看/ etc / apache2 / sites-enabled.看起来我升级到10.10已经擦除了该目录中的符号链接.尝试将符号链接认为/ etc / apache2 / sites-available / default

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

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...