Forum Moderators: phranque

Message Too Old, No Replies

Apache 2.2 and SSL on Windows

A couple of tips to get you started

         

coopster

2:24 am on Apr 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I just did a recent Windows Apache 2.2 install with SSL and ran into some issues. I thought I would post them here for others that may hit a wall. It'll save you a few hours of research ;)

The Apache installation will by default ask if you want to install into this path:

C:\Program Files\Apache Software Foundation\Apache2.2

That's fine. Just note that there are spaces in the path. Therefore, everywhere you use it in your configuration file (httpd.conf) you are going to have to enclose it in double quotation marks. Apache takes care of this for you in the default httpd.conf. But, not so in the httpd-ssl.conf. So make sure you get those double quotation marks in there!

Next, trying to create the certificates for SSL caused more problems. By default the binary executable

C:\Program Files\Apache Software Foundation\Apache2.2\bin\openssl.exe

wants to use a "default" location for the "openssl.conf" configuration file that it needs to create certificates. Well, it does indeed come with the base installation, but it is named "openssl.cnf" and Windows automatically "removes" the extension, even if you have your OS set to show extensions, and believes that it is some type of dialer program!

Here are the rest of my notes, hopefully they make sense and help you over the hump on your next install ...

In the Apache SSL default install, Windows automatically converts or makes the
"openssl.cnf" file some type of dialer program! I had to open it with a text editor
and do a "File - Save As ..." and saved it as "openssl.conf" so I could use it to
make the server certs. Use the "-config" switch of the "openssl.exe" command to
tell openssl where the configuration file exists! Wow, what a pain this was!

Then I ran this command to generate the necessary files:
========================================================
========================================================
========================================================

C:\Program Files\Apache Software Foundation\Apache2.2\bin>openssl req -config openssl.conf -new -x509 -nodes -out myCertName.crt -keyout myKeyName.key

========================================================
========================================================
========================================================

Now place the .crt and .key files into the proper directory (I just plopped 'em into the "conf").
Edit your "ssl.conf" to point to the proper path/files (do not forget to place double quotes
around any configuration directives that contain filepaths with spaces in them! The Apache
install, by default, does not do that in the "extra" conf files, not the "ssl.conf" at least!)

g1smd

8:56 pm on Apr 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am putzing around with Apache 2.2 installed on Vista for development purposes.

That too was a complete pain to get running.

I still haven't found a way to be able to open, edit, and then save the httpd.conf file without first running Wordpad as an Administrator, and then browsing to the file itself. I would much prefer to be able to click on the httpd.conf file itself and then use Send To to simply send it to Wordpad for editing. That bit works, but then I can't save the file. Access is denied.

coopster

3:11 am on Apr 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Can't help much on that issue, g1smd, I'm not running Vista yet. And by the looks of it, good thing ;)

Keep us posted as to the issue and resolution if you can. Thanks.