Re: virtual host problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joshua,
 
I am now able to protect my virtual host by using Forbidden page, words cannot express my appreciation. You're a great help to me! Thanks a lot to you!
 
James

Joshua Slive <joshua@xxxxxxxx> wrote:
On 7/18/07, Min-Hua Luo wrote:
> Hi,
>
> I have two virtual hosts defined in httpd.conf
>
> Listen 12311
> NameVirtualHost *:12311
>
> ServerName twpdev.ora.fda.gov
> DocumentRoot /u07/twpdev
> ServerAdmin james.luo@xxxxxxxxxxx
> ErrorLog /u07/twpdev_error_log
>

>
>
>
> Listen 12312
> NameVirtualHost *:12312
>
> ServerName oasisdev.ora.fda.gov
> DocumentRoot /u07/oasis
> ServerAdmin james.luo@xxxxxxxxxxx
> ErrorLog /u07/oasis_error_log
>

>
>
> I can access the first site using http://twpdev.ora.fda.gov:12311. However,
> I found I can also access the same page using
> http://oasisdev.ora.fda.gov:12311 because both
> "twpdev.ora.fda.gov" and "oasisdev.ora.fda.gov" resolve to the same IP.
>
> This is NOT what I want. So my question is:
>
> How can I configure httpd.conf so port 12311 only respond to HTTP requests
> that address to "twpdev.ora.fda.gov" instead of any hostnames that point to
> the same IP address? Thank you very much.

You can't, because the hostname isn't known until after the server has
already accepted the request. But you can easily redirect such
requests to a different hostname:
http://wiki.apache.org/httpd/CanonicalHostNames
or you can return a 403 forbidden error:
http://wiki.apache.org/httpd/ProxyAbuse#head-a178a450101a75a8e474cd2b0a929563275b0c84

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
" from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



Shape Yahoo! in your own image. Join our Network Research Panel today!
[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux