Moodle serves on IP only - will not work with mod_proxy

Posted by Jon H on Server Fault See other posts from Server Fault or by Jon H
Published on 2012-03-25T16:19:37Z Indexed on 2012/03/25 17:32 UTC
Read the original article Hit count: 456

Filed under:
|
|

I'm trying to set a moodle server up on an Ubuntu box, which already serves Plone & Trac via Apache.

In my Moodle config I have $CFG->wwwroot = 'http://www.server-name.org/moodle'

The configuration below works fine for the first two, but when I visit www.server-name.com/moodle I get:

Incorrect access detected, this server may be accessed only through "http://xxx.xxx.xxx.xxx:8888/moodle" address, sorry

It then forwards to the IP address, where Moodle functions fine.

What am I missing to get the server name approach working correctly?


Apache Config follows:

LoadModule transform_module /usr/lib/apache2/modules/mod_transform.so
Listen 8080
Listen 8888

Include /etc/phpmyadmin/apache.conf

<VirtualHost xxx.xxx.xxx.xxx:8080>

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPreserveHost On

  <Location />
    ProxyPass http://127.0.0.1:8082/
    ProxyPassReverse http://127.0.0.1:8082/
  </Location>

</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx:80>
  ServerName  www.server-name.org
  ServerAlias server-name.org

  ProxyRequests Off

  FilterDeclare MyStyle RESOURCE
  FilterProvider MyStyle XSLT resp=Content-Type $text/html
  TransformOptions +ApacheFS +HTML
  TransformCache /theme.xsl /home/web/webapps/plone/theme.xsl
  TransformSet /theme.xsl
  FilterChain MyStyle

  ProxyPass /issue-tracker !
  ProxyPass /moodle !  

  <Location /issue-tracker/login>

    AuthType Basic
    AuthName "Trac"
    AuthUserFile /home/web/webapps/plone/parts/trac/trac.htpasswd
    Require valid-user

  </Location>


  Alias /moodle /usr/share/moodle/

  <Directory /usr/share/moodle/>

    Options +FollowSymLinks
    AllowOverride None

    order allow,deny
    allow from all

    <IfModule mod_dir.c>
      DirectoryIndex index.php
    </IfModule>

  </Directory>

  </VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-proxy