Article title: Configure Apache Proxy. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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 be classified based on the service type of the proxy, such as HTtP proxy and FFP proxy. Let's take the HTTP proxy as an example to introduce the proxy server function. When a client in the Lan uses the HTIT proxy server, its HTTP request is sent to the proxy server instead of the source address. If the proxy server is configured with the file cache function, when receiving a customer request, first check the cache for user-required content. 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. In the future, if the user requests the same content, the proxy server will directly extract it from the cache.
Configure the ApacheHTTP proxy
As the WWW server software, Apache provides the HTFP proxy function internally. The following describes how to configure the Apache Proxy:
(1) modify the file/etc/httpd/conf/httpd. conf and add the proxy and cache-related functions. The following keywords are related to proxy cache.
Keywords related to proxy cache in the httpa. conf file
ProxyRequests On/Off enable or disable the Apache Proxy function
Proxyremote path URL remote server defines the remote proxy of this proxy server. When a user request matches a URL, the remote server is used as the remote proxy server.
The remote server is in the format of protocol: // hostname [: port]. Since Apache can only proxy HTTP services, 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 proxy server seems to be an image of the remote proxy server.
ProxyBlock word/hostname/domain proxy server filter function. 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 root directory cached by the proxy
CacheSize proxy cache 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
The number of letters in the cache subdirectory
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 access control to the proxy directory. 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.
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