Live Server无法加载其他页面并显示Apache 404错误

时间:2020-03-01 04:10:49

标签: php apache2 codeigniter-3

我正在Google Cloud Platform上使用Google VM实例来运行我的实时服务器。我还使用CodeIgniter构建服务器。进入页面时,它可以加载默认路由,但转到其他路由时,它显示Apache 404错误:

未找到

在此服务器上找不到请求的URL。

位于35.186.147.249端口80的Apache / 2.4.29(Ubuntu)服务器

位于/etc/apache2/sites-available的我的Apache配置文件:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html

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

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride All
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

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

    CustomLog /var/log/apache2/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>

我在网上查了一下,大多数人说这是Apache的问题,但我不太确定。我将共享任何文件以解决此问题。

1 个答案:

答案 0 :(得分:0)

DocumentRoot / var / www / html行确定了文件的基础,我检查了您输入的IP,可以看到下一个文件夹并正确访问:

  • j /
  • 医疗调查/
  • temp /

这里是link,以了解有关DocumentRoot的更多信息,因此您可以定义在何处需要Web文件的默认文件夹路由。如果您需要Web开发的其他链接,则可以按照此link来配置虚拟主机。希望这就是您想要的。

相关问题