1: Download Apache from the Apache official website , http://httpd.apache.org/
2: Enter the command line into the bin directory of Apache and enter httpd -k install (Note: cmd must be entered as an administrator here, otherwise an error will be reported when executing the installation)
3:start Apache by typing:httpd -k start
Other Command line options:
Stop Apache httpd -k stop
Restart Apache httpd -k restart
Uninstall Apache Service httpd -k uninstall
Test Config Syntax httpd -t
Version Details httpd -V
Command Line Options List httpd -h
4 : After the installation is successful, start to configure the httpd.conf file.
Using proxies and anti-proxy
将LoadModule proxy_module modules/mod_proxy.so
proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
Set to enabled.
5 : Configure DocumentRoot
6 : Add configuration
#Load mod_jk module _
LoadModule jk_module modules/mod_jk.so
#Specify the location of the configuration file workers.properties required by the mod_jk module
JkWorkersFile conf/workers.properties
7 : Configure the virtual host: VirtualHost
<VirtualHost *:80>
DocumentRoot E:/httpd-2.4.16-x64/ZYTPlatform/www/newwebsite/
ServerName 172.31.60.117
ErrorLog logs/beta.jointem.com-error_log
CustomLog logs/beta.jointem.com-access_log common
#设置代理和反代理
#此时若在浏览器中访问时,/cms会映射到http://172.31.60.117:8080/cms,apache最主要 #功能也就是处理请求负载。
ProxyPass /cms http://172.31.60.117:8080/cms
ProxyPassReverse /cms http://172.31.60.117:8080/cms
ProxyPass /cms_inf http://172.31.60.117:8080/CMS_INF
ProxyPassReverse /cms_inf http://172.31.60.117:8080/CMS_INF
ProxyPass /qrs http://172.31.60.117:8080/qrs
ProxyPassReverse /qrs http://172.31.60.117:8080/qrs
ProxyPass /zyt http://172.31.60.117:8080/zyt
ProxyPassReverse /zyt http://172.31.60.117:8080/zyt
#访问静态资源
Alias /data E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/data/
<Directory "E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/data/">
Options None
AllowOverride All
Require all granted
</Directory>
Alias /site E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/site/
<Directory "E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/site/">
Options None
AllowOverride All
Require all granted
</Directory>
Alias /img E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/img
<Directory "E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/img">
Options None
AllowOverride All
Require all granted
</Directory>
Alias /tplzip E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/tplzip/
<Directory "E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/tplzip/">
Options None
AllowOverride All
Require all granted
</Directory>
Alias /qrcode E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/qrs/qrcode/
<Directory "E:/httpd-2.4.16-x64/ZYTPlatform/zyb/cms/qrs/qrcode/">
Options None
AllowOverride All
Require all granted
</Directory>
</VirtualHost>