Last update at :2024-01-04,Edit by888u
VpsAdd tutorial:apache as a reverse proxy server To proxy server
Redirected earlier: VpsAdd tutorial: Nginx (LNMP) reverse proxy configuration tutorial a> Then switch to apache
Source: http://yahoon.blog.51cto.com/13184/162922/
1 Forward proxy: The client cannot directly access the external web. A proxy server needs to be set up in the network where the client is located. The client accesses the external web through the proxy server. web (needs to set up a proxy server in the client's browser) Applicable to: ①Proxy server of LAN (usually gateway, equivalent to the general usage of Squid) ②Access to a proxy server on a restricted network. For example, if the Education Network accesses some foreign websites, you need to find a proxy. 2 Reverse proxy: The client can access the external web, but cannot access the target web. A machine in the network where the target web is located acts as a proxy for the target web. The client Directly accessing the proxy is just like accessing the target web (this proxy is transparent to the client, that is, the client does not need to do any settings, and does not know that it is only the proxy that is actually accessed, thinking that it is the target of the access) Applicable to: ① A certain target machine of IDC only opens the web internally. If external clients want to access it, let another machine act as a proxy. Direct external access to the proxy is equivalent to accessing the target. ② A special web service on the target machine of IDC runs on an abnormal port such as 9000, and the firewall only opens 80 to the outside world. At this time, proxy mapping can be done on 80 to 9000. External access to 80 is equivalent to 9000. The simple diagram is as follows In this case Machine 192.168.0.114 is our reverse proxy server apache/2.0.63 runs on its port 80 There are two virtual hosts with domain names on it www.a.org www.b.org The effect to be achieved is: Visiting www.a.org is equivalent to accessing another machine 192.168.0.115 Visiting www.b.org is equivalent to accessing port 9000 of this machine. The proxy function of apache is implemented by its proxy module. There are two ways to load modules: static and dynamic, which are explained here: 1 static loading Static loading is compiled when compiling apache. The compilation parameters are as follows: "./configure" \ "-prefix=/usr/local/apache3" \ "--enable-so" \ "--enable-rewrite" \ "--with-mpm=prefork" \ “–enable-proxy” \ (This parameter is the proxy module enabled) View the module list after installation is complete /usr/local/apache3/bin/httpd -l show Compiled in modules: core.c mod_access.c mod_auth.c mod_include.c mod_log_config.c mod_env.c mod_setenvif.c mod_proxy.c proxy_connect.c proxy_ftp.c proxy_http.c prefork.c http_core.c …. Edit the configuration file httpd.conf In the virtual host section NameVirtualHost *:80Recommended site search: renting server windows virtual host, Taiwan server, Korean high-defense server, Ministry of Industry and Information Technology registration system, virtual host space, website registration system, mainland China proxy server IP, virtual space free trial, Zhengzhou virtual host,
p>All copyrights belong to 888u unless special state
发表评论