[olug] apache w/ mod_ssl, http on 80 and https on 443?

Daniel Pfile daniel at pfile.net
Sun Sep 28 03:51:28 UTC 2003


Brian Wiese wrote:

> is that possible?  I'm having the darnest config with apache w/ mod_ssl...
> it seems SSL is an all or nothing game.  Can one configure a regular
> apache server to listen to both HTTP on port 80 and HTTPS on port 443 at
> the same time?
> 
> Doesn't eem so for me, don't know why... here's some sample config... any
> ideas?  Do I need to run 2 seperate apache servers, one to listen HTTP on
> port 80 and one to listen HTTPS on port 443?
> 
> Thanks... (I've had this problem before, but got annoyed at running 2
> apaches I guess)
> 

Wrap your generic ssl config stuff in an <ifmodule mod_ssl.c>. Stuff 
like session cache, mutex, seeds, passphrase dialog, etc. Then create a 
virtualhost for ssl. You can run it on the same IP you use for the main 
server. Something like:

<Virtualhost your.ip.addy:443>
# normal vhost type stuff, if you want it, read the docs.
SSLEngine On
SSLCertificateFile    /path/to/ssl.crt/server.crt
SSLCertificateKeyFile /path/to/ssl.key/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

Hope that gets you pointed in the right direction. Read apache's docs, 
they're pretty good.

-- Daniel





More information about the OLUG mailing list