linux下apache安装以及反向代理的配置
apache2.2.x下的安装
1 ./configure --prefix=/usr/local/apache2
--enable-mods-shared=all
--enable-so
--enable-rewrite
2 make
3 make install
4 /usr/local/apache2/bin/apachectl -k start
下来是代理的配置
在httpd-vhosts.conf 下配置
<VirtualHost *:80>
ProxyPreserveHost On
ServerAdmin lifunet@itmg.co.jp
ProxyPass / http://112.78.124.124:8080/
ProxyPassReverse / http://112.78.124.124:8080/
ServerName shop.coojin.com
ErrorLog logs/shop.coojin.com-error_log
CustomLog logs/shop.coojin.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ServerAdmin lifunet@itmg.co.jp
ProxyPass / http://112.78.124.124:7007/
ProxyPassReverse / http://112.78.124.124:7007/
ServerName kaoo.jp
ErrorLog logs/kaoo.jp-error_log
CustomLog logs/kaoo.jp-access_log common
</VirtualHost>
在http.conf下配置
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
# Virtual hosts
Include conf/extra/httpd-vhosts.conf