Moodle-apache代理

Moodle-apache代理,apache,proxy,reverse,moodle,Apache,Proxy,Reverse,Moodle,在apache代理后面设置moodle实例时遇到问题 这是我的apache前端,它代理正在运行的服务器 NameVirtualHost www.example.com:443 <VirtualHost www.example.com:443> ProxyPreserveHost On ProxyRequests Off ServerName www.example.com ServerAlias www.example.com ProxyPass / http:/

在apache代理后面设置moodle实例时遇到问题

这是我的apache前端,它代理正在运行的服务器

NameVirtualHost www.example.com:443
<VirtualHost www.example.com:443>
  ProxyPreserveHost On
  ProxyRequests Off
  ServerName www.example.com
  ServerAlias www.example.com
  ProxyPass / http://192.168.1.101/
  ProxyPassReverse / http://192.168.1.101/
  SSLEngine on
  SSLCertificateFile /etc/ssl/crt/example.com.crt
  SSLCertificateKeyFile /etc/ssl/crt/example.com.key
  SSLCACertificatePath /etc/ssl/crt
  SSLCertificateChainFile /etc/ssl/crt/example.com.bundle.crt
</VirtualHost>


有人知道会发生什么吗?

这是一条Moodle错误消息,config.php中的wwwroot必须匹配

你可以试试

$CFG->wwwroot   = 'http://' . $_SERVER['HTTP_HOST'];

虽然这可能不允许在Moodle中进行某些命令行更新。

那么,指向前端的URL是什么


这就是您需要将$CFG->wwwroot设置为的内容。

在代理服务器上,修改VirtualHost条目,如下所示:

ProxyPass / http://192.168.1.101/classes
ProxyPassReverse / http://192.168.1.101/classes
对于Moodle,您在Moodle的config.php中设置了什么

$CFG->wwwroot


…必须匹配代理服务器上VirtualHost定义中的
ProxyPass
ProxyPassReverse
值。

嗯,我想没有。Apache使用https并使用http发出请求。现在的主要问题是,我无法测试它,因为我已经找到了一个解决方法,而且由于它是生产环境,我不会再试一次,除非我真的需要。不过,感谢您的努力:)
Incorrect access detected, this server may be accessed only through "http://192.168.1.101/classes"       address, sorry. Please notify server administrator.
$CFG->wwwroot   = 'http://' . $_SERVER['HTTP_HOST'];
ProxyPass / http://192.168.1.101/classes
ProxyPassReverse / http://192.168.1.101/classes