Windows Server 2016 Configuration APACHE+SSL+PHP+perl tutorial details
- 2020-06-03 08:55:46
- OfStack
<strong><span style="color:#FF0000;"> Installation environment </span></strong>
Google cloud instance 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. The installation Apache</span></strong>
Apache/2.2 Does not support php-5.3 Later versions, use the latest Apache/2.4 , because it is Win64-VC14 Version, to be installed x64 A version of the VC2015 Runtime, i.e VC14
http://httpd.apache.org/download.cgi
http://www.apachelounge.com/download/VC14/binaries/httpd-2.4.25-win64-VC14.zip
unzip D:\httpd
Modify the D:\httpd\conf and D:\httpd\conf\extra Directory of files, replace C:/apache24 to D:/httpd
<span style="color:#FF0000;"><strong>2. The installation SSL</strong></span>
http://openssl.org
https://wiki.openssl.org/index.php/Binaries
https://slproweb.com/products/Win32OpenSSL.html
Here we use Apache/2.4.25 built-in openssl In the D:\httpd\bin directory , the default configuration file is located at C:/openssl-1.0.2j-win64/ssl/openssl.cnf
Set up by command server.key and 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
Modify the D:/httpd/conf/httpd.conf File, remove the following two lines in front #
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd-ssl.conf
Modify the D:/httpd/conf/extra/httpd-ssl.conf File, comment the lines below
#SSLSessionCache "shmcb:d:/httpd/logs/ssl_scache(512000)"
<span style="color:#FF0000;"><strong>3. The installation perl</strong></span>
After downloading and installing select the control 3 Items are automatically installed to c:/perl64 , no other modifications are needed, and will be loaded later .pl File when the 1 Line to #!c:/perl64/bin/perl.exe
http://perl.org
http://www.activestate.com/activeperl/downloads
Modify the D:/httpd/conf/httpd.conf File, remove the one before the downlink #
#LoadModule cgi_module modules/mod_cgi.so
<span style="color:#FF0000;"><strong>4. The installation php</strong></span>
There are two versions of php, Thread Safe(TS) and Non Thread Safe(NTS), TS for APACHE and NTS for IIS
Since VC11 x64 Thread Safe requires the installation of the x64-bit version of the VC2012 runtime, VC11, search for the installation on Microsoft's official website.
http://windows.php.net/download/
http://windows.php.net/downloads/releases/php-5.6.30-Win32-VC11-x64.zip
unzip D:/httpd/php-5.6.30 , php.ini-production renamed php.ini
Modify the D:/httpd/conf/httpd.conf File, add the following line
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
If it appears and cannot be found D:/httpd/php-5.6.30/php5apache2_4.dll File prompts may be required VC The runtime is not installed, or is apache and php "Does not match.
5. At the end of this configuration, <span style="color:#FF0000;"><strong> Use the following command to start the service </strong></span>
httpd -k install
httpd -k start
Single is httpd -k start Unable to start service