【问题标题】:Apache - Apache2 Debian Default Page instead of my websiteApache - Apache2 Debian 默认页面而不是我的网站
【发布时间】:2018-06-17 13:50:12
【问题描述】:

我在 Debian 上有一个 Apache 2,并且是初学者(新手)。 在网络浏览器中访问我的网络服务器时,我会看到 Apache 默认欢迎页面:

我尝试显示我的真实网站(var/www/mywebsite.com/),而不是这个页面(位于 var/www/html)。下面是我服务器上的树:

---- etc
-------- apache2
------------ sites-enabled
---------------- mywebsite.com.vhost -> etc/apache2/sites-available/mywebsite.com.vhost
------------ sites-available
---------------- mywebsite.com.vhost

---- var
-------- www
------------ mywebsite.com
---------------- web
-------------------- css/
-------------------- js/
-------------------- img/
-------------------- error/
-------------------- index.html
-------------------- robots.txt

我的 .vhost 文件配置良好:

AllowOverride None
Require all denied

DocumentRoot /var/www/mywebsite.com

ServerName mywebsite.com
ServerAlias www.mywebsite.com
ServerAdmin webmaster@mywebsite.com

ErrorLog /var/log/ispconfig/httpd/mywebsite.com/error.log

Alias /error/ "/var/www/mywebsite.com/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html


<Directory /var/www/mywebsite.com/web>

    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted.

</Directory>

.. 我重新启动了 Apache。没有成功! Apache 默认页面仍然存在。我错过了什么?

【问题讨论】:

    标签: apache debian apache2


    【解决方案1】:

    删除 index.html

    您的 index.html 位于 /var/www/html

    1. cd /var/www/html
    2. sudo chown -R whoami /var/www/html
    3. rm index.html
    4. ls

    【讨论】:

      【解决方案2】:

      您的index.html 位于/var/www/mywebsite.com/web,我猜这是网站根文件夹?试试这个配置:

      DocumentRoot /var/www/mywebsite.com/web
      

      【讨论】:

      • 你好,本,同样的结果。我发现 Apache 加载的唯一 *.conf 文件是 etc/apache2/sites-available/000-default.conf。
      【解决方案3】:

      我找到了解决办法。

      Apache 加载的唯一 *.conf 文件是 etc/apache2/sites-available/000-default.conf,然后我处理这个文件来解决我的问题。

      希望将来能对某人有所帮助!

      【讨论】:

        【解决方案4】:

        只需从此路径 /var/www/html 中删除这两个文件 index.html 和 index.nginx-debian.html ....好

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多