Proxying ActiveMath on the back of Apache

Quite often, it is impossible for ActiveMath’s http port to be well accessible from the world. Firewalls, and other measures make the ActiveMath port 8080 inaccessible.

The Apache Web Server is the most used Web-server in the world, it is easy to deploy, is cross platform etc. This page explains how to use Apache’s mod_proxy to serve ActiveMath within the Apache space.

The basic idea:

  • only the Apache server runs, say, at http://myschool.net
  • you can run ActiveMath somewhere persistently inside the school (say on amserver at port 8080)
  • you configure the Apache to relay any request to http://myschool.net/ActiveMath2/ to go to your ActiveMath

Configuration on Apache side

The following configuration has been tested with Apache 2.0 but should work with further versions. Note Apache servers earlier than 2.0 do not ship per default with mod_proxy which needs to be configured and activated separately.

Add the following to your httpd.conf or to some virtual-host configuration:

    ProxyPass /ActiveMath2 http://amserver:8080/
    ProxyPassReverse /ActiveMath2 http://amserver:8080/

then restart your Apache. All requests on http://myschool.net/ActiveMath2/ will now be answered by the ActiveMath on amserver.

It is also possible to proxy the whole “/” within a virtual-host directive.

Configuration on ActiveMath side

Although the basic things will work with the above, there are times where ActiveMath needs to know the exact URL it is addressed through. This is the case of such advanced usages such as the Java Web Start descriptors of the assembly tool or ICmap.

Continuing the set-up above, add the following line to your ActiveMath-individual.properties:

 advertizedURL = http://myschool.net/ActiveMath2/

then restart ActiveMath. After this you are all set-up.