Question

Let's say I have the following configuration:

<VirtualHost domain.com>
    # Server names, admins, logs etc...

    ProxyVia On
    ProxyRequests Off
    <Location "/">
        ProxyPass http://localhost:8080/tomcat-webapp/
        ProxyPassReverse http://localhost:8080/tomcat-webapp/
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

Now, I want the address domain.com/forum to display content of my MyBB forum, which has its files inside the /var/www/forum directory. How to accomplish this?

Was it helpful?

Solution

Actually, I resolved this problem with the following code:

ProxyPass /forum !
ProxyPass / http://localhost:8080/tomcat-webapp/
ProxyPassReverse / http://localhost:8080/tomcat-webapp/
Alias /forum /var/www/forum

OTHER TIPS

What it is recommending is using mod_rewrite to perform the ProxyPass instead of ProxyPass/ProxyPassReverse command.

Try something like:

RewriteRule  ^/forum   -  [L]
RewriteRule  ^/(.*)    http://localhost:8080/tomcat-webapp/$1  [P,L]
ProxyPassReverse /     http://localhost:8080/tomcat-webapp/

I use:

<VirtualHost *:80>
#other irrelevant configs here
ProxyPass /forum http://localhost:8080/myBB
ProxyPassReverse /forum http://localhost:8080/myBB
ProxyPass / http://localhost:8081/tomcat-app
ProxyPassReverse / http://localhost:8081/tomcat-app
</VirtualHost>

You don't have to say "tomcat-app" if your tomcat app is the root app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top