Squid - Initializing The Cache

bkaron

Yep, That's Me!
Some of you that have been following my post about "http Tunnel" may know about my "UNIX Friend" (Andy) and he helped me configure many programs, including Open VPN. Now andy a a freaking genius and smart as hell, but he is not the best teacher.

So after he helped me configure Open VPN and helped make a tunnel (link?) he said I needed a Proxy server, he recommended "Squid" and in addition to that he recommended "Webmin" to configure squid

After I configured and installed squid and webmin I proceed to configure squid via webmin, but here's the kicker, squid wont Initialize. I get the following error
Code:
Initializing the Squid cache with the command /usr/local/squid/sbin/squid -f /usr/local/squid/etc/squid.conf -z ..

2004/12/06 17:18:53| Creating Swap Directories
FATAL: Failed to make swap directory /usr/local/squid/var/cache: (13) Permission denied
Squid Cache (Version 2.5.STABLE7): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
I then went to the terminal and typed "sudo /usr/local/squid/sbin/squid -f /usr/local/squid/etc/squid.conf -z" and got the same error.

Why is this happening and how can I fix it. Remember, I'm not a UNIX buff so please explain everything in detail

Thanks :D
 
oh, here is the QUICKSTART guid

Squid QUICKSTART

$Id: QUICKSTART,v 1.4.2.4 2003/07/18 08:53:27 hno Exp $

This document is intended only for people who want to get Squid running
quickly It is not a substitute for the real documentation. Squid has
many features, but only a few of them are useful at the beginning. Use
this only if you have quite a simple setup.

After you retrieved, compiled and installed the Squid software (see
INSTALL in the same directory), you have to configure the squid.conf
file. This is the list of the values you *need* to change, because no
sensible defaults could be defined. Do not touch the other variables
for now. We assume you have installed Squid in the default location:
/usr/local/squid

Uncomment and edit the following lines in /usr/local/squid/etc/squid.conf:

==============================================================================

cache_peer, never_direct/always_direct

If you have a parent cache, put it here. The administrators of the
parent cache typically provided you with instructions. You should
always ask permission before adding a parent cache. See also the
never_direct/always_direct directives.

cache_dir /usr/local/squid/var/cache 100 16 256

Add here (first number, here 100) the amount of hard disk space
(in megabytes) to devote to caching.

acl, http_access, icp_access

Access control lists. This is important because it prevents people
from stealing your network resources. To fill in the
"allowed_hosts" ACL, use your network address (for instance
192.168.10.0 and your network mask (for instance 255.255.255.0):

acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl all src 0.0.0.0/0.0.0.0
acl allowed_hosts src 192.168.10.0/255.255.255.0

http_access deny manager all
http_access allow allowed_hosts
http_access deny all

icp_access allow allowed_hosts
icp_access deny all

cache_mgr

Put here the e-mail address of the manager:

cache_effective_user

If you must start Squid as root, find a safe user and group to run
as after startup (typically "nobody" and "nogroup"). Do not use
"root", for security reasons.

visible_hostname

The host name you advertise for the cache.

==============================================================================

After editing squid.conf to your liking, run Squid from the command
line TWICE:

% /usr/local/squid/sbin/squid -z
% /usr/local/squid/sbin/squid

Check in the cache.log (/usr/local/squid/var/logs/cache.log) that
everything is all right.

Once Squid created all its files (it can take several minutes on some
systems), test it with echoping or a regular Web client. By default,
your Squid will run on port 3128. See the Squid FAQ for more details.

Once you have Squid working from the command line, tell your Unix to
start Squid at startup (it depends heavily on the Unix you use, you'll
typically have to modify something in a /etc/rc_something).

This quick start file written by: Stephane Bortzmeyer and Duane
Wessels.
 
What are the permissions on /usr/local/squid/var ? Who owns that directory? Go through and make sure that the web user, usually 'www' can read/write to that/those directories. You can change it:

To change owners:

#chown www /usr/local/squid/var

Permissions:

# chmod u+rw /usr/local/squid/var
 
Ok, using Webmin I wnet to the administrative options tab and changed

"RUN AS UNIX USER" to WWW

Now when I go to initialize the cache this is all that happens

2004/12/07 00:14:37| Creating Swap Directories

and it just stays like this, am I done? What now?
 
Are there any indications that squid is running? If you can get to the command line, just type:

% ps ax

And look for anything that says squid.
 
Back
Top