Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Thanks all of you for your ans. I understand the problem now and i move into squid server. First of all i install a squid server on my server PC[I am using CentOS 5.5].
First i download a yum package:

yum install squid

Then i configure the squid server in this way:

vi /etc/squid/squid.conf

Add Those line into squid.conf file:

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl localhost src
acl lan src
http_access allow localhost
http_access allow lan

And then save and exit [As i use as a real IP in eth2 and the sub network in eth0 as]. Then Add a file:

cat > /etc/fw.proxy

Then add Those line into the fw.proxy file:

# ------------------------------------------------------------------------------------
# See URL:
# (c) 2006, nixCraft under GNU/GPL v2.0+
# -------------------------------------------------------------------------------------
# squid server IP
# Interface connected to Internet
# Interface connected to LAN
# Squid port
# 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
# 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

Then save the script. And Execute the script:

chmod +x /etc/fw.proxy
service iptables save
chkconfig iptables on

Then restart the proxy server: /etc/init.d/squid restart But this cause a output like this:

Stopping squid:                                            [FAILED]
init_cache_dir /var/spool/squid... /etc/init.d/squid: line 62:  8990 Aborted                 $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
Starting squid: /etc/init.d/squid: line 42:  8991 Aborted                 $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1

In my "/var/log/messages" i find this two line:

Dec 27 06:48:42 ns1 squid[8990]: Could not determine fully qualified hostname.  Please set 'visible_hostname' 
Dec 27 06:48:45 ns1 squid[8991]: Could not determine fully qualified hostname.  Please set 'visible_hostname'

Please someone help me to solve this problem.

share|improve this question
If you refer to some previous question (which you must have posted as another user, as this one is your first question for this userid), at least link to it so a reader can get some context. – Sven Dec 27 '11 at 12:23
For reference, the first question this user asked is here. – Ben Pilbrow Dec 27 '11 at 14:10

I am not what you need to do about the first error. I think it is a good idea to look at the script /etc/init.d/squid at the indicated line and see the failed command. For the second error:

Dec 27 06:48:42 ns1 squid[8990]: Could not determine fully qualified hostname.  Please set 'visible_hostname'

You need to set the value of visible_hostname in squid.conf file such as:

visible_hostname myproxy
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.