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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Linux下安裝Apollo (Quick Start)LinuxUI
- Llama-recipes Quick start 的除錯UI除錯
- Spark文件閱讀之二:Programming Guides - Quick StartSparkGUIIDE
- squid 代理轉發內網伺服器UI內網伺服器
- squidUI
- android studio Error:Unable to start the daemon process【轉】AndroidError
- [轉載] Oracle:start with...connect by子句的用法Oracle
- Flexbox GuideFlexGUIIDE
- A guide to this in JavaScriptGUIIDEJavaScript
- Meterpreter GuideGUIIDE
- Guide to app architectureGUIIDEAPP
- crontab usage guideGUIIDE
- Linux伺服器---squid限制Linux伺服器UI
- CentOS搭建squid正向代理教程。CentOSUI
- Guide to Database as a Service (DBaaS)GUIIDEDatabase
- webpack Performance: The Comprehensive GuideWebORMGUIIDE
- MariaDB ubuntu install guideUbuntuGUIIDE
- The hater’s guide to KubernetesGUIIDE
- 【Java】A Guide to the Java ExecutorServiceJavaGUIIDE
- Merchant‘s Guide to the GalaxyGUIIDE
- Linux伺服器---squid快取Linux伺服器UI快取
- Linux伺服器---安裝squidLinux伺服器UI
- start uniappAPP
- quick-shell.jsUIJS
- 快速排序 (Quick Sort)排序UI
- Quick Library 簡介UI
- The Definitive Guide to CentOS.pdfGUIIDECentOS
- Notes about Vue Style GuideVueGUIIDE
- 2.4、User’s guide (Coroutines)GUIIDE
- An easy guide to object rest/spreadGUIIDEObjectREST
- Qt Quick 如何入門?QTUI
- 利用RouterOS配合squid實現透明快取ROSUI快取
- 配置 Squid 作為 SSH 代理伺服器UI伺服器
- Core Animation Programming Guide Mind MappingGUIIDEAPP
- SAP SD Reference Guide: SAP NotesGUIIDE
- 【AP】a pratical guide to robust optimization(1)GUIIDE
- 翻譯|A Visual Guide to State in ReactGUIIDEReact
- guide-rpc-framework 流程梳理GUIIDERPCFramework