Wednesday, 7 January 2015

SQUID PROXY SERVER INSTALLATION ( VIDEO CACHE SERVER ) 1....

Squid is a proxy server that caches Internet content closer to a requestor than its original point of origin. Squid supports caching of many different kinds of Web objects, including those accessed through HTTP and FTP. Caching frequently requested Web pages, media files and other content accelerates response time and reduces bandwidth congestion.

Especially to create in the Youtube video caching....
Prerequisites :=>  * System Requirements: 2 GB RAM ,1 TB HARDDISK
                   * 2 LAN Card
                   * Updated Linux System
  
STEP 1:    Create "fw.sh" in etc folder
           Change permissions to an executable file 
           Edit this file with script given below=>

.......................................................................................................................                
#!/bin/sh
# -----------------------------------------------------------

SQUID_SERVER="
192.168.2.1"

INTERNET="
eth1"

LAN_IN=&
amp;quot;eth0"

SQUID_PORT="
8080"


iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
modprobe ip_conntrack
modprobe ip_conntrack_ftp
echo 1 &amp
;amp;amp;amp;amp;gt; /proc/sys/net/ipv4/ip_forward

iptables -P OUTPUT ACCEPT

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

iptables -A INPUT -i $INTERNET -m 
state --state ESTABLISHED,RELATED -j ACCEPT

iptables --table nat --append POSTROUTING
 --out-interface $INTERNET -j MASQUERADE
iptables --append FORWARD --in-interface $LAN_IN -j ACCEPT

iptables -A INPUT -i $LAN_IN -j ACCEPT
iptables -A OUTPUT -o $LAN_IN -j ACCEPT

iptables -t nat -A PREROUTING -i 
$LAN_IN -p tcp --dport 80 -j DNAT --to 
$SQUID_SERVER:$SQUID_PORT

iptables -t nat -A PREROUTING -i $INTERNET -p
 tcp --dport 80 -j REDIRECT --to-port $SQUID_PORT

iptables -A INPUT -j LOG

..........................................................................................................................

Make sure that connection  with internet has same name has  INTERNET in script and wlan connection as LAN_IN
Compile and execute the file

1 comment:

  1. what is this ..&??
    giving me error how to fix this?

    ReplyDelete