How do I clear ? How do I re-create the directories on a where version 3.x is currently running in or based server?

You can delete/clear cache and re-create the cache directories on a server using the following procedure. Please note that you need to run additional commands if you are using .

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 user. Or use the to login to the remote server. Once logged in type the following to shutdown squid 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 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

Print Friendly

Comments

comments

Bài viết liên quan