【问题标题】:What causes the default Apache page to open up when the Moodle site is loaded加载 Moodle 站点时打开默认 Apache 页面的原因是什么
【发布时间】:2020-04-22 17:01:37
【问题描述】:

我的网站www.site.com 加载了 apache2 的“它可以工作”页面,而不是位于 /var/www/html/moodle 的预期的 moode 主页。在moodle目录中有一个索引文件index.php,但默认不使用。如果我去www.site.com/moodle,网站主页就来了。配置文件/etc/apache2/sites-available/site.conf 已启用。如何解决?

<VirtualHost *:80>
    ServerName www.site.com
    ServerAlias site.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/moodle
    DirectoryIndex index.php
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.site.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} 
    [END,NE,R=permanent]
</VirtualHost>

【问题讨论】:

    标签: apache web-services server ubuntu-18.04 moodle


    【解决方案1】:

    这个可以通过换行来解决

    DirectoryIndex index.php
    

    DirectoryIndex index.php /moodle/index.php
    

    在文件/etc/apache2/sites-available/site.conf中。

    来源: https://httpd.apache.org/docs/2.4/mod/mod_dir.html

    【讨论】:

      猜你喜欢
      • 2017-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2015-04-20
      • 2019-10-16
      • 2018-06-17
      相关资源
      最近更新 更多