在本地 xampp/apache 服务器上设置 SSL [英] Setting up SSL on a local xampp/apache server

查看:38
本文介绍了在本地 xampp/apache 服务器上设置 SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从本地网络服务器访问 Active Directory.为此,我使用了最新版本的 xampp 和一个名为 adLDAP 的 PHP 脚本.如果我理解正确,我需要启用 SSL 才能访问 https URL.我试过谷歌它,但没有运气:(谁能链接教程或向我解释如何在 xampp/apache 上为 windows 7 64bit 安装 SSL?任何帮助将不胜感激:)

解决方案

Apache 部分 - 使您能够打开 https://localhost/xyz

配置文件 xampp/apache/conf/extra/httpd-ssl.conf 包含所有 ssl 特定配置.它有很好的文档记录,因此请阅读评论并查看 http://httpd.apache.org/docs/2.2/ssl/.这些文件以 开头,所以只有当 apache 已经用它的 mod_ssl 模块启动时它才有效.

在编辑器中打开文件 xampp/apache/conf/httpd.conf 并搜索该行

#LoadModule ssl_module modules/mod_ssl.so

删除hashmark,保存文件并重新启动apache.网络服务器现在应该从 xampp 的基本/默认 ssl 配置开始;足以进行测试,但您可能想在 apache 文档中阅读更多有关 mod_ssl 的内容.

<小时>

PHP 部分 - 使 adldap 能够使用 ldap over ssl

adldap 需要 php 的 openssl 扩展来使用ldap over ssl"连接.openssl 扩展作为带有 xampp 的 dll 提供.您必须告诉"php 加载此 dll,例如通过在你的 php.ini
中有一个 extension=nameofmodule.dll运行

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

它应该会显示您的 php 安装使用哪个 ini 文件(可能在 php-apache-module 和 php-cli 版本之间有所不同).
在编辑器中打开此文件并搜索

;extension=php_openssl.dll

去掉分号,保存文件,重启apache.

另见:http://docs.php.net/install.windows.extensions

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 :)

解决方案

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

这篇关于在本地 xampp/apache 服务器上设置 SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆