Bluehost.com Web Hosting $6.95

Apache 2,ssl & virtual host

This is a discussion on Apache 2,ssl & virtual host within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi! Anyone does know or have an example of virtual host and ssl ? Now i have several domains working on ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-06-2005
Erri
 
Posts: n/a
Default Apache 2,ssl & virtual host

Hi!
Anyone does know or have an example of virtual host and ssl ?
Now i have several domains working on apache 2.0.53 and i need one of this
works with ssl. I'm making test, but it doesn't works.
In httpd.conf i have following lines:
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
NameVirtualHost 172.168.0.3:80
NameVirtualHost 172.168.0.3:443
<VirtualHost 172.168.0.3:80>
ServerAdmin root@dominio1.com
DocumentRoot /web/htdocs
ServerName dominio1.com
ServerAlias www.dominio1.com
</VirtualHost>
<VirtualHost 172.168.0.3:80>
ServerAdmin root@dominio2.com
DocumentRoot /web2/htdocs
ServerName dominio2.com
ServerAlias www.dominio2.com
</VirtualHost>

And in ssl.conf i have virtual host with ssl:

SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
Listen 443
SSLPassPhraseDialog builtin
SSLSessionCache dbm:/usr/local/apache2/logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/apache2/logs/ssl_mutex
<IfDefine SSL>
<VirtualHost 172.168.0.3:443>
ServerAdmin root@dominio3.com
DocumentRoot /web3/htdocs/
ServerName www.dominio3.com
SSLEngine on
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSL v2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml|phtml|php3?|php)$">
SSLOptions +StdEnvVars
</Files>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache2/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>

What's wrong?

Thanks.


  #2 (permalink)  
Old 04-06-2005
Jorey Bump
 
Posts: n/a
Default Re: Apache 2,ssl & virtual host

"Erri" <erricharl@hotmail.com> wrote in
news:cGE4e.672554$q7.835820@telenews.teleline.es:

> Now i have several domains working on apache 2.0.53 and i need one of
> this works with ssl. I'm making test, but it doesn't works.


"it doesn't works" is a bit vague.

How did you start apache?
After starting apache, is it listening on port 443?
If it's listening on port 443, did you create certificates?
If you created certificates, what do the logs say when you try to connect?

Apache logging is excellent. Always look there first when you have a
problem.


  #3 (permalink)  
Old 04-06-2005
Erri
 
Posts: n/a
Default Re: Apache 2,ssl & virtual host

Jorey Bump escribió:
> "Erri" <erricharl@hotmail.com> wrote in
> news:cGE4e.672554$q7.835820@telenews.teleline.es:
>
>>Now i have several domains working on apache 2.0.53 and i need one of
>>this works with ssl. I'm making test, but it doesn't works.

>
> "it doesn't works" is a bit vague.
>
> How did you start apache?
> After starting apache, is it listening on port 443?
> If it's listening on port 443, did you create certificates?
> If you created certificates, what do the logs say when you try to connect?
>
> Apache logging is excellent. Always look there first when you have a
> problem.
>
>

Sorry you have reason. Now it works for me, but i have a little problem.
If i type http://dominio3.com (domain working with ssl 443 port) i see
my default virtual host(http://dominio1.com). If i type
https://dominio3.com all go fine.
How do i can all traffic to domain3.com go to 443 port ?

Thanks.
  #4 (permalink)  
Old 04-06-2005
Jorey Bump
 
Posts: n/a
Default Re: Apache 2,ssl & virtual host

Erri <jperezme@mi.madritel.es> wrote in
news:C7V4e.697907$q7.856997@telenews.teleline.es:

> Sorry you have reason. Now it works for me, but i have a little
> problem. If i type http://dominio3.com (domain working with ssl 443
> port) i see my default virtual host(http://dominio1.com). If i type
> https://dominio3.com all go fine.
> How do i can all traffic to domain3.com go to 443 port ?


<VirtualHost 172.168.0.3:80>
ServerAdmin root@dominio3.com
ServerName dominio3.com
ServerAlias www.dominio3.com
Redirect / https://www.dominio3.com/
</VirtualHost>

It's a completely different site, so you can point it to any DocumentRoot
you want. It can even share the same DocumentRoot as the SSL dominio3.com
virtual host, as long as you redirect sensitive locations.

For example, if both hosts for dominio3.com share a DocumentRoot, but you
have a directory that should always be accessed via SSL, you could do this:

<VirtualHost 172.168.0.3:80>
ServerAdmin root@dominio3.com
DocumentRoot /web3/htdocs
ServerName dominio3.com
ServerAlias www.dominio3.com
Redirect /secure https://www.dominio3.com/secure
</VirtualHost>

  #5 (permalink)  
Old 04-07-2005
Erri
 
Posts: n/a
Default Re: Apache 2,ssl & virtual host

Ok Jorey.
It works perfectly now.
Thanks a lot.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 07:39 PM.


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