Search code examples
apachexmppmod-proxy

How to configure apache to proxy requests


I want to add a javascript based chat system to my web app. I have read in many places that apache needs to forward(proxy) the requests to the xmpp chat server. From what I have understood , I either need to add proxying support to apache server OR use the jabberHTTPbind servelet.

I am trying the first thing. Add proxy support to apache. Now within Eclipse I am using Tomcat 7.0. I think this Tomcat comes with its own web server and is not using Apache. Is that true ?I am using Tomcat from http://tomcat.apache.org/download-70.cgi and added server in Eclipse by providing its extracted path.

I am not able to find any apache related folder structure eg(/etc/apache2/apache2.conf) within my Tomcat extracted directory.Also can't find httpd.conf anywhere . Should I need to download apache separately and connect my tomcat to it.

I think adding proxy support to apache is required because javascript code won't be able to connect to any URL other than the current domain. so the question again is the same , where are all these apache2.conf and httpd.conf to add mod_proxy. and where can I do the virtual host mapping.

Any help to move ahead with be very much appreciated.


Solution

  • You need to install the Apache HTTPD server and enable reverse proxying. Read the doc on mod_proxy on how to do this. There are tons of resources on Stackoverflow as well; search for Apache reverse Proxy. The conf files you mention are part of the Apache HTTPD install.

    javascript code won't be able to connect to any URL other than the current domain

    That is generally true unless you enable CORS