LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2010, 02:52 AM   #1
satish
Member
 
Registered: Jan 2006
Posts: 172

Rep: Reputation: 15
squid with Redhat EN5


I had installed Redhat 5 server for our proxy requirement and uninstalled the rpm version of squid which is installed by the redhat 5 setup and now compiled squid from squid-2.4.STABLE1-src.tar.gz

Main reason for compilation is that i want delay pools and enable arp acl so i installed from tar ball with following command

./configure \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/sbin \
--libexecdir=/usr/lib/squid \
--localstatedir=/var \
--sysconfdir=/etc/squid \
--enable-delay-pools \
--enable-cache-digests \
--enable-poll \
--disable-ident-lookups \
--enable-truncate \
--enable-heap-replacement
--enable-arp-acl

then followed by make and make install

mkdir -p /var/log/squid
rm -rf /var/logs/
chown squid.squid /var/log/squid/
chmod 750 /var/log/squid/
chmod 750 /cache/
mkdir /cache/
chmod 750 /cache/
rm -f /usr/sbin/RunCache
rm -f /usr/sbin/RunAccel
strip /usr/sbin/squid
strip /usr/sbin/client
strip /usr/sbin/client
strip /usr/lib/squid/dnsserver
strip /usr/lib/squid/unlinkd
strip /usr/lib/squid/cachemgr.cgi

then the following creating of /etc/rc.d/init.d/squid script file

#!/bin/bash
# squid This shell script takes care of starting and stopping
# Squid Internet Object Cache
#
# chkconfig: - 90 25
# description: Squid - Internet Object Cache. Internet object caching is \
# a way to store requested Internet objects (i.e., data available \
# via the HTTP, FTP, and gopher protocols) on a system closer to the \
# requesting site than to the source. Web browsers can then use the \
# local Squid cache as a proxy HTTP server, reducing access time as \
# well as bandwidth consumption.
# pidfile: /var/run/squid.pid
# config: /etc/squid/squid.conf

PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# check if the squid conf file is present
[ -f /etc/squid/squid.conf ] || exit 0

# determine the name of the squid binary
[ -f /usr/sbin/squid ] && SQUID=squid
[ -z "$SQUID" ] && exit 0

# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
grep cache_dir | sed -e 's/cache_dir//' | \
cut -d ' ' -f 2`
[ -z "$CACHE_SWAP" ] && CACHE_SWAP=/cache

# default squid options
# -D disables initial dns checks. If you most likely will not to have an
# internet connection when you start squid, uncomment this
#SQUID_OPTS="-D"

RETVAL=0
case "$1" in
start)
echo -n "Starting $SQUID: "
for adir in $CACHE_SWAP; do
if [ ! -d $adir/00 ]; then
echo -n "init_cache_dir $adir... "
$SQUID -z -F 2>/dev/null
fi
done
$SQUID $SQUID_OPTS &
RETVAL=$?
echo $SQUID
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID
;;

stop)
echo -n "Stopping $SQUID: "
$SQUID -k shutdown &
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
rm -f /var/lock/subsys/$SQUID
while : ; do
[ -f /var/run/squid.pid ] || break
sleep 2 && echo -n "."
done
echo "done"
else
echo
fi
;;

reload)
$SQUID $SQUID_OPTS -k reconfigure
exit $?
;;

restart)
$0 stop
$0 start
;;

status)
status $SQUID
$SQUID -k check
exit $?
;;

probe)
exit 0;
;;

*)
echo "Usage: $0 {start|stop|status|reload|restart}"
exit 1
esac

exit $RETVAL

then following commands

chmod 700 /etc/rc.d/init.d/squid
chkconfig --add squid
chkconfig --level 345 squid on
chown -R squid.squid var
/usr/local/squid/sbin/squid -z
/usr/local/squid/sbin/squid
chmod 755 squid

when i restarted squid

the following errors coming

[root@localhost ~]# service squid restart
Stopping squid: FATAL: ERROR: Unknown policy lru

Squid Cache (Version 2.4.STABLE1): 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
done
Starting squid: init_cache_dir ufs... FATAL: ERROR: Unknown policy lru

Squid Cache (Version 2.4.STABLE1): 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
squid


my squid.conf is here

http_port 3128
udp_outgoing_address 255.255.255.255
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 32 MB
cache_dir ufs /var/spool/squid 100 16 256
ftp_user Squid@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck off
dns_retransmit_interval 25 seconds
dns_timeout 5 minutes
dns_nameservers 202.149.208.92
dns_nameservers 202.149.208.11
dns_nameservers 4.2.2.2
quick_abort_min 16 KB
quick_abort_max 16 KB
quick_abort_pct 95
connect_timeout 240 seconds
read_timeout 15 minutes
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#acl blocksites dstdomain .rediff.com
#acl blocksites dstdomain .facebook.com
#http_access deny blocksites
acl internalnetwork src 192.168.1.2 255.255.255.0
acl externalnetwork src 114.143.28.239 255.255.255.0
http_access allow internalnetwork
http_access deny externalnetwork
http_access allow localhost
http_access allow localhost
http_reply_access allow all
icp_access allow all
acl normal_service_net src 192.168.1.0/255.255.255.0
acl good_service_net src 192.168.1.0/255.255.255.0
tcp_outgoing_address 192.168.1.0 normal_service_net
tcp_outgoing_address 192.168.1.17 good_service_net
tcp_outgoing_address 192.168.1.18
httpd_accel_port 3128
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
dns_testnames micorosft.com
dns_testnames rediff.com
dns_testnames f3check.rediff.com
dns_testnames google.com
dns_testnames yahoo.com
dns_testnames hotmail.com
coredump_dir /var/spool/squid

acl accounts src 192.168.1.3 192.168.1.10 192.168.1.17
acl dematcdsl src 192.168.1.30 192.168.1.55 192.168.1.105 192.168.1.11
acl institute src 192.168.1.19 192.168.1.129
acl edp src 192.168.1.222 192.168.1.151
acl frontoffice src 192.168.1.201 192.168.1.47 192.168.1.109 192.168.1.211 192.168.1.22
http_access allow accounts
http_access allow dematcdsl
http_access allow institute
http_access allow edp
http_access allow frontoffice
http_access deny all

acl superusers src 192.168.1.222 192.168.1.105 192.168.1.3
http_access allow superusers
http_access allow internalnetwork

# delay pool conf
delay_pools 2
delay_class 1 2
delay_parameters 1 150000/150000 150000/150000
delay_access 1 allow superusers
delay_class 2 3
delay_parameters 2 110000/110000 8000/8000 100000/100000
delay_access 2 allow superusers


Please guide me what i done wrong or what i had missed

Regards

Satish
 
Old 10-27-2010, 03:00 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Quote:
cache_replacement_policy lru

memory_replacement_policy lru
Try adding these lines and restart squid.It may help.
 
Old 10-27-2010, 03:11 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Note that squid has to be configured with "--enable-removal-policies=lru"

Also you have to create the cache_dir (/var/spool/squid) if it doesn't exist, give it the right permissions and before trying to start squid for the 1st time, you have to run:
Code:
squid -z
to create the swap subdirectories in the above directory.

Regards
 
Old 10-28-2010, 10:25 PM   #4
satish
Member
 
Registered: Jan 2006
Posts: 172

Original Poster
Rep: Reputation: 15
squid with Redhat EN5

I had put cache_replacement_policy lru & memory_replacement_policy lru in the squid.conf and also configure with "--enable-removal-policies=lru but the same error coming any how i had formatted the drive and reinstalled the redhat 5 and just want to know to configure the squid tar ball with configure option.

I am sorry i had put the same question in also http://www.linuxquestions.org/questi...r-ball-840958/ i really apologized for that i will never do this. Since i am not an expert of linux so i ask questions in this forum and also got the solutions for that.

Please can you give me detail of configuring the squid from tarball for the arp acl and delay pools, please give the commands detail till the creating of script for starting squid and restarting squid.

Thanks

Regards
 
Old 10-29-2010, 02:50 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

First of all, since you're compiling squid from source, why aren't you using a more recent version (like 2.7 if you have some specific reasons to go with the 2.x version, or 3.1.8).
BTW the ./configure script you're using is good (just add --enable-removal-policies if you don't already done so).

That said, after compiling and installing squid, you should create the cache_dir, give it the rights permissions for the squid user/group and then run:
Code:
/usr/sbin/squid -z
to initialize the cache_dir and create the necessary subdirs.
Note: since you're using RHEL make sure SELinux is correctly configured for squid, or it's disabled.

If everything works as expected then try to start squid normally
Code:
/usr/sbin/squid
If you got any errors start squid in debug mode to get the errors on screen:
Code:
/usr/sbin/squid -N -d 5
Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redhat 9.0 Proxy [squid] nbaloch Linux - Networking 9 02-22-2007 10:56 PM
SQUID on Redhat 9.0 pcmxkeith Linux - Newbie 3 12-11-2006 05:05 AM
how to forwrd squid on redhat procfs Linux - Software 0 05-22-2006 04:53 AM
Redhat 9.0 Proxy [squid] nbaloch LinuxQuestions.org Member Intro 1 02-18-2005 07:59 AM
squid-2.5.STABLE1-3.9 with redhat 9 karenzi Linux - Wireless Networking 0 04-09-2004 04:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration