logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Virtual Host and directory control
Author
sehk



Joined: 05 Nov 2010
Posts: 2

PostPosted: Fri 05 Nov '10 9:34    Post subject: Virtual Host and directory control Reply with quote

Hi,

I am just starting to setup the apache, please bear me.

i have successfully create 2 SSL virtual host with same ip but different ports.

e.g.
Vhost 1: dummy-host.localhost Port: 443, directory: c:\A
Vhost 2: dummy-host2.localhost Port: 90833, directory: c:\B

Actually, i can sucessfull go to the desire directory using
dummy-host.localhost:443, and https://dummy-host2.localhost:90833

but the wired things is i also can c:\B when i type https://dummy-host.localhost:90833.

I suppose only https://dummy-host.localhost:443 can go to c:\A
and only https://dummy-host2.localhost:90833 can go to c:\B

I have attached the httpd-vhosts.conf. please anyone can help out. Thanks

Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:443
SSLStrictSNIVHostCheck off
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:443>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
    ServerName dummy-host.localhost
    ServerAlias www.dummy-host.localhost
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" common
   SSLEngine on
    SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server.crt"
    SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server.key"
</VirtualHost>

<VirtualHost *:90833>
    ServerAdmin webmaster@dummy-host2.localhost
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
    ServerName dummy-host2.localhost
    ServerAlias www.dummy-host2.localhost
    ErrorLog "logs/dummy-host2.localhost-error.log"
    CustomLog "logs/dummy-host2.localhost-access.log" common
   SSLEngine on
    SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server2.crt"
    SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server2.key"
</VirtualHost>
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 05 Nov '10 20:11    Post subject: Reply with quote

In your config you didn't define a NameVirtualHost *:90833 . Did you define a Listen 90833?


Eek! The highest port can be 65535. So 90833 will never work Wink
Back to top
sehk



Joined: 05 Nov 2010
Posts: 2

PostPosted: Sun 07 Nov '10 16:40    Post subject: Reply with quote

Thanks for reply.

It should be some mistakes when i am pasting , the port should be 9083.

Actually i have define listen 9083 in the etc\http-ssl.conf.

and everythings got fine, instead dummy-host.localhost:9083 and dummy-host2.localhost:9083 can go to the files in C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost.

I expect only the dummy-host2.localhost:9083 can do this only.

maybe i have set something wrong, hope can have some guidance.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 08 Nov '10 14:58    Post subject: Reply with quote

I'm not fully sure. But I think that it is the SNI Problem. The problem with using named virtual hosts over SSL is that named virtual hosts rely on knowing what hostname is being requested, and the request can't be read until the SSL connection is established. The ordinary behavior, then, is that the SSL connection is set up using the configuration in the default virtual host for the address where the connection was received.

Also your browser need to support this.
Back to top


Reply to topic   Topic: Virtual Host and directory control View previous topic :: View next topic
Post new topic   Forum Index -> Apache