首先下载apache 源文件。2.0.54即可。
编译的时候加上如下参数:
./configure --prefix=/usr/local/apache2
--enable-rewrite=shared
--enable-proxy=shared
其中:prefix是安装目录;enable-rewrite 和 enable-proxy分别是启用了url重写和代理功能
在httpd.conf文件中加入如下代码:
ServerName map.sdta.cn
ErrorLog /usr/local/logs/httpd-error_log
TransferLog /usr/local/logs/httpd-access_log
RewriteEngine on
#ProxyRequestes off
#UseCanonicalName off
RewriteRule ^/(.*)$ http://192.168.0.1:7001/$1 [P,L]
即可将所有请求转发至192.168.0.1:7001上
编译的时候加上如下参数:
./configure --prefix=/usr/local/apache2
--enable-rewrite=shared
--enable-proxy=shared
其中:prefix是安装目录;enable-rewrite 和 enable-proxy分别是启用了url重写和代理功能
在httpd.conf文件中加入如下代码:
ServerName map.sdta.cn
ErrorLog /usr/local/logs/httpd-error_log
TransferLog /usr/local/logs/httpd-access_log
RewriteEngine on
#ProxyRequestes off
#UseCanonicalName off
RewriteRule ^/(.*)$ http://192.168.0.1:7001/$1 [P,L]
即可将所有请求转发至192.168.0.1:7001上