Apache web server, multiple applications in different ports on one server

I have two applications running on Jboss 6 with a different context on the same port (8180). My Apache is running on port 80 of the computer. I need to direct the request to the appropriate context based on access to the application.

I have a dns entry - testServ14, which points to the IP address of the server.

To be more understandable, applications must be accessible through URLs such as

http: // testServ14 / appAcontext /

http: // testServ14 / appBcontext /

In the httpd-vhosts file, what should I use virtualhost or namevirtualhost directives?

How can i achieve this.

I tried the following, but did not work ...

<VirtualHost *:80>
ServerName http://testServ14/appA
ProxyRequests Off
ProxyVia On
ProxyPass / http://localhost:8180/appA
ProxyPassReverse / http://localhost:8180/appA
ErrorLog logs/error_log
CustomLog logs/access_log common
</VirtualHost>


<VirtualHost *:80>
ServerName http://testServ14/appB
ProxyRequests Off
ProxyVia On
ProxyPass / http://localhost:8180/appB
ProxyPassReverse / http://localhost:8180/appB
ErrorLog logs/error_log
CustomLog logs/access_log common
</VirtualHost>

thank

+3
source share
2 answers
-- updated

... , .

<VirtualHost *:80>
ServerName http://us14testServ/
ServerAlias us14testServ
ProxyRequests Off
ProxyVia On

#app1
ProxyPass /app1/ http://localhost:8180/app1/
ProxyPassReverse /app1/ http://localhost:8180/app1/

#app2
ProxyPass /app2/ http://localhost:8180/app2/
ProxyPassReverse /app2/ http://localhost:8180/app2/

ErrorLog logs/error_log
CustomLog logs/access_log common
</VirtualHost>
+3
+1

All Articles