Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/squid-2.5.STABLE13/ drwxr-xr-x |
Viewing file: Select action/file-type: 3. Installing and Running Squid3.1 How big of a system do I need to run Squid?There are no hard-and-fast rules. The most important resource for Squid is physical memory. Your processor does not need to be ultra-fast. Your disk system will be the major bottleneck, so fast disks are important for high-volume caches. Do not use IDE disks if you can help it. In late 1998, if you are buying a new machine for a cache, I would recommend the following configuration:
Also, see Squid Sizing for Intel Platforms by Martin Hamilton This is a very nice page summarizing system configurations people are using for large Squid caches. 3.2 How do I install Squid?After compiling Squid, you can install it with this simple command: % make installIf you have enabled the ICMP features then you will also want to type % su # make install-pinger After installing, you will want to edit and customize the squid.conf file. By default, this file is located at /usr/local/squid/etc/squid.conf. Also, a QUICKSTART guide has been included with the source distribution. Please see the directory where you unpacked the source archive. 3.3 What does the squid.conf file do?The squid.conf file defines the configuration for squid. the configuration includes (but not limited to) HTTP port number, the ICP request port number, incoming and outgoing requests, information about firewall access, and various timeout information. 3.4 Do you have a squid.conf example?Yes, after you The sample squid.conf file contains comments explaining each option. 3.5 How do I start Squid?After you've finished editing the configuration file, you can start Squid for the first time. The procedure depends a little bit on which version you are using. Squid version 2.XFirst, 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, you will see the line: 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/squid NOTE: depending on your configuration, you may need to start squid as root. Squid version 1.1.XWith version 1.1.16 and later, you must first run Squid with the -z option to create the cache swap directories. % /usr/local/squid/bin/squid -zSquid will exit when it finishes creating all of the directories. Next you can start RunCache: % /usr/local/squid/bin/RunCache & For versions before 1.1.6 you should just start RunCache immediately, instead of running squid -z first. 3.6 How do I start Squid automatically when the system boots?Squid Version 2.XSquid-2 has a restart feature built in. This greatly simplifies starting Squid and means that you don't need to use RunCache or inittab. At the minimum, you only need to enter the pathname to the Squid executable. For example: /usr/local/squid/bin/squid Squid will automatically background itself and then spawn a child process. In your syslog messages file, you should see something like this: Sep 23 23:55:58 kitty squid[14616]: Squid Parent: child process 14617 startedThat means that process ID 14563 is the parent process which monitors the child process (pid 14617). The child process is the one that does all of the work. The parent process just waits for the child process to exit. If the child process exits unexpectedly, the parent will automatically start another child process. In that case, syslog shows: Sep 23 23:56:02 kitty squid[14616]: Squid Parent: child process 14617 exited with status 1 Sep 23 23:56:05 kitty squid[14616]: Squid Parent: child process 14619 started If there is some problem, and Squid can not start, the parent process will give up after a while. Your syslog will show: Sep 23 23:56:12 kitty squid[14616]: Exiting due to repeated, frequent failuresWhen this happens you should check your syslog messages and cache.log file for error messages. When you look at a process (ps command) listing, you'll see two squid processes: 24353 ?? Ss 0:00.00 /usr/local/squid/bin/squid 24354 ?? R 0:03.39 (squid) (squid)The first is the parent process, and the child process is the one called ``(squid)''. Note that if you accidentally kill the parent process, the child process will not notice. If you want to run Squid from your termainal and prevent it from backgrounding and spawning a child process, use the -N command line option. /usr/local/squid/bin/squid -N Squid Version 1.1.XFrom inittabOn systems which have an /etc/inittab file (Digital Unix, Solaris, IRIX, HP-UX, Linux), you can add a line like this: sq:3:respawn:/usr/local/squid/bin/squid.sh < /dev/null >> /tmp/squid.log 2>&1We recommend using a squid.sh shell script, but you could instead call Squid directly. A sameple squid.sh script is shown below: #!/bin/sh C=/usr/local/squid PATH=/usr/bin:$C/bin TZ=PST8PDT export PATH TZ notify="root" cd $C umask 022 sleep 10 while [ -f /tmp/nosquid ]; do sleep 1 done /usr/bin/tail -20 $C/logs/cache.log \ | Mail -s "Squid restart on `hostname` at `date`" $notify exec bin/squid -CYs From rc.localOn BSD-ish systems, you will need to start Squid from the ``rc'' files, usually /etc/rc.local. For example: if [ -f /usr/local/squid/bin/RunCache ]; then echo -n ' Squid' (/usr/local/squid/bin/RunCache &) fi From init.dSome people may want to use the ``init.d'' startup system. If you start Squid (or RunCache) from an ``init.d'' script, then you should probably use nohup, e.g.: nohup squid -sY $conf >> $logdir/squid.out 2>&1Also, you may need to add a line to trap certain signals and prevent them from being sent to the Squid process. Add this line at the top of your script: trap '' 1 2 3 18 3.7 How do I tell if Squid is running?You can use the client program: % client http://www.netscape.com/ > test There are other command-line HTTP client programs available as well. Two that you may find useful are wget and echoping. Another way is to use Squid itself to see if it can signal a running Squid process: % squid -k checkAnd then check the shell's exit status variable. Also, check the log files, most importantly the access.log and cache.log files. 3.8 squid command line optionsThese are the command line options for Squid-2:
3.9 How do I see how Squid works?
Next Previous Contents |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0029 ]-- |