Web Servers on Unix and Linux - Can this be implemented using virtual host?

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > August 2004 > Can this be implemented using virtual host?





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 Can this be implemented using virtual host?
Bing

2004-08-17, 5:50 pm

Linux 2.4.21-15.0.3.ELsmp #1 SMP Tue Jun 29 18:04:47 EDT 2004 i686
i686 i386 GNU/Linux
Apache/2.0.46

We have a web server that just has one IP address. But it has two
host names, management.my.com and market.my.com. All listen on port
80.

management.my.com/management maps to
/usr/local/apache/htdocs/management
market.my.com/market maps to /usr/local/apache/htdocs/market

Now we want to do some redirect. If user entered
http://management.my.com, http://management.my.com/management should
be displayed. If user entered http://market.my.com,
http://market.my.com/market should be displayed. Can this be done by
using virtual host? Most important, how? I would appreciate any
advices and pointers?

Thanks,

Bing
David Efflandt

2004-08-18, 2:47 am

On 17 Aug 2004 13:48:47 -0700, Bing <bdu@iastate.edu> wrote:
> Linux 2.4.21-15.0.3.ELsmp #1 SMP Tue Jun 29 18:04:47 EDT 2004 i686
> i686 i386 GNU/Linux
> Apache/2.0.46
>
> We have a web server that just has one IP address. But it has two
> host names, management.my.com and market.my.com. All listen on port
> 80.
>
> management.my.com/management maps to
> /usr/local/apache/htdocs/management
> market.my.com/market maps to /usr/local/apache/htdocs/market
>
> Now we want to do some redirect. If user entered
> http://management.my.com, http://management.my.com/management should
> be displayed. If user entered http://market.my.com,
> http://market.my.com/market should be displayed. Can this be done by
> using virtual host? Most important, how? I would appreciate any
> advices and pointers?
>
> Thanks,
>
> Bing


Your example would appear to lengthen the URL for no apparent reason or
benefit (redundant), since a client would already know that
management.my.com is related to management and market.my.com is related to
market.

Whatever method you use might either make both the management and market
directories accessible from either hostname (if both server roots ended at
htdocs), or would require longer redundant system paths
/usr/local/apache/htdocs/management/management and
/usr/local/apache/htdocs/market/market.

One way you could implement the latter (longer pathes) even if you did not
have access to server conf files would to be to put an index.html in the
server root of each virtual server that would use client pull (meta
refresh tag) to redirect to the desired longer URL path. In other words,
/usr/local/apache/htdocs/management/index.html could refresh to
http://management.my.com/mangement/ which would be system path
/usr/local/apache/htdocs/management/mangement/. But do not see what
could be gained by wanting a longer URL (and system path) than necessary.

--
David Efflandt - All spam ignored http://www.de-srv.com/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com