logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Update SSl
Author
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Thu 16 Dec '10 16:49    Post subject: Update SSl Reply with quote

Hey I'm new to apache and in need of some help getting it running with SSL.

I have brought a wildcard certificate from Comodo, and need to create the CSR, but I’m getting an error when I try to create it.
I have written with Comodo support, and the say I need to be running at least version 0.9.8q of openssl.
And the newest version of apache with openssl in it is only running version 0.9.8o, how do I upgrade the openssl in apache?
Do I just install the win32openssl version 1.0.0c witch is the newest version.
I’m running the server on a windows 2008 r2 server, so is it possible to run 32 bit apache and 64 bit openssl?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Thu 16 Dec '10 17:59    Post subject: Reply with quote

it is not that easy. OpenSSL needs to be compiled into Apache. Simply installing won't help you.
But you can obtain Apache 2.2.17 (32 bit) and the upgrade to OpenSSL 1.0.0c (32 bit) form this page (see Downloads) or grab 64 bit apache 2.2.17 from apachehaus.com with OpenSSL 1.0.0c

I wonder why you shall upgrade to OpenSSL 0.9.8q cause if they talk about SNI that is in OpenSSL since 0.9.8f. But I don't think that it is SNI releated cause Internet Explorer doesn't support SNI only in Windows Vista or newer. That would keep a lot of XP / 2000 user out / leads to certificate errors.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 16 Dec '10 22:15    Post subject: Reply with quote

To just generate a CSR & key, you could use any Windows build of OpenSSL 098q or 100c. I doubt it will matter what OpenSSL you are running on the server once you have you cert in hand. If it does matter, then James has spelled out the Apache alternatives you could use.

I'd even suggest creating the CSR & key on a computer other than the server, I always do. That way there is no worry about mixing versions of openssl on the server.

Once you have your cert, key & ca files you just copy them onto the server, configure & run.
Back to top
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Thu 16 Dec '10 22:53    Post subject: Reply with quote

The error I'm getting is because the openssl can't locate the directory it uses as standard.
This is because it is a directory for Unix and not windows.

I can see that the versions on apachehaus is using Openssl version 1.0.0a how do I upgrade this to the 1.0.0c version?

Is there any advantages of running the 64 bit version or is it better to use the once posted on apache.org?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 16 Dec '10 23:55    Post subject: Reply with quote

that pesky openssl.cnf file, I forgot about it how I don't know.

Two options:

I think that default is usr\local\ssl

If openssl.exe is on the C drive, then C:\usr\local\ssl is the same path. If you created those folders and dropped the openssl.cnf file in there, things will work.

Option 2 using the enviroment. see the last post

http://www.apachelounge.com/viewtopic.php?t=3008
Back to top
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Fri 17 Dec '10 14:55    Post subject: Reply with quote

It worked making the directory on the c drive, so now I was able to create my *.csr and *.key files.
So now I finally could submit the CSR to Comodo!
Thanks for the help, now the next problem is to configure the apache server to run on SSL.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sat 18 Dec '10 23:22    Post subject: Reply with quote

quick example
Code:

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLProtocol all -SSLv2

SSLSessionCache shm:/apache22/logs/ssl_gcache_data
</IfModule>

NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot "C:/apache22/htdocs"
ErrorLog "C:/apache22/logs/ssl.error.log"
TransferLog "C:/apache22/logs/ssl/ssl.access.log"

#Enable/Disable SSL for this virtual host.
SSLEngine on

SSLCertificateFile "C:/apache22/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "C:/apache22/conf/ssl.key/server.key"
SSLCACertificateFile "C:/apache22/conf/ssl/ca.pem"
SSLCertificateChainFile "C:/apache22/conf/ssl/ca-bundle.pem"


SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

<Files ~ "\.(cgi|shtml|phtml|php?)$">
    SSLOptions +StdEnvVars
</Files>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0


SetOutputFilter DEFLATE
DeflateCompressionLevel 9

<Directory "C:/apache22/htdocs">
       Options Indexes FollowSymLinks ExecCGI
        SetEnv PHPRC "C:/php-nts"   
        AddHandler fcgid-script .php
        FCGIWrapper "C:/php-nts/php-cgi.exe" .php


   AllowOverride All
   Order allow,deny
   Allow from all
   Deny from none
   
   <Limit CONNECT>
      Deny from all
   </Limit>

</Directory>
</VirtualHost>


Edit: Added CA cert & bundle
Back to top
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Mon 20 Dec '10 9:26    Post subject: Reply with quote

Thanks, do i need to do this for every one of my subdomains, or is it possible to make most of the settings apply on all subdomains?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Mon 20 Dec '10 11:06    Post subject: Reply with quote

Depends. If all subdomains have the same document root you can use ServerAlias else you have to do that for every subdomain.
Back to top
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Mon 20 Dec '10 12:39    Post subject: Reply with quote

Ok, this i how my virtual hosts look to day, on an apache server not running SSL:

<VirtualHost *>
ServerAdmin email address
DocumentRoot c:/www/directory for every subdomain
ServerName subdomain.domain.dk
</VirtualHost>

Do I need to input that information in the httpd.conf file?

What do i need to do if the server only is to accept https requests?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 20 Dec '10 21:16    Post subject: Reply with quote

Well, he has a wildcard, so regardless of how many subdomain and document roots some things will not change, what doesn't change can easily be moved outside the vhost.

Code:


SSLCertificateFile "C:/apache22/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "C:/apache22/conf/ssl.key/server.key"
SSLCACertificateFile "C:/apache22/conf/ssl/ca.crt"
SSLCertificateChainFile "C:/apache22/conf/ssl/ca-bundle.crt"

SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM

<Files ~ "\.(cgi|shtml|phtml|php?)$">
    SSLOptions +StdEnvVars
</Files>
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

SetOutputFilter DEFLATE
DeflateCompressionLevel 9



This would be fair game for moving outside.
If you end up with a domain or two using a different set of certs, anything you do put inside a VirtualHost will override global setting.

One thing to make sure is in each vhost,
SSLEngine on

IIRC that became a requirement for SNI support, which you'll be using.
Back to top
cliff.ha



Joined: 15 Dec 2010
Posts: 6
Location: Denmark

PostPosted: Tue 21 Dec '10 9:51    Post subject: Reply with quote

Ok, does it matter where i put the code in the httpd.conf file?
I’m not sure witch files I need to set up for the different SSL files, I have these 4 files:
STAR_domain.ca-bundle
STAR_domain.crt
MyServer.key
MyServer.csr
And I do not need to enable any other modules?
Do I need to change the listing port to 443?
Back to top


Reply to topic   Topic: Update SSl View previous topic :: View next topic
Post new topic   Forum Index -> Apache