views:

1164

answers:

2

I'm trying to access a Active Directory from my local webserver. To do this I'm using the latest version of xampp and a PHP script called adLDAP. If I understand things right, I need to enable SSL to access https URLs. I've tried to google it but with no luck :( Could anyone link a tutorial or explain to me how to install SSL on xampp/apache for windows 7 64bit? Any help would be appreciated :)

+1  A: 

Apache part - enabling you to open https://localhost/xyz

There is the config file xampp/apache/conf/extra/httpd-ssl.conf which contains all the ssl specific configuration. It's fairly well documented, so have a read of the comments and take look at http://httpd.apache.org/docs/2.2/ssl/. The files starts with <IfModule ssl_module>, so it only has an effect if the apache has been started with its mod_ssl module.

Open the file xampp/apache/conf/httpd.conf in an editor and search for the line

#LoadModule ssl_module modules/mod_ssl.so

remove the hashmark, save the file and re-start the apache. The webserver should now start with xampp's basic/default ssl confguration; good enough for testing but you might want to read up a bit more about mod_ssl in the apache documentation.


PHP part - enabling adldap to use ldap over ssl

adldap needs php's openssl extension to use "ldap over ssl" connections. The openssl extension ships as a dll with xampp. You must "tell" php to load this dll, e.g. by having an extension=nameofmodule.dll in your php.ini
Run

echo 'ini: ', get_cfg_var('cfg_file_path');

It should show you which ini file your php installation uses (may differ between the php-apache-module and the php-cli version).
Open this file in an editor and search for

;extension=php_openssl.dll

remove the semicolon, save the file and re-start the apache.

see also: http://docs.php.net/install.windows.extensions

VolkerK
the echo line gives this answer: C:\xampp\php\php.inibut there is no ;extension=php_openssl.dll in this file. I checked the \php\ext folder aswell and there is no php_openssl.dll :\
cvack
Which version of xampp do you use?
VolkerK
Not sure if this info is helpfull, but:phpinfo()[openssl]OpenSSL support: enabled -OpenSSL Library Version: OpenSSL 0.9.8l 5 Nov 2009 - OpenSSL Header Version: OpenSSL 0.9.8l 5 Nov 2009 [Phar]...Native OpenSSL support: enabled [PHP Variables]..._SERVER["OPENSSL_CONF"] C:/xampp/apache/bin/openssl.cnf --wow, this comment was messy :S wtb linebreak
cvack
I'm using XAMPP version 1.7.3
cvack
ok, then php_openssl is already enabled. Take a look at the first part of the revised answer.
VolkerK
Thanks alot for your help so far. I will get back to you when I've done some testing :)
cvack
stupid question: openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt <- where do i type this command? tried cmd and openssl.exe :S
cvack
There's a openssl.exe in xampp/apache/bin. And there's most likely a question (or two) related to how to create certificates under win32 either here on stackoverflow or on http://serverfault.com
VolkerK
o m g. Looks like https worked when i reinstalled xampp and used the default htdocs folder. :P
cvack
A: 

did you have any luck with adLDAP....im also trying to make adLDAP work with windows server 2008....if you were successful in making in work can you please email me at fkada [AT] hotmail [DOT] com

fek