Squid Proxy Server can't run as super-user root, and for this reason we must create a special user with no shell for running Squid Proxy Server.
[root@deep] /# useradd -d /cache/ -r -s /dev/null squid >/dev/null 2>&1
[root@deep] /# mkdir /cache/
[root@deep] /# chown -R squid.squid /cache/
First of all, we add the user squid to the /etc/passwd file. Then, we create the /cache directory if this directory doesn't exist, we repeat only if
it doesn't exist. Finally, we change the owner of the directory cache to be the user squid.
Usually we don't need to perform the command, mkdir /cache/, because we have already created this directory when we partitioned our hard drive during the installation of Linux. If this
partition doesn't exist, you must execute this command to create the directory.
Move into the new Squid directory and type the following commands on your terminal: Edit the
Makefile.infile, vi +18icons/Makefile.inand change the line:DEFAULT_ICON_DIR = $(sysconfdir)/iconsTo read:
DEFAULT_ICON_DIR = $(libexecdir)/iconsWe change the variable,
sysconfdirto belibexecdir. With this modification, theiconsdirectory of Squid will be located under the/usr/lib/squiddirectory.Edit the
Makefile.infile, vi +34src/Makefile.inand change the lines:DEFAULT_CACHE_LOG =$(localstatedir)/logs/cache.logTo read:
DEFAULT_CACHE_LOG =$(localstatedir)/log/squid/cache.logDEFAULT_ACCESS_LOG =$(localstatedir)/logs/access.logTo read:
DEFAULT_ACCESS_LOG =$(localstatedir)/log/squid/access.logDEFAULT_STORE_LOG =$(localstatedir)/logs/store.logTo read:
DEFAULT_STORE_LOG =$(localstatedir)/log/squid/store.logDEFAULT_PID_FILE =$(localstatedir)/logs/squid.pidTo read:
DEFAULT_PID_FILE =$(localstatedir)/run/squid.pidDEFAULT_SWAP_DIR =$(localstatedir)/cacheTo read:
DEFAULT_SWAP_DIR = /cacheDEFAULT_ICON_DIR =$(sysconfdir)/iconsTo read:
DEFAULT_ICON_DIR =$(libexecdir)/iconsWe change the default location of
cache.log,access.log,andstore.logfiles to be located under/var/log/squiddirectory. Then, we put the pid file of Squid under/var/rundirectory, and finally, locate theiconsdirectory of Squid under/usr/lib/squid/iconswith the variablelibexecdirabove.
