首页 技术 正文
技术 2022年11月14日
0 收藏 984 点赞 3,936 浏览 2189 个字

Windows Server 2016 上配置 APACHE+SSL+PHP+perl

安装环境谷歌云实例 Windows Server 2016Apache     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-win64VC14       Microsoft Visual C++ 2015(vcredist_x64)VC11       Microsoft Visual C++ 2015(vcredist_x64)
1.安装 ApacheApache/2.2 不支持php-5.3以后的版本,用最新的 Apache/2.4,由于是Win64-VC14版本,需安装 x64位版本的 VC2015运行库,即VC14http://httpd.apache.org/download.cgihttp://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修改  D:\httpd\conf\httpd.conf 中的 Require all denied 字段 为 Require all granted  ,这样放权外网访问
2.安装 SSLhttp://openssl.orghttps://wiki.openssl.org/index.php/Binarieshttps://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    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)"
3.安装 perl下载后安装时选第三项会自动安装到 c:/perl64 ,无需做其它修改,以后加载.pl文件时,第一行指向 #!c:/perl64/bin/perl.exehttp://perl.orghttp://www.activestate.com/activeperl/downloads修改 D:/httpd/conf/httpd.conf 文件,去掉下行前面的 ##LoadModule cgi_module modules/mod_cgi.so
4.安装 phpphp 有两种版本,Thread Safe(TS) 和 Non Thread Safe(NTS) , TS 用于APACHE ,NTS 用于IIS由于 VC11 x64 Thread Safe 需安装 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 文件,增加下面的行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如果出现找不到 D:/httpd/php-5.6.30/php5apache2_4.dll 文件的提示,可能是需要的VC运行库没有安装,或者是apache和php的版本不配。
5.到此配置结束,使用下面的命令启动服务httpd -k installhttpd -k start单是 httpd -k start 不能启动服务
最后还得在 本地防火墙 上放行 Apache ,同时在谷歌云上的    网络-->防火墙 设置上允许 tcp:80 ;tcp:443 允许任意目标访问这样外界才能访问 WEB 服务器
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,000
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,512
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,358
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,141
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,771
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,849