Configure Apache proxy

Source: Internet
Author: User
The proxy server is an application installed on the firewall. It connects the LAN inside the firewall to the Intemet. The proxy server provides the following functions. ● Monitors data packets sent through the firewall and records transmission information. ● Filter packet addresses through the firewall. ● Provides the File Cache function. The proxy server can

The proxy server is an application installed on the firewall. It connects the LAN inside the firewall to the Intemet. The proxy server provides the following functions. ● Monitors data packets sent through the firewall and records transmission information. ● Filter packet addresses through the firewall. ● Provides the File Cache function. The proxy server can


   ProxyA server (proxyserver) is an application installed on the firewall. It connects the LAN inside the firewall to Intemet. ProxyThe functions of the server are as follows.
● Monitors data packets sent through the firewall and records transmission information.
● Filter packet addresses through the firewall.
● Provides the File Cache function.
   ProxyThe server can ProxyService type, such as HTtP ProxyAnd FFP Proxy. We use HTTP ProxyFor example ProxyServer features. When the client in the LAN uses HTIT ProxyServer, its HTTP request will be sent ProxyServer instead of directly sending it to the source address. If ProxyServer ConfigurationThe File Cache function is enabled. When receiving a customer request, the system first checks whether the user needs content in the cache. If the cache does not exist, you need to retrieve it from the HTTP source address and then return the corresponding content to the user. Later, if the user requests the same content, ProxyThe server extracts data directly from the cache.
  
   ConfigurationApacheHTTP Proxy
  
As the WWW server software, Apache provides HTFP ProxyFunction. Next we will introduce Apache ProxyOf ConfigurationMethod:
  
(1) modify the/etc/httpd/conf/httpd. conf file and add ProxyCache-related functions. And ProxyThe cache-related keywords are as follows.
  
In the httpa. conf file ProxyCache-related keywords
ProxyRequests On/Off enable or disable Apache ProxyFunction
  
Proxyremote path URL remote server defines this ProxyRemote Server Proxy. When the user request matches the URL, the remote server is used as the remote ProxyServer.
  
The remote server is in the format of protocol: // hostname [: port], because Apache can only ProxyHTTP service, so the protocol value is always HTTP
  
ProxyPass path URL allows you to mirror a remote server to a local server. At this time, the local ProxyThe server seems to be remote. ProxyAn image of the server
  
ProxyBlock word/hostname/domain ProxyServer filter. After the ProxyBlock keyword, a group of words, node names, and domain names are defined. If your HTYP request contains the words, node names, or domain names, the request will be filtered out.
  
CacheRoot directory ProxyCached root directory
  
CacheSize size ProxyCache size, in KB
  
CacheGcInterval time checks the cache every hour. If the cache space exceeds the upper limit set by CacheSize, the files in the cache can be deleted for a maximum of hours. The expiration time of files is defined here.
  
CacheLastModifiedFactor if no file expiration time is defined, the expiration time is calculated according to the following formula: expiration time = interval of the last modification * factor
  
CacheDirLevels levels cache sub-directory Layers
  
Cachedirlen…… ProxyNumber of letters in the cached subdirectory name
  
CacheDefauhExpire time if the file is obtained through a protocol that does not support the expiration time, the time is used as the expiration time
  
NoCache word/hostname/domain defines a group of words, node names, and domain names after the NoCache keyword. HTFP files containing these words, node names, or domain names will not be cached
  
(2) modify the file/etc/httpd/conL/access. conf and add ProxyDirectory Access Control. The following is an instance.
  
  
  
Order deny, allow
Deny from all
Allow from.company.com
  
  
(3) Confirm that the cache directory specified by the CacheRoot keyword already exists.
Restart hnpd and the cache function will take effect.
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.