You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andrew Hole <an...@gmail.com> on 2009/03/25 15:46:52 UTC

[users@httpd] VirtualHost doesn't work

Hello,



We’ve been facing a problem with apache + ssl configuration. This is our
virtual host configuration:



NameVirtualHost 10.202.6.132:80

NameVirtualHost 10.202.6.132:443



#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#



<VirtualHost _default_:80>

    DocumentRoot     "C:/Formacao/Flash/apps/entrance/"

    RewriteEngine on

    RewriteRule   ^/$  /index.html  [R]

</VirtualHost>



<VirtualHost 10.202.6.132:80>



    ServerAdmin support@alert.pt

    ServerName p1-formacao.pt

    DocumentRoot "C:/Formacao/Flash/apps/"



    ErrorLog logs/training_error.log

    LogLevel error



    CustomLog logs/training_request_%Y%m%d.log "%v %t %h %{SSL_PROTOCOL}x
%{SSL_CIPHER}x \"%r\" %b %T"



    RewriteEngine on

    RewriteRule   ^/$  /entrance/webloader_remoto.html  [R]



    JkMount /gateway                 ctht

    JkMount /DocUpload             ctht

    JkMount /DbImages              ctht

    JkMount /ReportP1                ctht

    JkMount /ResumoP1             p1t

    JkMount /interalert/*   interalertt

    JkMount /url/*                        urlt



    <Location /DbImages>

            Header unset "Expires"

            Header unset "Pragma"

    </Location>



</VirtualHost>



<VirtualHost _default_:443>

    DocumentRoot "C:/Flash/apps/"

    ErrorLog logs/ssl_default_error.log

    LogLevel debug



    RewriteEngine on

    RewriteRule   ^/$  /entrance/index.html  [R]

    CustomLog logs/ssl_default_request_%Y%m%d.log "%t %h %{SSL_PROTOCOL}x
%{SSL_CIPHER}x \"%r\" %b %T"

</VirtualHost>



<VirtualHost 10.202.6.132:443>



    ServerName p1-preproducao.pt

    DocumentRoot "C:/Flash/apps/"



    ErrorLog logs/ssl_error.log

    LogLevel error



    CustomLog logs/ssl_request_%Y%m%d.log "%t %h %{SSL_PROTOCOL}x
%{SSL_CIPHER}x \"%r\" %b %T"





    SSLEngine on

    SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL



    SSLCertificateFile  "C:/Program Files/Apache Software
Foundation/Apache2.2/conf/ssl.p1-preproducao/p1-preproducao.pt.crt"

    SSLCertificateKeyFile  "C:/Program Files/Apache Software
Foundation/Apache2.2/conf/ssl.p1-preproducao/p1-preproducao.pt.key"

    SSLCertificateChainFile  "C:/Program Files/Apache Software
Foundation/Apache2.2/conf/ssl.p1-preproducao/p1-preproducao.pt.ca"



    RewriteEngine on

    RewriteRule   ^/$  /entrance/webloader_remoto.html  [R]



    JkMount /gateway                 cthpp

    JkMount /DocUpload             cthpp

    JkMount /DbImages              cthpp

    JkMount /ReportP1                cthpp

    JkMount /ResumoP1             p1PP

    JkMount /interalert/*   interalertpp

    JkMount /url/*                        urlpp



    <Location /DbImages>

            Header unset "Expires"

            Header unset "Pragma"

    </Location>



</VirtualHost>





Both the url’s are resolved to the same ip address: 10.202.6.132



When we access the url https://p1-preproducao.pt it works fine and open the
application. When we access
http*s*://p1-formacao.pt<https://p1-formacao.pt/>it also works (and it
shouldn’t). It should enter the default Vhost:443 and
be redirected to index.html file. Any https request is entering to the
second 443 vhost, ignoring the ServerName directive.



Do you have any idea of what could be happening?



Thanks in advance for any cooperation.

Re: [users@httpd] VirtualHost doesn't work

Posted by Eric Covener <co...@gmail.com>.
On Wed, Mar 25, 2009 at 10:46 AM, Andrew Hole
<an...@gmail.com> wrote:

> When we access the url https://p1-preproducao.pt it works fine and open the
> application. When we access https://p1-formacao.pt it also works (and it
> shouldn’t). It should enter the default Vhost:443 and be redirected to
> index.html file. Any https request is entering to the second 443 vhost,
> ignoring the ServerName directive.

That vhost is a better IP-based match, no name-based vhost matching is
done for the SSL handshake.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org