Squid - A quick start guide(轉)
Squid - A quick start guide(轉)[@more@]makemake installThis will by default, install into "/usr/local/squid". Type ./configure --help to view all available options.Step II - Basic ConfigurationSome basic Configuration is to be done in Configuration file. By default this file is in the following path "usr/local/squid/etc/squid.conf". In the configuration file uncomment and edit the following lines.cache_dirSet cache_dir to an area that has a large amount of hard disk space in order to devote to caching.Cache_dir ufs /usr/local/squid/cache 100 16 256 is common.http_portCheck http_port, 3128 is a default.http_accessBy default http_access is denied to all. You have to set ACL rules as per your requirements. This is important because it prevents people from stealing your network resourcescache_effective_user & cache_effective_ groupSet cache_effective_user and cache_effective_ group to a user and group. This user should have the permission to read and write in the cache directory and in the log files.Step III - Custom configuration based on your network needsFor Configuring squid for proxyBy default, squid is configured in proxy mode. In order to cache web traffic and to use the squid system as a proxy, you have to configure your browser, which needs at least two pieces of information:i. _____ the proxy server's host nameii. ______ the port that the proxy server is accepting requests onFor Configuring squid for transparencyUsing squid transparently is a two part process, requiring first that squid be configured properly to accept non-proxy requests (performed in the squid module) , and second that web traffic gets redirected to the squid port (achieved in three ways namely policy based routing, Using smart switching or by setting squid Box as a gateway).Getting transparent caching to work requires the following steps:i. ___For some operating systems, you have to configure and build a version of Squid which can recognize the hijacked connections and discern the destination addresses. For Linux this seems to work automatically. For BSD-based systems, you probably have to configure squid with the --enable-ipf-transparent option, and you have to configure squid as:httpd_accel_host virtualhttpd_accel_port 80httpd_accel_with_proxy onhttpd_accel_uses_host_header onii. __________ Next you have to configure your cache host to accept the redirected packets - any IP address, on port 80 - and deliver them to your cache application. This is typically done with IP filtering/forwarding features built into the kernel. In Linux they call this ipfilter (kernel 2.4.x), ipchains (2.2.x) or ipfwadm (2.0.x).For Configuring squid for Reverse ProxyTo run Squid as an accelerator, you probably want to listen on port 80. And you have to define the machine you are accelerating for. This is done in squid module,http_port 80httpd_accel_host visolve.comhttpd_accel_port 81httpd_accel_single_host onhttpd_accel_with_proxy onIf you are using Squid as an accelerator for a virtual host system, then instead of a 'hostname' here you have to use the word virtual as:http_port 80httpd_accel_host virtualhttpd_accel_port 81httpd_accel_with_proxy onhttpd_accel_single_host offStep IV - Starting SquidAfter you've finished editing the configuration file, you can start Squid for the first time. First, you must create the swap directories. Do this by running Squid with the -z option:/usr/local/squid/bin/squid -zOnce that completes, you can start Squid and try it out. Probably the best thing to do is run it from your terminal and watch the debugging output. Use this command:/usr/local/squid/bin/squid -NCd1If everything is working okay, then your console displays: "Ready to serve requests".If you want to run squid in the background, as a daemon process, just leave off all options:/usr/local/squid/bin/squidHere depending on your configuration, you may need to start squid as root.Step V - To check if Squid is workingCheck the cache.log file in your logs directory. This file generates run time error messages that Squid generates
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-940927/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Akka Stream文件翻譯:Quick Start Guide: Reactive TweetsGUIIDEReact
- rman b14193Backup and Recovery Quick Start Guide筆記GUIIDE筆記
- Oracle DataPump Quick Start [ID 413965.1]OracleUI
- Performance Tools Quick Reference GuideORMGUIIDE
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Linux下安裝Apollo (Quick Start)LinuxUI
- Llama-recipes Quick start 的除錯UI除錯
- spring-cloud-config——Quick StartSpringCloudUI
- Spark文件閱讀之二:Programming Guides - Quick StartSparkGUIIDE
- Squid 工作的原理(轉)UI
- cron輔助squid(轉)UI
- Squid基礎與配置(轉)UI
- WPF/E CTP Quick Start - 第八部分:媒體(翻譯)UI
- squid 配置詳解+認證(轉)UI
- start with ...connect by --轉載
- Squid Proxy Server基礎入門(轉)UIServer
- Squid最佳化完全手冊(轉)UI
- squidUI
- Squid最佳化完全手冊(1)(轉)UI
- Squid最佳化完全手冊(2)(轉)UI
- linux 下 squid 安裝日誌 (轉)LinuxUI
- squid 代理轉發內網伺服器UI內網伺服器
- Object Pascal Style Guide (轉)ObjectGUIIDE
- Squid for windowUI
- Veritas Quick I/O and Cached Quick I/OUI
- Squid-Linux下的使用詳解(轉)UILinux
- 用squid再次瘋狂加速你的web(轉)UIWeb
- Java新特性--Java Web Start (轉)JavaWeb
- Squid with AD authenticationUI
- squid官方faqUI
- squid實踐UI
- Java Web Start 實現關鍵 (轉)JavaWeb
- Quick lime plantUI
- [轉載]Log Shipping Operations GuideGUIIDE
- SDL Guide 中文譯版(一) (轉)GUIIDE
- SDL Guide 中文譯版(二) (轉)GUIIDE
- SDL Guide 中文譯版(四) (轉)GUIIDE
- Squid-2.5.STABLE13修訂版正式釋出(轉)UI