<strong><span style="color:#FF0000;">安裝環(huán)境</span></strong> 谷歌云實(shí)例 Windows Server 2016 Apache Apache/2.4.25 (win64-VC14) PHP php-5.6.30 (VC11 x64 Thread Safe) PERL ActivePerl-5.24 (Win64) OpenSSL openssl-1.0.2j-win64 VC14 Microsoft Visual C++ 2015(vcredist_x64) VC11 Microsoft Visual C++ 2015(vcredist_x64) <strong><span style="color:#FF0000;">1.安裝 Apache</span></strong> Apache/2.2 不支持php-5.3以后的版本,用最新的 Apache/2.4,由于是Win64-VC14版本,需安裝 x64位版本的 VC2015運(yùn)行庫(kù),即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
<span style="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 目錄 ,默認(rèn)配置文件位于 C:/openssl-1.0.2j-win64/ssl/openssl.cnf 用命令建立 server.key 和 server.crt set path=D:/httpd/bin D: cd D:/httpd/conf/ copy openssl.cnf openssl.conf mkdir demoCA/newcerts echo.>demoCA/index.txt echo.>demoCA/serial openssl genrsa -out server.key 1024 openssl req -new -x509 -key server.key -out server.crt -days 3650 -config openssl.conf 修改 D:/httpd/conf/httpd.conf 文件,去掉下面兩行前面的 # #LoadModule ssl_module modules/mod_ssl.so #Include conf/extra/httpd-ssl.conf 修改 D:/httpd/conf/extra/httpd-ssl.conf 文件,注釋下面的行 #SSLSessionCache "shmcb:d:/httpd/logs/ssl_scache(512000)" <span style="color:#FF0000;"><strong>3.安裝 perl</strong></span>
下載后安裝時(shí)選第三項(xiàng)會(huì)自動(dòng)安裝到 c:/perl64 ,無(wú)需做其它修改,以后加載.pl文件時(shí),第一行指向 #!c:/perl64/bin/perl.exe http://perl.org http://www.activestate.com/activeperl/downloads 修改 D:/httpd/conf/httpd.conf 文件,去掉下行前面的 # #LoadModule cgi_module modules/mod_cgi.so <span style="color:#FF0000;"><strong>4.安裝 php</strong></span>
php 有兩種版本,Thread Safe(TS) 和 Non Thread Safe(NTS) , TS 用于APACHE ,NTS 用于IIS
由于 VC11 x64 Thread Safe 需安裝 x64位版本的 VC2012運(yùn)行庫(kù),即VC11,在微軟官方網(wǎng)站搜索安裝。
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 文件,增加下面的行 LoadModule php5_module "D:/httpd/php-5.6.30/php5apache2_4.dll" PHPIniDir "d:/httpd/php-5.6.30" AddType application/x-httpd-php .php .html .htm 如果出現(xiàn)找不到 D:/httpd/php-5.6.30/php5apache2_4.dll 文件的提示,可能是需要的VC運(yùn)行庫(kù)沒(méi)有安裝,或者是apache和php的版本不配。
5.到此配置結(jié)束,<span style="color:#FF0000;"><strong>使用下面的命令啟動(dòng)服務(wù)</strong></span> httpd -k install httpd -k start 單是 httpd -k start 不能啟動(dòng)服務(wù)
以上所述是小編給大家介紹的Windows Server 2016 上配置 APACHE+SSL+PHP+perl的教程詳解,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)VEVB武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選