一、下载
1. 进入官网http://httpd.apache.org/download.cgi,找到需要的版本
2. 选择下载渠道
3. 选择需要的类型
二、安装
0.根据ReadMe.txt中说明安装VC++,否则会提示找不到vcruntime.dll之类的错误
1. 将下载的文件解压到相应的目录后,定义服务目录路径SRVROOT为D:\software\httpd-2.4.20-x64-vc14-r2\Apache24
全局替换默认路径为${SRVROOT}
2. 用管理员身份运行cmd,进入apache httpd目录,并安装服务
-k install //默认安装,一般使用默认即可
-k install -n “服务名” //安装且重命名
-k install -n “服务名” -f “\my server\conf\my.conf” //指定配置文件安装且重命名
3. 运行ApacheMonitor.exe,增加服务
4. 测试
5. 发布应用
6. 配置反向代理,监听域名和端口
<IfModule mpm_winnt_module>
ThreadsPerChild 1024
MaxRequestsPerChild 10000
</IfModule>
AcceptFilter http none
AcceptFilter https none
EnableSendfile Off
EnableMMAP off
<VirtualHost *:80>
ServerName www.xxx.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:18080/
ProxyPassReverse / http://127.0.0.1:18080/
ErrorLog "logs/www.xxx.com_error.log"
CustomLog "logs/www.xxx.com_access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerName b.xxx.com
DocumentRoot "D:/wwwroot/test
ErrorLog "logs/b.xxx.com_error.log"
CustomLog "logs/b.xxx.com_access.log" common
</VirtualHost>