Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webcache

Status
Not open for further replies.

Zelandakh

MIS
Mar 12, 1999
12,173
GB
I run my Linux (Red Hat 6.0) as a firewall and a web cache. How can I reset the web cache or clear parts of it?
 
One way would be to simple edit the file

asuming the file is /var/log/http/access.log

cd /var/log/http/

vi access.log

The command dG will delete every line from the current line the end of the buffer.

d1G will delete everyline from the current to the begging of the buffer.

when you are finsihed

ZZ or :w!



-Danny






 
I have /var/log/httpd/access_log but that is a list of who went where. That's not it.

I have a /webcache folder which has loads of sub dirs, one for every letter of the alphabet.
 
I miss understood yuor question.

Is this correct.

1. YOu want to know where the http log file is.

2. You want to edit it

What version of linux are you running.



-Danny






 
brute force method:

find /webcache -atime +x -exec rm {} \;
where x is the length of time since last accessed.

but this will probably break something in the firewall. i'm not sure how it keeps track of what has been cached.

good luck
 
I would assume that by your observations of the sub-directories that you are running Squid as your web cache server. Squid and your web server have nothing in common unless you are proxying inbound connections for you internal web server, but that is a whole 'nother issue....

Really the easiest and quickest way to clear your cache in Squid is to note the user/group that owns /webcache along with permissions on the directory - then 'rm -r /webcache' (this is DEFINATELY assuming you only have the cache directories below /webcache and nothing else. If there is other stuff, you will have to delete each individual directory...) Once you have deleted all the old cache directories, recreate the 'webcache' directory with the same owner, group and permissions as previous, then launch 'squid -z' which will recreate the cache directory structure..

Hope this helps,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top