RodneY
RodneY

Reputation: 13

Two applications on same port 80 with apache proxy?

I have two applications on one server: Redmine running under Apache and application running under WildFly. Now, Redmine runs on port 80 and the other application runs on port 8080.

Is it possible to run them both on port 80 using Apache reverse proxy ? This server would have assigned two domain names: app.domain.com for application under WildFly and redmine.domain.com for redmine application under Apache.

Is it possible to achieve following behavior ?

I access to redmine.domain.com, I am redirected to /var/www/redmine DocumentRoot folder.

And when I access to client.domain.com, I am redirected to http://localhost:8080.

Thank you

Upvotes: 0

Views: 2615

Answers (1)

Tea Curran
Tea Curran

Reputation: 2993

This is easy to do with apache. You can't bind two applications to one port but you can have apache route them.

What you want to do is run Apache on port 80, wildfly on 8080, redmine on 8081.

Within apache the configuration would look like this:

<VirtualHost app.domain.com:80>
    ProxyPass / http://127.0.0.1:8080/ retry=0
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
<VirtualHost redmine.domain.com:80>
    ProxyPass / http://127.0.0.1:8081/ retry=0
    ProxyPassReverse / http://127.0.0.1:8081/
</VirtualHost>

Upvotes: 2

Related Questions