[ubuntu-in] Help with Squid, unable to start
Akshay Rao
akshay.jrao at yahoo.co.in
Tue Apr 3 03:09:54 BST 2007
hi,
i am getting the below mentioned error when i try to start squid dameon. :(
kindly help, i am desparate to get the internet sharing in my home lan..
error :
===========================================
akshay at aks-host:~$ sudo /etc/init.d/squid start
* Starting Squid HTTP proxy squid * Creating squid spool directory structure
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'
Squid Cache (Version 2.5.STABLE12): Terminated abnormally.
CPU Usage: 0.004 seconds = 0.004 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
/etc/init.d/squid: line 64: 8820 Aborted $DAEMON -z
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'
Squid Cache (Version 2.5.STABLE12): Terminated abnormally.
CPU Usage: 0.004 seconds = 0.000 user + 0.004 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
/etc/init.d/squid: line 64: 8822 Aborted start-stop-daemon --quiet --start --pidfile $PIDFILE --chuid $CHUID --exec $DAEMON -- $SQUID_ARGS </dev/null
[fail]
===========================================
i have given my network configuration below , and the steps i followed to setup squid.
i used the link here to set up the squid configuration :
http://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html
what is this "visible_hostname" ? is it really necessary to give it? in the procedure i followed i did not seem to find that step.
*******************************************************************
this is my network configurations on the PC connected to internet directly
Eth1 (connects to internet)
IP : 192.168.1.100
NetMask : 255.255.255.0
Gateway : 192.168.1.1
DNS : 61.1.96.69
Eth0 (connects to the other dapper machine)
IP : 192.168.2.1
NetMask : 255.255.255.0
Gateway : (left blank)
DNS : (left blank)
this is the network configuration on the PC in LAN, connected the above pc
Eth0 : 192.168.2.2
NetMask : 255.255.255.0
Gateway : 192.168.2.1 (ip address of the former pc)
DNS : (left blank)
********************************************************************
i installed squid on the comp that is connected to the network,
i added these lines in the squid.conf file :
----------------------------------------------------------------------------------------------------------------------
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 192.168.2.0/255.255.255.0 192.168.1.0/255.255.255.0
http_access allow lan
http_access deny all
-----------------------------------------------------------------------------------------------------------------------
then i set the iptables to route packets coming at port 80
using the following shell script
-----------------------------------------------------------------------------------------------------------------------
#! /bin/bash
# squid server IP
SQUID_SERVER=192.168.1.1
# Interface connected to Internet
INTERNET=eth1
# Interface connected to LAN
LAN_IN=eth0
# Squid port
SQUID_PORT=3128
# DO NOT MODIFY BELOW
# Clean old firewall
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# Load IPTABLES modules for NAT and IP conntrack support
modprobe ip_conntrack
modprobe ip_conntrack_ftp
# For win xp ftp client
#modprobe ip_nat_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow UDP, DNS and Passive FTP
iptables -A INPUT -i $INTERNET -m state --state ESTABLISHED,RELATED -j ACCEPT
# set this system as a router for Rest of LAN
iptables --table nat --append POSTROUTING --out-interface $INTERNET -j MASQUERADE
iptables --append FORWARD --in-interface $LAN_IN -j ACCEPT
# unlimited access to LAN
iptables -A INPUT -i $LAN_IN -j ACCEPT
iptables -A OUTPUT -o $LAN_IN -j ACCEPT
# DNAT port 80 request comming from LAN systems to squid 3128 ($SQUID_PORT) aka transparent proxy
iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j DNAT --to $SQUID_SERVER:$SQUID_PORT
# if it is same system
iptables -t nat -A PREROUTING -i $INTERNET -p tcp --dport 80 -j REDIRECT --to-port $SQUID_PORT
# DROP everything and Log it
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
-----------------------------------------------------------------------------------------------------------------------
regards,
Akshay
aka :
techKyLa @ irc.freenode.net #ubuntu-in, #linux-india
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-in/attachments/20070403/5054fa65/attachment-0001.htm
More information about the ubuntu-in
mailing list