Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程详解
<strong><spanstyle="color:#FF0000;">安装环境</span></strong> 谷歌云实例WindowsServer2016 ApacheApache/2.4.25(win64-VC14) PHPphp-5.6.30(VC11x64ThreadSafe) PERLActivePerl-5.24(Win64) OpenSSLopenssl-1.0.2j-win64 VC14MicrosoftVisualC++2015(vcredist_x64) VC11MicrosoftVisualC++2015(vcredist_x64) <strong><spanstyle="color:#FF0000;">1.安装Apache</span></strong> Apache/2.2不支持php-5.3以后的版本,用最新的Apache/2.4,由于是Win64-VC14版本,需安装x64位版本的VC2015运行库,即VC14 http://httpd.apache.org/download.cgi http://www.apachelounge.com/download/VC14/binaries/httpd-2.4.25-win64-VC14.zip 解压到D:\httpd 修改D:\httpd\conf和D:\httpd\conf\extra目录下的文件,替换C:/apache24到D:/httpd
<spanstyle="color:#FF0000;"><strong>2.安装SSL</strong></span> http://openssl.org https://wiki.openssl.org/index.php/Binaries https://slproweb.com/products/Win32OpenSSL.html 这里使用了Apache/2.4.25自带的openssl,在D:\httpd\bin目录,默认配置文件位于C:/openssl-1.0.2j-win64/ssl/openssl.cnf 用命令建立server.key和server.crt setpath=D:/httpd/bin D: cdD:/httpd/conf/ copyopenssl.cnfopenssl.conf mkdirdemoCA\newcerts echo.>demoCA/index.txt echo.>demoCA/serial opensslgenrsa-outserver.key1024 opensslreq-new-x509-keyserver.key-outserver.crt-days3650-configopenssl.conf 修改D:/httpd/conf/httpd.conf文件,去掉下面两行前面的# #LoadModulessl_modulemodules/mod_ssl.so #Includeconf/extra/httpd-ssl.conf 修改D:/httpd/conf/extra/httpd-ssl.conf文件,注释下面的行 #SSLSessionCache"shmcb:d:/httpd/logs/ssl_scache(512000)" <spanstyle="color:#FF0000;"><strong>3.安装perl</strong></span>
下载后安装时选第三项会自动安装到c:/perl64,无需做其它修改,以后加载.pl文件时,第一行指向#!c:/perl64/bin/perl.exe http://perl.org http://www.activestate.com/activeperl/downloads 修改D:/httpd/conf/httpd.conf文件,去掉下行前面的# #LoadModulecgi_modulemodules/mod_cgi.so <spanstyle="color:#FF0000;"><strong>4.安装php</strong></span>
php有两种版本,ThreadSafe(TS)和NonThreadSafe(NTS),TS用于APACHE,NTS用于IIS
由于VC11x64ThreadSafe需安装x64位版本的VC2012运行库,即VC11,在微软官方网站搜索安装。
http://windows.php.net/download/ http://windows.php.net/downloads/releases/php-5.6.30-Win32-VC11-x64.zip 解压到D:/httpd/php-5.6.30,把php.ini-production改名为php.ini 修改D:/httpd/conf/httpd.conf文件,增加下面的行 LoadModulephp5_module"D:/httpd/php-5.6.30/php5apache2_4.dll" PHPIniDir"d:/httpd/php-5.6.30" AddTypeapplication/x-httpd-php.php.html.htm 如果出现找不到D:/httpd/php-5.6.30/php5apache2_4.dll文件的提示,可能是需要的VC运行库没有安装,或者是apache和php的版本不配。
5.到此配置结束,<spanstyle="color:#FF0000;"><strong>使用下面的命令启动服务</strong></span> httpd-kinstall httpd-kstart 单是httpd-kstart不能启动服务
以上所述是小编给大家介绍的WindowsServer2016上配置APACHE+SSL+PHP+perl的教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!