www.europe.redhat.com Home  |  Products  |  Shop  |  Services  |  Training  |  Support   
Red Hat Documentation

Configuring Squid

Configuring Squid

To get started running the Squid caching proxy server, begin with the QUICKSTART file. QUICKSTART should be in /usr/doc/squid-2.2/, if you installed the squid package, or in /usr/doc/squid-novm-2.2/ if you installed squid-novm. For more complete information, you should open the FAQ.php3 file (in the same directory as the QUICKSTART file) using your Web browser. You should also rely on the information provided at the Squid Web site at http://squid.nlanr.net/.

You can have Squid start and stop automatically as your machine boots and shuts down by adding symlinks to your system's /etc/rc.d/rc3.d and /etc/rc.d/rc0.d directories. The following commands will create the symlinks:

cd /etc/rc.d/rc3.d
ln -s ../init.d/squid S99squid
cd /etc/rc.d/rc0.d
ln -s ../init.d/squid K99squid
	  

If you are using the X Window System, you can create the symlinks with tksysv.

To run Squid, you'll need to edit some parameters in its configuration file, /etc/squid.conf, as follows:

  1. Find the line that begins with:

    #cache_mem 8
    	  

    Uncomment this line and replace 8 with the amount of RAM (in megabytes) that you want to allocate to Squid.

  2. Find the line that begins with:

    #cache_swap 100
    	  

    Uncomment this line and replace 100 with the amount of disk space (in megabytes) you want to allocate to Squid.

  3. Find the following section:

    acl manager proto cache_object
    acl localhost src 127.0.0.1/255.255.255.255
    acl all src 0.0.0.0/0.0.0.0
    	  

    Add the following line to the end of the previous section:

    acl allowed_hosts src XXX.XXX.XXX.0/255.255.255.0
    	  

    Replace the Xs (before the /) with your domain subnet. Replace the 255.255.255.0 with your domain's subnet mask.

  4. Find the following section:

    http_access allow all
    	  

    Replace it with:

    http_access allow allowed_hosts
    http_access deny all
    	  
  5. Find the following section:

    icp_access allow all
    	  

    Replace it with:

    icp_access allow allowed_hosts
    icp_access deny all
    	  
  6. Find the following line:

    #cache_mgr webmaster
    	  

    Uncomment this line and replace webmaster with the e-mail address of the Squid adminstrator.

  7. Save the squid.conf file.

  8. You can now start Squid by invoking the squid start command in /etc/rc.d/init.d/:

    /etc/rc.d/init.d/squid start
    	  

    If this is the first time you've run Squid, it will create the swap directories it needs upon startup.

Squid should now be listening to port 3128 on your Web server. You can now set up Netscape (from any machine you chose to allow access to Squid) to use your machine as its proxy server. Some people configure their routers to forward any requests on port 80 to redirect through Squid; this saves them from having to set up the proxy on all the machines on their network.



Products & Services  |  Download  |  Support  |  Training  |  Partners & Programs
About Red Hat  |  Legal statement  |  Privacy statement  |  Y2K statement
redhat.com

© 2000 Red Hat, Inc. All right reserved.