On 15 Aug 00, Dana Powers wrote:

> This is an extension of the SSL name based virtual host problem. I
> posted a long explanation of SSL virtual host resolution earlier, but
> the simple answer is - if you try to access port 80 - you'll get your
> http (1st VirtualHost) environment, and if you try to access port 443 -
> you'll get your https (2nd VirtualHost) environment. This is because
> Virtual Hosts are setup based on IP+Port. Think of it as 2 separate
> Virtual Host groups - if you just had 1 Virtual Host, you could still
> access that virtual host with an ip address, or a fake /etc/hosts entry
> or a different dns CNAME or A record - all of these would still put you
> in the documentroot of your 1 virtualhost entry. I dont have a good
> suggestion for getting your desired behaviour right now, I'll have to
> think about it for a bit.
> 
> Dana
> 

> On Mon, 14 Aug 2000, Plamen Gribachev wrote:
> > Hi!
> > Try with :
> > NameVirtualHost 111.22.33.44
> >  in Section1 Global Environment of httpd.conf 
> > Plamen
> > 

Thanks, Dana - I'd appreciate it if you'd let me know if you have an 
idea on how to do this. FWIW I'm surprised the Apache docs don't go 
into this - at least I couldn't find anything. 

Based on Plamen's suggestion (thanks, Plamen) I dug out & re-read the 
virtual hosts section of O'Reilly's "Apache: The Definitive Guide" (2nd 
ed) book by the Lauries. They mention use of the 'NameVirtualHost' 
directive & suggest it might be important in controlling access to 
servers under an alternate name. I hadn't been using this directive, so 
I tried it - but the results were identical to what I saw without it; 
i.e.:

https://name1.mydom.com/  ---> index.html file from namessl's doc root
http://namessl.mydom.com/ ---> index.html file from name1's doc root

The directives I added were:

NameVirtualHost 111.22.33.44:80
NameVirtualHost 111.22.33.44:443

I don't understand what these directives are supposed to do...

Finally, correct me if I'm wrong, but wouldn't IP-based virtual hosts 
eliminate this problem? Maybe that's the best solution for me since 
I've got a few "extras".

Thanks Again,
James Moore

> > > For the http server:
> > > 
> > > <VirtualHost 111.22.33.44:80>
> > >  DocumentRoot /home/webfoot/public_html
> > >  ServerName name1.mydom.com
> > >  ScriptAlias /cgi-bin/ "/home/webfoot/cgi-bin/"
> > >  <Directory "/home/webfoot/cgi-bin">
> > >   ...
> > >  </Directory>
> > > </VirtualHost>
> > > 
> > > For the https server:
> > > 
> > > <VirtualHost 111.22.33.44:443>
> > >  DocumentRoot /home/webfoot/secure_html
> > >  ServerName namessl.mydom.com
> > >  ScriptAlias /cgi-ssl/ "/home/webfoot/cgi-ssl/"
> > >  <Directory "/home/webfoot/cgi-ssl">
> > >   ...
> > >  </Directory>
> > >  ...
> > > </VirtualHost>
> > > 

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to