Thursday, April 12, 2018

Hapus Cache Squid dan membuat ulang

Hapus Cache Squid dan membuat ulang


Step #1: Find Squid cache dir location

Open a terminal and then type:
# grep cache_dir /etc/squid/squid.conf
Sample outputs:
cache_dir ufs /var/spool/squid 100 16 256

Step #2: Restart Squid with an empty cache

Open a terminal and login as root user. Or use the ssh command to login to the remote server. Once logged in type the following command to shutdown squid proxy server:
# squid -k shutdown
Use the following rm command to delete the directory:
# rm -rf /path/to/dir/cache/
# rm -rf /var/spool/squid/

Please note that you need repeat the rm command for each cache_dir location you wish to empty. Next, use the following mkdir command to create directory and set permission using chown command:
# mkdir /var/spool/squid
#
chown squid:squid /var/spool/squid

A note about SELinux user

If you are using SELinux, type the following command to restestore file(s) default SELinux security contexts:
# restorecon -vr /var/spool/squid

Creating cache_dir

Finally, to re-create the cache directories, enter:
# squid -z
Sample outputs:
2013/08/24 04:24:19| Making directories in /var/spool/squid/00
2013/08/24 04:24:19| Making directories in /var/spool/squid/01
2013/08/24 04:24:19| Making directories in /var/spool/squid/02
2013/08/24 04:24:20| Making directories in /var/spool/squid/03
2013/08/24 04:24:20| Making directories in /var/spool/squid/04
2013/08/24 04:24:20| Making directories in /var/spool/squid/05
2013/08/24 04:24:20| Making directories in /var/spool/squid/06
2013/08/24 04:24:20| Making directories in /var/spool/squid/07
2013/08/24 04:24:20| Making directories in /var/spool/squid/08
2013/08/24 04:24:20| Making directories in /var/spool/squid/09
2013/08/24 04:24:20| Making directories in /var/spool/squid/0A
2013/08/24 04:24:20| Making directories in /var/spool/squid/0B
2013/08/24 04:24:20| Making directories in /var/spool/squid/0C
2013/08/24 04:24:20| Making directories in /var/spool/squid/0D
2013/08/24 04:24:20| Making directories in /var/spool/squid/0E
2013/08/24 04:24:20| Making directories in /var/spool/squid/0F

Starting squid proxy server

To start squid type:
# squid
OR
# service squid start
Sample outputs:
Starting squid: [ OK ]

Step #3: Verify Squid is running

Type the following commands:
# netstat -tulpn | grep :3128
# tail -f /var/log/squid/access.log
# tail -f /var/log/squid/cache.log


go to link download
download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.