Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2+ssl+name virtualhosts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Mon Jul 14, 2003 1:32 pm    Post subject: apache2+ssl+name virtualhosts Reply with quote

apache2+ssl+nameviretualhosts is not supported anymore ?... has anyone figured out a way around this ?

http://httpd.apache.org/docs-2.0/ssl/ssl_faq.html#vhosts


Last edited by col on Tue Jul 15, 2003 7:21 am; edited 1 time in total
Back to top
View user's profile Send private message
revresxunil
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2002
Posts: 129
Location: UW Madison

PostPosted: Mon Jul 14, 2003 9:27 pm    Post subject: Reply with quote

My problem was that I could get either ssl on a default domain and no vhosts, or no ssl and vhosts would work.

The solution was to modify the /etc/apache/conf/modules.d/41...ssl...conf and change the _default_:443 to *:443

Otherwise, if you would like to make vhosts more usable, just use my following config as an example.

First move the modules.d/41...ssl..default.conf and add a .bak to the end of it so its not loaded. Then make an ssl.conf in there and put the following:

Code:

<IfDefine SSL>
  <IfModule !mod_ssl.c>
    LoadModule ssl_module    extramodules/mod_ssl.so
  </IfModule>
</IfDefine>


That should get ssl going if you put the -D SSL flag in apache2.conf.

Now, move all that jibberish from the default ssl config to the vhosts.conf.

My vhosts.conf looks like this:

Code:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName revresxunil.cmforums.net
    ServerPath /htdocs
    DocumentRoot /home/httpd/htdocs
    ServerAdmin root@localhost
</VirtualHost>

<VirtualHost *:80>
    ServerName forums.cmforums.net
    ServerPath /forums
    DocumentRoot /home/httpd/forums
    ServerAdmin root@localhost
</VirtualHost>

<IfModule mod_ssl.c>

<VirtualHost *:443>
    DocumentRoot "/home/httpd/secure"
    #ServerName localhost:443
    #ServerAdmin root@localhost
    ErrorLog logs/ssl_error_log

    <IfModule mod_log_config.c>
      TransferLog logs/ssl_access_log
    </IfModule>

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile conf/ssl/server.crt
    SSLCertificateKeyFile conf/ssl/server.key

    <Files ~ "\.(cgi|shtml|phtml|php?)$">
      SSLOptions +StdEnvVars
    </Files>

    <Directory "/home/httpd/cgi-bin">
      SSLOptions +StdEnvVars
    </Directory>

    <IfModule mod_setenvif.c>
      SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \
      downgrade-1.0 force-response-1.0
    </IfModule>

    <IfModule mod_log_config.c>
      CustomLog logs/ssl_request_log \
      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    </IfModule>

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteOptions inherit
    </IfModule>
</VirtualHost>
</IfModule>


Now, inside the IfModule for ssl, just put in whatever crap you had before for your vhost that needs ssl encryption. Hope thats what you were looking for!!
Back to top
View user's profile Send private message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Tue Jul 15, 2003 12:08 am    Post subject: Reply with quote

It turns out it didnt like my vhosts.conf from apache 1.3 .... I had:

Code:

<VirtualHost 192.168.0.1>

With this in my vhosts SSL vhost did not work but changing it to :
Code:

<VirtualHost *:80>


fixed the problem
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum