apache - 加载 Moodle 站点时打开默认 Apache 页面的原因是什么
问题描述
我的网站www.site.com
加载 apache2 'It works' 页面,而不是预期的 moode 主页,该主页位于/var/www/html/moodle
. 在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>
解决方案
这可以通过更改行来解决
DirectoryIndex index.php
至
DirectoryIndex index.php /moodle/index.php
在文件中/etc/apache2/sites-available/site.conf
。
推荐阅读
- java - 在 Spring MVC 项目中出现错误“在 DispatcherServlet 中找不到带有 URI [/FirstSpringMvcProj/] 的 HTTP 请求的映射”
- python - NoReverseMatch "无效的新函数或模式名称"
- c# - 将字符串转换为 lambda 表达式以传递给 LINQ Select
- laravel - 使用数据透视表作为对另一个模型的引用
- wpf - 将 DatePicker.IsEnabled 绑定到 ComboBoxItem.IsSelected
- android - 获取android中任何应用程序之间的每个共享文本
- r - lapply:继承错误(x,“Source”):空目录
- ios - 回调函数不重新加载数据库
- kubernetes - 如何限制 Kubernetes emptyDir Volume 使用的磁盘数量?
- javascript - 所有函数实际上都是javascript中的方法吗?