squid-1.1.17のinstall (97/10/24) 1) squid-1.1.17-src.tar.gzの展開とmake & install $ tar zxvf squid-1.1.17-src.tar.gz -C ~/src $ cd ~/src/squid-1.1.17 $ ./configure $ make all $ su # make install 2) /usr/local/squid/etc/squid.confの書き換え。 3) cache directoryの制作 # cd /usr/local/squid # find . -exec chown www.www {} \; # cd /usr/local/squid/bin # ./squid -z 4) directoryの作成と所有者の変更 # cd /usr/local/squid # mkdir cache/OLD # mkdir logs/OLD # chown www.www cache/OLD # chown www.www logs/OLD 5) logの管理 現在/root/bin/dailyが毎日午前3時0分にcronで動いている。 /root/bin/dailyに以下を追加。 echo "" echo "Rotating Squid logs" cd /usr/local/squid/cache/OLD rm -f log.7 if [ -f log.6 ]; then mv -f log.6 log.7; fi if [ -f log.5 ]; then mv -f log.5 log.6; fi if [ -f log.4 ]; then mv -f log.4 log.5; fi if [ -f log.3 ]; then mv -f log.3 log.4; fi if [ -f log.2 ]; then mv -f log.2 log.3; fi if [ -f log.1 ]; then mv -f log.1 log.2; fi if [ -f log.0 ]; then mv -f log.0 log.1; fi mv -f ../log log.0 cp /dev/null ../log chmod 644 ../log chown www.www ../log cd /usr/local/squid/logs/OLD rm -f access.log.7 if [ -f access.log.6 ]; then mv -f access.log.6 access.log.7; fi if [ -f access.log.5 ]; then mv -f access.log.5 access.log.6; fi if [ -f access.log.4 ]; then mv -f access.log.4 access.log.5; fi if [ -f access.log.3 ]; then mv -f access.log.3 access.log.4; fi if [ -f access.log.2 ]; then mv -f access.log.2 access.log.3; fi if [ -f access.log.1 ]; then mv -f access.log.1 access.log.2; fi if [ -f access.log.0 ]; then mv -f access.log.0 access.log.1; fi cd /usr/local/squid/logs mv -f access.log OLD/access.log.0 cp /dev/null access.log chmod 644 access.log chown www.www access.log cd /usr/local/squid/logs/OLD rm -f cache.log.7 if [ -f cache.log.6 ]; then mv -f cache.log.6 cache.log.7; fi if [ -f cache.log.5 ]; then mv -f cache.log.5 cache.log.6; fi if [ -f cache.log.4 ]; then mv -f cache.log.4 cache.log.5; fi if [ -f cache.log.3 ]; then mv -f cache.log.3 cache.log.4; fi if [ -f cache.log.2 ]; then mv -f cache.log.2 cache.log.3; fi if [ -f cache.log.1 ]; then mv -f cache.log.1 cache.log.2; fi if [ -f cache.log.0 ]; then mv -f cache.log.0 cache.log.1; fi cd /usr/local/squid/logs mv -f cache.log OLD/cache.log.0 cp /dev/null cache.log chmod 666 cache.log chown www.www cache.log cd /usr/local/squid/logs/OLD rm -f store.log.7 if [ -f store.log.6 ]; then mv -f store.log.6 store.log.7; fi if [ -f store.log.5 ]; then mv -f store.log.5 store.log.6; fi if [ -f store.log.4 ]; then mv -f store.log.4 store.log.5; fi if [ -f store.log.3 ]; then mv -f store.log.3 store.log.4; fi if [ -f store.log.2 ]; then mv -f store.log.2 store.log.3; fi if [ -f store.log.1 ]; then mv -f store.log.1 store.log.2; fi if [ -f store.log.0 ]; then mv -f store.log.0 store.log.1; fi cd /usr/local/squid/logs mv -f store.log OLD/store.log.0 cp /dev/null store.log chmod 644 store.log chown www.www store.log 6)/etc/rc.d/rc.localに立ち上げスクリプトを追加 # Squid if [ -x /usr/local/squid/bin/squid ]; then /usr/local/squid/bin/RunCache & echo "Start Squid Cache server." fi