Вы находитесь на странице: 1из 4

Squid Proxy on Linux 8.

Procedure for Installing Squid 2.4 STABLE7-4 RPM and Squid Tarball file

1. Install Redhat 8.0 Server.


(Note:You can find Squid compatibility chart on
http://www.securecomputing.com/index.cfm?sKey=1101&pf=1 )

2. Redhat 8.0 itself contains Squid 2.4 Stable7-4 RPM installed.If you are able to run
‘squid’ command from shell that means Squid RPM is already installed.Then start
this procedure from Step 5 (if it is not present then download squid-2.4.STABLE7-
4.i386.rpm from net)

3. login as ROOT user.Copy downloaded RPM file

4. Now to install this RPM use following command line ,


#rpm -ivh squid-2.4.STABLE7-4.i386.rpm (where ‘i’ stand for install)

5. Squid 2.4 main program is installed.Now you have to install supported Squid Tarball
Package
i.e. Squid-2.4.STABLE7.src.tar.gz.Download this file from net.

6. Create user as a ‘squid’ with home directory /usr/local/Squid from Linux GUI
System Setting- Users and Groups .
Note:Always run Squid user as a squid and not ROOT user for security reason.

7. Login as a squid user,copy downloaded tarball file.

8. Now to install this Tarball file use following command line,


#tar -xvzf squid-2.4.STABLE7.src.tar.gz
This will installed Squid package in folder name Squid-2.4-Stable7 in same path from
where we installed Tarball file.

9. Goto that newly created folder and executes following commands,


#cd Squid-2.4-Stable7
# ./configure --enable-snmp
(--enable-snmp : Squid can serve statistics and status information via
SNMP)
# make
# make install
Above commands install Squid in /usr/local/squid with subdirectories /bin, /etc,
/logs,and /cache.It also creates Squid.conf file in /etc folder.This is the file where we
are going to configure that how squid should run?

10. After editing following basic parameters and creating swap directories Squid is redy
for testing. (Note:removing # will enable the squid parameters)
http_port 3128 ( you can put your own desired port in place of 3128)
cache_mem 8 MB (make it 32 MB)
cache_dir ufs /usr/local/squid/cache 500 16 256
(make it 3000 depends on your HDD size allotted for Cache)
http_access deny all (instead of deny put allow)

11. After editing above parameters in Squid.conf file.You will need to creat Swap
Directories
that index stored data.Execute following command,
# squid -z

12. Now run squid command.


Goto any user desktop and configured his IE Lan Setting to use Proxy Server,
Put IP address of proxy server and put port 3128 or port number which you have
defined in place of 3128.

Squid User Authentication

(Note:Be sure to always login as Squid user)

1. By Default Proxy Authentication Module is not installed in Squid Installation.


So to install this module
Goto folder Squid-2.4-Stable7
Go to the ../auth_modules/NCSA directory
Then run following commands
$ make
$ make install

2. Now add following line to squid.conf file (If it is already there then just remove # and
make it similar line as follows):
authenticate_program /usr/local/squid/bin/ncsa_auth / /
/usr/local/squid/etc/users

Description:
authenticate_program /usr/local/squid/bin/ncsa_auth
Specifies that Authen. Module is installed in /usr/local/squid/bin/ncsa_auth
directory

/usr/local/squid/etc/users
Specifies that users Login names and Passswords are stored in users file.
(Note:Creating users file is explained in next step and be remember to run step 3
command from /usr/local/squid/etc path )

3. You can create user logins and passwords using htpasswd command.
As we have seen in Step 2, that users file is present in
/usr/local/squid/etc/users
Run following command from /usr/local/squid/etc path
$ htpasswd -cmd users username (For help on htpasswd command type htpasswd
--help)

Description:
-c Create a new users file.(This option should be used only at first time of
creating first user)
-m Force MD5 encryption of the password.
-d Force CRYPT encryption of the password (default).
users is the file name which stores all users login and password

>>For Example
$ htpasswd -cmd users vishal
$ Password- ******
$ Re-type - ******

Description:Above command is to create login and password for user Vishal.


-c option is used to create users file at first time
>>Now for example to create login and password for next user Sachin
Use command $ htpasswd -md users Sachin (Pls remember to remove -c option)

4. To check the usersname and passwords are stored in users file


Open the file using $ vi users (vi is a command line text editor)
Now to close this file editor press SHIFT & : key and type wq and press Enter key.

Clearing the Squid Cache

There are two ways as follows:

I) Stop the squid using squid -k shut


Rename cache folder as mv cache cacheold
Create new folder named cache as mkdir cache
To initailze Squid squid -z
To start Squid again squid
To delete Old cahe folder rm -rf cacheold

II)
Stop squid
Set a null byte to "swap.state" file using command

echo "" > swap.state

Then start the squid back.

Вам также может понравиться