Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deploying/running an application under a domain

Status
Not open for further replies.

snitin78

Programmer
Mar 16, 2009
96
US
Hi everyone,

I need some advice on the following scenario. On one of our machines, we have Apache listening to requests on port 80 and then forwarding them to JBoss for some of our web applications. As of now the redirects are performed using the IP address of the machine, something like below:

Code:
<VirtualHost *:80>
     ServerName abc.domain.com

     ProxyPass /app-root [URL unfurl="true"]http://192.xxx.x.xxx:8080/app-root[/URL]
     ProxyPassReverse /app-root  [URL unfurl="true"]http://192.xxx.x.xxx:8080/app-root[/URL]

</VirtualHost>

This has been working well so far. But now I need to deploy a 3rd Party application that only works if it is deployed under a domain (IP address or localhost will not work). I am not supposed to change the host file on the system and can only use the DNS. Given this, I tried the following in Apache but in vain...

Code:
<VirtualHost *:80>
     ServerName abc.domain.com

     ProxyPass /app-root [URL unfurl="true"]http://192.xxx.x.xxx:8080/app-root[/URL]
     ProxyPassReverse /app-root  [URL unfurl="true"]http://192.xxx.x.xxx:8080/app-root[/URL]

ProxyPass /new-app-root [URL unfurl="true"]http://abc.domain.com/new-app-root[/URL]
     ProxyPassReverse /new-app-root  [URL unfurl="true"]http://abc.domain.com/new-app-root[/URL]

</VirtualHost>

And then have a Rewrite rule as follows:

<IfModule mod_rewrite.c>
 RewriteEngine On
 
 RewriteRule ^/new-app-root/(.*) \
   [URL unfurl="true"]http://192.xxx.x.xxx:8080/new-app-root/$1[/URL] [L,P]
 
 RewriteRule ^/new-app-root$ \
   [URL unfurl="true"]http://192.xxx.x.xxx:8080/new-app-root/[/URL] [L,P]
  
 </IfModule>

Is this the right way to make the application feel as if it is running under a domain?

Please note: Surprisingly, the same apache config worked for this new app on a different box. Why would it not work on this new box?

Appreciate any help that I can get.

Thanks.

Nitin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top