Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a web application that communicates to a web service deployed on the same server. The web app was written with Tibco General Interface and works well only when it is running locally on the development system. When I deploy the web app to the Apache server it fails with code 200 apparently due to cross domain data. I use Firefox as a browser. I have tried changing Internet Explorer to access cross domain data and it works however IE is not an option.

Web application runs on 192.168.2.205 (port 80).
Web service runs on 192.168.2.205:8040

I have tried a number of things with proxypass inside Apache with no luck.

share|improve this question
    
Will help if you tell us how you have tried to make a proxypass... At the moment the questions would seem a little nonconstructive... so pass your code. –  bybe Apr 18 '13 at 17:33
    
The web service endpoint URL is 192.168.2.205:8040/services/HAservice is I tried ProxyPass /HAservice 192.168.2.205:8040/services/HAservice and point the web app to the URL 192.168.2.205/HAservice. This was totally random attempt... –  Eric Apr 18 '13 at 18:20
1  
I haven't been in the exact same position as you, but it was quite similar. I did a write-up of it here: deliciouslyweird.com/2012/06/apache-virtualhost-mod_proxy. Like I said it's not identical so I won't put it as an answer, but perhaps it'll push you in the right direction. –  Patrik Alienus Apr 18 '13 at 19:11
add comment

1 Answer

Here is an apache virtual host configuration that should work for you to reverse proxy your web app through Apache. Replace mydomain.example.com with your actual domain name. You will need to have mod_poxy and mod_proxy_http loaded by apache and if you use ProxyHTML directives, you will need mod_proxy_html as well.

<VirtualHost *:80>

    ServerName mydomain.example.com

    # Enable a reverse proxy to your web app
    ProxyRequests Off        
    ProxyPass / http://192.168.2.205:8040/

    # If your web app is setting cookies for the wrong domain name.
    # This fixes when they are set for 'localhost'.
    # If your web application is setting cookies correctly,
    # leave this section out
    ProxyPassReverseCookieDomain localhost mydomain.example.com

    # If your web app is writing links incorrectly.
    # If the web app sets all the URLs correctly,
    # leave this section out
    ProxyHTMLEnable On
    ProxyHTMLURLMap http://localhost/ http://mydomain.example.com/
    ProxyHTMLURLMap http://192.168.2.205/ http://mydomain.example.com/
    ProxyHTMLURLMap http://192.168.2.205:8040/ http://mydomain.example.com/

</VirtualHost>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.