I want to do something like this, I have a single machine x.x.x.x, in which i need to run two website www.xyz.com which is in php (run in apache 2 server) and another javaEE service in www.xyz.com/service (run in apache tomcat or glassfish server). Both need to run on port 80 (from client side view). Can you please ans me, how to do that? My machine is Debian linux 6.0.
Asked
Active
Viewed 121 times
-1
-
1You may handle both using one web server say `apache` running on port 80 and proxy the request `www.xyz.com/service` to other server running on some other port. – Naveed Nov 10 '12 at 23:19
-
i have only one server. i need to run both on same server. – sabbir Nov 11 '12 at 02:50
1 Answers
1
Use the mod_proxy
apache module which also supports AJP protocol, when loading additional module mod_proxy_ajp
.
Simple sample:
<Location /service/>
ProxyPass ajp://localhost:8009/service/
</Location>
where 8009 is the port defined for the connector in tomcat server.xml
, and /service is the context root (which may also be different from "/service").
Documentation: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

guido
- 18,864
- 6
- 70
- 95