Virtual Hosting

This is a discussion on Virtual Hosting within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi All I need help with virtual hosting. I looked up the Apache VH page and the cases presented there ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 5 Days Ago
souporpower@gmail.com
 
Posts: n/a
Default Virtual Hosting

Hi All

I need help with virtual hosting. I looked up the Apache VH page and
the cases presented there don't apply to me. So please bear with me.

I have a host that gets accessed in 3 different ways:

domain name: www.testdomain.com
internal DNS: ourproxy
IP: 192.168.10.1

I want to forward a request for the resource ES if the request came
from intranet only, i.e. using internal DNS or IP. That is:

http://ourproxy/ES
http://192.168.10.1/ES

are OK

http://www.testdomain.com/ES

is not OK

I tried:

<VirtualHost ourproxy:80 192.168.10.1:80>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule ^.*$ https://www.testdomain.com/ES [L]

</VirtualHost>

<VirtualHost www.testdomain.com:80>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule http://www.testdomain.com/index.html [L]
</VirtualHost>

<VirtualHost ourproxy:443 192.168.10.1:443>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule ^.*$ https://www.testdomain.com/dostuff [L]

</VirtualHost>

NameVirtualHost ourproxy:80
NameVirtualHost ourproxy:443
NameVirtualHost 192.168.10.1:80
NameVirtualHost 192.168.10.1:443
NameVirtualHost www.testdomain.com:80
NameVirtualHost www.testdomain.com:443

Can someone please tell me what is going wrong here?

Thanks
  #2 (permalink)  
Old 5 Days Ago
Kees Nuyt
 
Posts: n/a
Default Re: Virtual Hosting

On Wed, 7 May 2008 11:43:01 -0700 (PDT),
"souporpower@gmail.com" <souporpower@gmail.com> wrote:

> I looked up the Apache VH page and
>the cases presented there don't apply to me.


Use the example as an exercise until that works.
Then, start adding small changes and see where it
breaks. You will see it applies more to your situation
than you expected.

You only need one or two NameVirtualHost directives.
Not
NameVirtualHost ourproxy:80
but
NameVirtualHost *:80
You may have to repeat for :443

Usually, the name of the virtual host should NOT be in
the
<VirtualHost ....>
block heading itself, but as
ServerName
or
ServerAlias
directives within each
<VirtualHost *:80>
</VirtualHost>
or
<VirtualHost *:443>
</VirtualHost>
block.

HTH
--
( Kees
)
c[_] Seminars, n.: From "semi" and "arse",
hence, any half-assed discussion. (#226)
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0