Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been trying to learn how to set up SSL with apache 2.0 on Windows with mod_ssl, I made sure the mod_ssl.so file is in the module directory and the configuration file is included in the conf directory (httpd-ssl.conf), enabled the module by un-commenting the LoadModule option for mod_ssl.so.

I created a self signed certificate and placed both the crt file and key file in the conf directory.

The information on my ssl config file looks as follows:

<VirtualHost _default_:443>
ServerAdmin some@email.com
DocumentRoot "D:/Dev-Ops/apache/Apache2/htdocs/secure/"
ServerName localhost:443
ServerAlias localhost:443
SSLEngine on
SSLEnable
SSLCertificateFile "D:/Dev-Ops/apache/Apache2/conf/server.cert"
SSLCertificate "D:/Dev-Ops/apache/Apache2/conf/server.key"
</VirtualHost>

I am sure I might be doing something wrong here (I am a newbie to Apache and all these things). Currently I get an error saying:

Syntax error on line 8 of D:/Dev-Ops/apache/Apache2/conf/httpd-ssl.conf: Invalid command 'SSLEnable', perhaps mis-spelled or defined by a module not included in the server configuration

My questions are :

  1. Do I have to have OpenSSL installed (I already have it installed) on my computer in-order for mod_ssl to work ? If so is there something I need to configure to make sure they both communicate to each other ?

  2. What is wrong with the above VirtualHost configuration ? and what can I do to get it right?

  3. Does every version of apache has to have a specific version of mod_ssl? if so where can I get the binary mod_ssl.so file to download from (it is pretty hectic to find this tiny file! or is me looking at the wrong places!), if it does have to have a specific version of mod_ssl, what would be the best version for Apache 2.0?

  4. What is causing the error that I mentioned above ? (I made sure my files are in the right place all the configuration directives are enabled, etc.).

  5. Please can you suggest a good place/book/link for me to start learning more about apache web server and its various applications in production environments?

Please can someone help me soon? All your help will be very much appreciated.

UPDATE

I stripped out the virtual host to the following:

<VirtualHost _default_:443> 
DocumentRoot "D:/Dev-Ops/apache/Apache2/htdocs/secure/"
SSLCertificateFile "D:/Dev-Ops/apache/Apache2/conf/server.cert"
SSLCACertificatePath "D:/Dev-Ops/apache/Apache2/conf/"
</VirtualHost>

and I get the following error displayed on browser:

enter image description here

When I try the same with the following configuration directives (With SSLEngine on)

<VirtualHost _default_:443> 
DocumentRoot "D:/Dev-Ops/apache/Apache2/htdocs/secure/"
SSLEngine on
SSLCertificateFile "D:/Dev-Ops/apache/Apache2/conf/server.cert"
SSLCACertificatePath "D:/Dev-Ops/apache/Apache2/conf/"
</VirtualHost>

I am getting the following error at the error.log file:

[error] Init: SSLPassPhraseDialog builtin is not supported on Win32 (key file D:/Dev-Ops/apache/Apache2/conf/server.cert)

I have done fair bit of research on removing the pass-phrase and regenerating certificate, replacing the existing one with thee newly produced one; however that doesn't seem to do the trick for me! I am beginning to wonder whether it is the version of my mod-ssl that is the problem (how can/where can I find whether it is compatible with the version of my apache! and if it is not compatible where can I obtain the .so file to get things right!)

Please can someone explain this to me? and help me resolve this issue!

share|improve this question
    
Apache 2.0? That's ancient... Try using something a bit more up-to-date. And I don't think that there is any such directive as SSLEnable. –  Michael Hampton Dec 25 '13 at 17:45
    
I know it is ancient; however I have to work with it, my organisation uses it for production servers.. –  user2986175 Dec 26 '13 at 5:07
    
I hope you have a migration plan to get rid of them as soon as possible. Whatever you're doing now is mostly pointless, since keeping Apache 2.0 is very high risk. –  Michael Hampton Dec 26 '13 at 5:17
add comment

2 Answers

up vote 0 down vote accepted

Do I have to have OpenSSL installed (I already have it installed) on my computer in-order for mod_ssl to work ? If so is there something I need to configure to make sure they both communicate to each other ?

Depends how you installed it. You should be using the MSI that ends with -win32-x86-openssl, that should have everything you need.

What is wrong with the above VirtualHost configuration ? and what can I do to get it right?

Remove SSLEnable, it's not a valid directive.

Does every version of apache has to have a specific version of mod_ssl? if so where can I get the binary mod_ssl.so file to download from (it is pretty hectic to find this tiny file! or is me looking at the wrong places!), if it does have to have a specific version of mod_ssl, what would be the best version for Apache 2.0?

See the answer to your first question, sounds like you need to install from the correct MSI; the .so file does not include all you need to get a working SSL setup.

What is causing the error that I mentioned above ? (I made sure my files are in the right place all the configuration directives are enabled, etc.).

See answer to second question.

Please can you suggest a good place/book/link for me to start learning more about apache web server and its various applications in production environments?

The documentation is a good place to start, digging through here can be a good resource, and there's a ton of howto documents around the internet.

share|improve this answer
    
I have a 64bit version of OpenSSL installed, I tried removing SSLEnable, which now comes up with the following error: Syntax error on line 9 of D:/Dev-Ops/apache/Apache2/conf/httpd-ssl.conf: Invalid command 'SSLCertificate', perhaps mis-spelled or defined by a module not included in the server configuration –  user2986175 Dec 25 '13 at 18:28
    
I think I am doing something seriously wrong here, let me try re-installing open ssl and finding a more suitable mod_ssl.so file! I can't believe how hard it is to find such information in an easy to understand format. Even finding a download of mod_ssl.so file is not that easy (or may be it is my stupidity!) –  user2986175 Dec 25 '13 at 18:30
    
@user2986175 How did you install Apache? You should be using the installer package that includes OpenSSL and all the needed library files. –  Shane Madden Dec 25 '13 at 22:22
add comment

You should read the mod_ssl documentation. You'll see that there's no directive SSLEnable there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.