Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed Squid3 on Rasbian, and did some minor configuration. Then I set it up to cache to an auto mounting usb drive.

I was looking over the logs and found only TCP_MISS. I was hoping after a little bit of using Squid with the I'd see some hits. I looked in the cache (the ufs tree is there) and it appears to be caching files.

I ran squid -X -d9 and got errors that the log files could not be written:

FATAL: Cannot open '/var/log/squid3/access.log' for writing.
The parent directory must be writeable by the
user 'proxy', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 3.1.20): Terminated abnormally.

the permissions for /var/log/squid3 are:

drwxrwxr-x  2 proxy proxy   4096 Apr 29 14:13 squid3

and inside:

-rwxrwx--- 1 proxy proxy      0 Apr 29 06:25 access.log
-rwxrwx--- 1 proxy proxy 303469 Apr 28 23:41 access.log.1
-rwxrwxrwx 1 proxy proxy  14730 Apr 29 14:47 cache.log
-rwxrwx--- 1 proxy proxy  79626 Apr 28 22:00 cache.log.1
-rwxrwx--- 1 root  root       0 Apr 27 14:09 store.log.1

Permissions for the cache mounted at /cache0

drwxrwxr-x  19 root proxy  4096 Apr 29 14:47 cache0

How can I resolve these errors? Thank you in advance.

share|improve this question
    
Hi Jason. Server Fault is for professional system administrators with problems in the workplace. I'll assume you're not using that Raspberry Pi at work, so your question is fine to stay here. –  slhck Apr 30 '13 at 10:31

1 Answer 1

The default squid user proxy needs write permission from the parent to all the directories it writes to; including the cache directory (cache_dir) and log files.

I didn't want to change the permissions of /var or /var/log, so I created a new directory /squid3_logs and set the log locations in squid.conf.

access_log /squid3_logs/access.log squid
cache_store_log /squid3_logs/store.log
cache_log /squid3_logs/cache.log

I also made sure that all the files and subdirectories in my cache (/cache0) had the proper permissions. When I ran the debug command squid -X -d9 as my user, I think automatically changed the swap.state owner to me.

sudo chown proxy:proxy /cache0/swap.state
sudo chmod -R 775 /cache0

Now everything seems to be working. I'm not finding any errors when I run the debug command, or when I parse the config file (squid3 -k parse).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.