Apache Server configuration support - Different urls different services - how?

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > August 2007 > Different urls different services - how?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Different urls different services - how?
Paweł Stawicki

2007-08-15, 7:22 pm

Hello,

I am a noob in apache configuration. Probably it is something simple, but...

I have a remote server. Ip, lets say, 111.11.11.11. It is public ip. At
home, if I enter "http://111.11.11.11/phpmyadmin" in my browser, I get
to phpmyadmin. "http://111.11.11.11" gets me to default apache page. I
have also a ruby application deployed at port 3000, so if I enter
"http://111.11.11.11:3000" I get to this application.

Now I want to do something to get to the application by entering URL
like "http://111.11.11.11/application". I want such URL to get me
actually to "http://111.11.11.11:3000".

Ruby uses URL path for passing information, so I also need something
like "http://111.11.11.11/application/some/information" to go to
"http://111.11.11.11:3000/some/information"

While doing all this, I want everything else than
"http://111.11.11.11/application/*" to work like it is working today. I
want to get to phpmyadmin by "http://111.11.11.11/phpmyadmin".

I read about mod_proxy and mod_rewrite but I am not able to make it working.

My serwer is debian, apache 2.

Thanks in advance
Pawel Stawicki
Davide Bianchi

2007-08-16, 7:21 am

On 2007-08-15, Pawe? Stawicki <pawelstawicki@[cut_this_out]> wrote:
> I have also a ruby application deployed at port 3000, so if I enter
> "http://111.11.11.11:3000" I get to this application.
> Now I want to do something to get to the application by entering URL
> like "http://111.11.11.11/application". I want such URL to get me
> actually to "http://111.11.11.11:3000".


Use a RewriteRule to 'proxy' /application to :3000, something
like

RewriteCond ^/application/.*$
RewriteRule ^/application/(.*)$ http://localhost:3000/$1 [P]

Note: I'm no rewrite expert.

Or use a VirtualHost and a Proxy directive to do the same.
See the documentation for Rewrite and Proxy.

Davide

--
DOS Tip of the Day:
Add BUGS=OFF to your CONFIG.SYS file.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com