gpt4 book ai didi

apache - Moodle Apache 代理

转载 作者:行者123 更新时间:2023-12-02 07:20:54 25 4
gpt4 key购买 nike

我在 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>

在我拥有的具体服务器上。

 $CFG->wwwroot = 'http://192.168.1.101/classes';

还有

<VirtualHost 192.168.1.101:80>
ServerAlias 192.168.1.101
ServerAdmin webmaster@localhost
ServerName 192.168.1.101
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

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

ErrorLog ${APACHE_LOG_DIR}/error.log

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

CustomLog ${APACHE_LOG_DIR}/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>

问题是,我不断发现 Moodle 只能从 182.168.1.101 访问,这与预期不太相符。我已经能够配置 Confluence 和其他平台,但 Moodle 不起作用。

具体错误如下。

Incorrect access detected, this server may be accessed only through "http://192.168.1.101/classes"       address, sorry. Please notify server administrator.

有人知道会发生什么吗?

最佳答案

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

你可以试试

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

尽管这可能不允许 Moodle 中的某些命令行更新。

关于apache - Moodle Apache 代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25879299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com