IKLAN

Pelatihan
&
Jasa Setting Proxy High Perfomance

Di Jamin Youtube tercache & Game online terupdate cepat
  • Pelatihan & Setting On the site
Mobile Phone:085868788968
Pin BB:52595EA2
BUTUH MOBIL BARU/BEKAS?

DP minimal 30 % dari harga mobil baru atau bekas. Syarat untuk karyawan/pns: Fotokopi KTP pemohon, Kartu Keluarga, Rincian Gaji, Rekening Listrik, Surat/Akta nikah, Telepon, PDAM, PBB, Rekening Tabungan & NPWP
Syarat untuk wiraswata:Plus SIUP/TDP, Laporan keuangan terakhir
Contact Person : Eka (082227594993)
Pin BB : 52595EA2

Jasa Pembuatan RT RW Net dan Warnet

Modal Hanya 5 JT-an..!!!

Meliputi:

=>Radio Access Point TP-LINK

=>Antena OMNI

=>Pigtail

=>Kabel UTP 25 meter

=>CPU P3 Mikrotik 2nd, CPU Dual COre Proxy Server 2nd dan Tower 3 Pipa Galvanis

Keuntungan

=>Lebih Murah dalam 1 paket komplit

=>RT/RW-Net Siap Pakai

=>PJK akan membantu promosi

Call/SMS = 085868788968
Pin BB :52595EA2


SEWA MOBIL PEKALONGAN DAN BATANG
Sewa/Carter Mobil Dalam Kota / Luar Kota (Se-Jawa) + Sopir.
Hubungi: Eka HP: 085868788968 / 082227594993
Pin BB : 52595EA2
Alamat:
Jl. Akasia Raya No.5 Perumahan Kalisalak Batang
Jl. Trapesium 3 No.15 Perumahan Limas Indah Pekalongan


SPACE INI DI SEWAKAN UNTUK IKLAN

Hubungi :

Mobile Phone:085868788968
Pin BB:52595EA2




Popular Posts

Ubuntu Networking Configuration Using Command Line

The basics for any network based on *nix hosts is the Transport Control Protocol/ Internet Protocol (TCP/IP) combination of three protocols. This combination consists of the Internet Protocol (IP),Transport Control Protocol (TCP), and Universal Datagram Protocol (UDP).

By Default most of the users configure their network card during the installation of Ubuntu. You can however, use the ifconfig command at the shell prompt or Ubuntu’s graphical network configuration tools, such as network-admin, to edit your system’s network device information or to add or remove network devices on your system

Configure Network Interface Using Command-Line

You can configure a network interface from the command line using the networking utilities. You configure your network client hosts with the command line by using commands to change your current settings or by editing a number of system files.

Configuring DHCP address for your network card

If you want to configure DHCP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

Note :- Use vi editor if you don’t have GUI installed

If you have GUI use the following command

gksudo gedit /etc/network/interfaces

# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp

Configuring Static IP address for your network card

If you want to configure Static IP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

Note :- Use vi editor if you don’t have GUI installed

If you have GUI use the following command

gksudo gedit /etc/network/interfaces

# The primary network interface

auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting up Second IP address or Virtual IP address in Ubuntu

If you are a server system administrator or normal user some time you need to assign a second ipaddress to your Ubuntu machine.For this you need to edit the /etc/network/interfaces file and you need to add the following syntax.Below one is the only example you need to chnage according to your ip address settings

sudo vi /etc/network/interfaces

Note :- Use vi editor if you don’t have GUI installed

If you have GUI use the following command

gksudo gedit /etc/network/interfaces

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x

You need to enter all the details like address,netmask,network,broadcast and gateways values after entering all the values save this file and you need to restart networking services in debian using the following command to take effect of our new ipaddress.

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting your ubuntu stytem hostname

Setting up your hostname upon a ubuntu installation is very straightforward. You can directly query, or set, the hostname with the hostname command.

As an user you can see your current hostname with

sudo /bin/hostname

Example

To set the hostname directly you can become root and run

sudo /bin/hostname newname

When your system boots it will automatically read the hostname from the file /etc/hostname

If you want to know more about how to setup host name check here

Setting up DNS

When it comes to DNS setup Ubuntu doesn’t differ from other distributions. You can add hostname and IP addresses to the file /etc/hosts for static lookups.

To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

For example a machine which should perform lookups from the DNS server at IP address 192.168.3.2 would have a resolv.conf file looking like this

sudo vi /etc/resolv.conf

Note :- Use vi editor if you don’t have GUI installed

If you have GUI use the following command

gksudo gedit /etc/resolv.conf

enter the following details

search test.com
nameserver 192.168.3.2

Cache Youtube videos using Squid in Ubuntu Linux

It is well known fact that nowadays more and more ISPs in the world use Ubuntu driven servers as proxies, domain name servers, routers etc. Squid is one the major open source web caching proxy software for Ubuntu and Linux as a whole. Term ‘caching‘ means a way to store Internet objects on locally deployed proxy server for sake of reducing bandwidth consumption and access time to popular web content. You may read more about squid caching software at wikipedia or squid-cache.org.

Youtube videos can also be cached and squid web caching proxy under Ubuntu is reasonable choice for this purpose. It’s common practice when one user downloads some very popular youtube video and then shares its URL to other users withing the same organization. Caching of such youtube video using squid will definitely save Internet connection bandwidth and traffic as every time users download that video it will be fetched from local web cache rather than from youtube servers.

Use Synaptic package manager to install squid package, here is the line to get it installed using terminal:

sudo aptitude install squid

(please notice that youtube caching requires squid of at least 2.7STABLE6 version).

Once installed you should edit /etc/squid/squid.conf (main configuration of squid proxy) to apply configuration necessary to cache video from youtube. Below is an example of such configuration file for squid-2.7STABLE9 so you are welcome to open squid.conf with your favorite text file editor and copy/paste below config into it.

1. Open terminal and type the following commands to get started:

sudo echo -n > /etc/squid/squid.conf

(this cleans default squid.conf configuration file)

sudo gedit /etc/squid/squid.conf

(paste below configuration example and save changes)

http_port 3128
access_log none
coredump_dir none
cache_dir ufs /var/spool/squid/ 10000 16 256

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl ssl_ports port 443
acl safe_ports port 80 21 443 1025-65535
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !safe_ports
http_access deny CONNECT !ssl_ports
http_access allow all
icp_access deny all
acl QUERY2 urlpath_regex get_video\? videoplayback\? videodownload\?
cache allow QUERY2
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl youtube dstdomain .youtube.com
cache allow youtube
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern -i \.flv$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
refresh_pattern (get_video\?|videoplayback\?|videodownload\?) 5259487 99999999% 5259487 override-expire ignore-reload negative-ttl=0
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 0% 4320

quick_abort_min -1 KB
maximum_object_size 4 GB
minimum_object_size 512 bytes

acl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id)
storeurl_access allow store_rewrite_list
storeurl_access deny all

storeurl_rewrite_program /etc/squid/storeurl.pl
storeurl_rewrite_children 1
storeurl_rewrite_concurrency 10

2. Create /etc/squid/storeurl.pl file:

sudo gedit /etc/squid/storeurl.pl

(paste below configuration example and then save changes)

#!/usr/bin/perl

$|=1;
while (<>) {
@X = split;
$x = $X[0];
$_ = $X[1];

if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&(itag=[0-9]*).*?\&(id=[a-zA-Z0-9]*)/) {
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $2 . "&" . $3 . "\n";

} else {
print $x . $_ . "\n";
}
}

3. Apply execution bit to /etc/squid/storeurl.pl, here is terminal command for this:

sudo chmod +x /etc/squid/storeurl.pl

4. Now it’s time to start squid daemon:

sudo service squid start

In order to check it squid was started successfully type the following command:

sudo netstat -lnp | grep 3128

It should show one line in case of success. You can also point Ubuntu browser to 127.0.0.1:3128 as a proxy and try loading some web page like www.ubuntuka.com which could also set as a start page there :-)

Setup Ubuntu squid proxy server - Introduction, installation and basic configuration guide for beginner

Squid is an open source caching proxy server. As a cache proxy server, squid accepts request data from client and passes it to appropriate Internet server. It keeps a copy of the returned data, especially hot objects cached in RAM. Squid also caches DNS lookups and supports non-blocking DNS lookups. Even when a client terminates a request, squid continues to fetch and complete the requested data. When it receives the same request again from other client, it just passes the stored data in its cache. This is the basic concept of how squid works, speeding up the Internet access and saving bandwidth.

Other than http protocol, squid supports FTP, gopher, and HTTP data objects. Squid also supports other caching protocols too, such as:

Internet cache protocol (ICP)
Cache digests
Simple network management protocol (SNMP)
Hyper text caching protocol (HTCP)

A cache proxy server can greatly improve Internet performance and squid cache proxy server is very fast and well known for high performance caching proxy server in Linux world. A normal firewall proxy does not store copy of returned data like squid does. Squid cache proxy server works great with firewall on the upper level and squid in the lower level protecting local network from each other.
Setup squid cache proxy server in Ubuntu

Before setting up a squid cache proxy server, you should consider several things that will influence the performance of the caching server later. The most important things are server hardware.
Basic hardware requirements

As we already know, squid stores meta data especially hot objects cached in RAM. So having a big RAM will improve squid performance and overall server performances. However, cpu power doesn't really effect squid performance.

While keeping all caches in the hard disk, having a fast random-seek-time hard disk would boost squid performances. A high rpm hard disk is good but the price is higher. You would better consider adding extra hard disk with fast random-seek-time because having many hard disk also improve squid performances.
Install squid proxy in Ubuntu

You can check whether squid is already installed by checking squid service with ps command. To simply grab a running squid service with ps command, add | (pipe) and grep option like the example below:

luzar@ubuntu:~$ ps aux | grep squid
luzar 5667 0.0 0.1 3236 796 pts/0 S+ 16:45 0:00 grep squid
luzar@ubuntu:~$

So there is no squid process running in our system. Then we can install squid package using apt-get package management system. Example of squid package installation in Ubuntu using apt-get:

luzar@ubuntu:~$ sudo apt-get install squid
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openssl-blacklist squid-common ssl-cert
Suggested packages:
squidclient squid-cgi logcheck-database resolvconf smbclient winbind
The following NEW packages will be installed:
openssl-blacklist squid squid-common ssl-cert
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 7542kB of archives.
After this operation, 19.5MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com intrepid/main openssl-blacklist 0.4.2 [6337kB]
4% [1 openssl-blacklist 360983/6337kB 5%] 4770B/s 25min5s

As you can see, squid file is quite big. So the downloading and installation is going to take some times. After the installation is finished, you can begin configuring squid as a caching proxy server.
Configure squid caching proxy server in Ubuntu

Squid configuration file is in /etc/squid directory. So change directory to /etc/squid and see what we have there.

luzar@ubuntu:~$ cd /etc/squid/
luzar@ubuntu:/etc/squid$ ls
squid.conf
luzar@ubuntu:/etc/squid$

We just have one file, squid.conf, which is the main configuration file for squid. For a safety reason, we will make a copy of squid.conf as a backup before we start editing the file. Here is a command to copy squid.conf:

luzar@ubuntu:/etc/squid$ sudo cp squid.conf squid.conf.bac
luzar@ubuntu:/etc/squid$ ls -l
total 344
-rw------- 1 root root 168394 2008-12-24 16:20 squid.conf
-rw------- 1 root root 168394 2008-12-24 17:07 squid.conf.bac
luzar@ubuntu:/etc/squid$

Here is a step by step guide on how to configure a basic squid caching proxy server. Open squid.conf with your favorite text editor. Here is an example using vim editor :

luzar@ubuntu:/etc/squid$ sudo vim squid.conf
[sudo] password for luzar:

This is an example of squid.conf file when you open it with vim editor:
squid.conf screenshot

Go to the line http_port. We are going to set http port for the squid caching proxy server. You can set port as in example below:

Tips: If you are using vim, in command mode, type /term to search for the term you are looking for. Pres n to find the next occurrence of the search term. Squid.conf is quite a big file for you to scroll.

# Squid normally listens to port 3128
http_port 3128

Next, we are going to set cache directory for our squid caching proxy server. The cache_dir is disabled by default. You can copy that line and add your preferred cache directory size for your caching proxy server. You can set more than one cache directory if you have many partitions and named the cache directory as cache1, cache2, cache3, so forth.

#Default:
# cache_dir ufs /var/spool/squid 100 16 256
cache_dir ufs /var/spool/squid/cache1 1000 16 256

The value 100 after cache directory is the size value in MB. Set it according to your need. Remember that the cache directory must be empty. In the example above, I set it to 1000MB. The second and third values (16 256) are sub directory first and second tier.

We can set administrator email address in cache_mgr so email can automatically sent to us if squid dies.

#Default:
# cache_mgr webmaster
cache_mgr webmaster

Another important configuration we need to set is squid log. Squid log can be set in access_log parameter. This is the default path and file used:

# And priority could be any of:
# err, warning, notice, info, debug.
access_log /var/log/squid/access.log squid

Squid automatically create a default user proxy and a group proxy during the installation. Enable those names in the cache_effective_user and cache_effective_group in squid.conf file.

#Default:
# cache_effective_user proxy
cache_effective_user proxy

#Default:
# none
cache_effective_group proxy

Enable ftp anonymous user if you need that.

#Default:
# ftp_user Squid@
ftp_user Squid@

Now we need to set simple access control (acl) to allow ip address in our local network. Search for the acl localnet line and add your local area network ip addresses.

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
# acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
# acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
# acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl local_itnet src 192.168.0.0/255.255.255.0 # IT network
acl local_admnet src 192.168.1.0/255.255.255.0 # Admin network

Enable http_access from local network:

#Allow HTTP queries from local networks only
http_access allow acl local_itnet
http_access allow acl local_admnet
http_access deny all

Tips: Only allow ip address in your network.

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
acl local_itnet src 192.168.0.0/255.255.255.0 # It networkhttp_access allow localnet
acl local_admnet src 192.168.1.0/255.255.255.0 # Admin networkhttp_access allow localnet

Allow icp from local network:

#Allow ICP queries from local networks only
icp_access allow acl local_itnet
icp_access allow acl local_admnet
icp_access deny all

That covers all the basic squid configurations. Now we can restart squid service:

lluzar@ubuntu:/etc/squid$ sudo vim squid.conf
luzar@ubuntu:/etc/squid$ sudo /etc/init.d/squid restart
* Restarting Squid HTTP proxy squid [ OK ]
luzar@ubuntu:/etc/squid$

Step by step configuring and monitoring Squid 2.7 STABLE in Ubuntu 10.04

Squid is such us web-caching program running on both Linux or windows operation system. Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL (http://www.squid-cache.org/) at this time squid has been up to version 2.7.
To build a successfully proxy server needs a preparation and little it knowledge of server administration, in this article we will explain step by step how to configuring and monitoring Squid Proxy server in Ubuntu 10.04. Before we start to install, setting then tuning Squid 2.7 better if we prepare system environment to support the performance of squid proxy server then.
We need resources at least CPU using processor Intel Pentium 4 (or equivalent), RAM 1 GB (Minimal) and HDD 40 GB (Minimal) ,latest Ubuntu Version (10.04) and internet connection to get/Install Ubuntu package. If all resources is ready let start to make a 'robust' proxy server.

Install Ubuntu 10.04 into Hard drive, Don't forget to use 'advance' mode to setup a partition, then make partition called '/cache' where cache will be placed with size approximately 10 GB (we can re-size latter).
If all installation progress is finished and successfully, go to application > accessories > terminal to install squid proxy server by command.

apt-get install squid

You already have Squid 2.7 installed in your hard-drive now, you can start configuring your proxy server by editing squid configuration file in '/etc/squid/squid.conf', you can download this squid configuration or searching by Google with keywords : high performance squid proxy server setting".
Build a squid caching file *type this command in your terminal

/usr/sbin/squid -z

Running test your squid performance. *type this command in your terminal

/usr/sbin/squid -NCd1

Restart Squid,your proxy server is ready to use now.

/etc/ini.d/squid restart

To get best performance of squid proxy server we have to reconfiguring/tuning several times, we can use application which help us to controlling and monitoring a squid performance, In this section we have 3 different application (same purpose) which can help us to monitoring/controlling a squid performance.

Squid Cache Manager (cachemgr), is default application for squid (not default installed) to monitor and tuning a squid performance, we can install cache-mgr by typing command 'apt-get install squid-cgi' on terminal, before we can use cache-mgr setting user and password in /etc/squid/squid.conf then access via browser by address http://localhost/cgi-bin/cachemgr.cgi.
Calamaris, is not official squid monitoring program but very recommended to use, you can go to this link to see the example of calamaris report sheet. we can install calamaris by typing command 'apt-get install calamaris' on terminal. Before we could read calamaris report sheet we must generate first using command 'calamaris -a -F html /var/log/squid/access.log > /var/www/calamaris/index.html' the access the report in 'http://localhost/calamaris'.
Sarg - Squid Analysis Report Generator is a tool that allow you to view "where" your users are going to on the Internet. Sarg provides many information about Squid users activities: times, bytes, sites, etc (http://sarg.sourceforge.net/). Sarg is closed to squid monitoring 'activity' program rather than squid performance monitoring tools, as example using Sarg we can see who is the most active client/user and where they going. To install Sarg we can use terminal by typing command 'apt-get install calamaris'.

We can also install third-party application such us webmin to help configuring, tuning, and maintaining a squid proxy server, i hope this article will help you :).

Pemantauan Kinerja Squid

Idealnya pemantauan kinerja Squid adalah saat dia kerja keras dg beban terberat, jangan pas sepi atau idle. Sebenarnya statistik per 60 menit lebih mencerminkan kinerjanya tetapi jika pengguna browsing hanya sebentar-2 yg tidak akan terlalu tampak juga. Jadi pas jam padat saja ujicobanya (mungkin warnet 2 jam digratiskan begitu, he he he ... sekalian promosi utk iklan ... hanya usul lho, jangan serius). Kalau mau eksperimen lebih jauh sampai detail kinerja Squid anda terindentifikasi ya pakai saja web polygraph. Tapi konfigurasinya sangat rumit lho ... dan butuh 3 mesin, kalau tidak salah (dulu asisten saya yg mengerjakan, he he he ....).

Request Hit Ratios
Seberapa tinggi Squid bisa menyimpan permintaan akses suatu url (alamat situs) dan faktor ini ditentukan oleh besarnya ipcache_size dan dibantu oleh fqdn_cache, selama memori masih mengijinkan tentunya. Hit ratios ini seharusnya lumayan tinggi utk beberapa situs populer.

Byte Hit Ratios
Hit Ratios ini menentukan faktor penghematan bw anda dg mengambil obyek dari cache swap Squid, baik yg ada di memori atau hardisk. Semakin tinggi hit ratio-nya semakin hemat bw anda tapi hati2 soalnya malah bisa jadi lambat aksesnya jika hardisk anda tidak mampu melayani permintaan obyek yg boleh jadi sangat intensif.

Request Memory Hit Ratios
Permintaan obyek yg di-cache memori, tetapi krn kita juga mengejar responsiveness maka cache_mem kita buat kecil dan hit rasio ini mjd sangat rendah. Jika h/w anda papan atas maka cache_mem bisa ditingkatkan lebih jauh (pengalaman saya pernah ada mesin yg cache_mem sampai 24 MB masih sangat responsif). Siapa tahu dg mesin2 yg sangat hebat bahkan bisa sampai 1/3 memori fisik spt yg disarankan di squid-cache org.

Request Disk Hit Ratios
Hit Rasio ini ditentukan oleh obyek2 yg ditemukan (sudah disimpan) di hardisk dan krn Memory Hit Ratiosnya sangat kecil, disk hit ratio ini biasanya hampir sama dg Byte Hit Ratio (alasannya ya hampir semua obyek cache disimpan di hardisk, dan yg disimpan di memori hanya sbg penggembira saja, ha ha ha ...)

Squid agresif jika hit rasionya kisarannya 50% (di atas lebih baik tapi harus tetap responsif), kecuali memory hit ratio lho. Responsif jika request dilayani dg cepat (kalau bisa angka reratanya dipertahankan di bawah 100ms). Silahkan dilihat di topik 'sharing stats'.

Putra Jaya Komputer (PJK)

Jasa-jasa yang di layani :
- Pemeliharaan & reparasi Laptop
- Perbaikan CPU & Monitor
- Instalasi LAN (Jaringan lokal) menggunakan kabel atau nirkabel (WIFI)
- Instalasi MIKROTIK (berbagai konfigurasi)
- Instalasi SQUID PROXY SERVER (untuk mempercepat akses internet)
- Instalasi Sistem Operasi (Linux, Windows dsb.)
- Instalasi pembangunan RTRW-NET,WARNET & HOTSPOT AREA
- Pelatihan singkat tentang MIKROTIK & SQUID PROXY SERVER

PJK juga sebagai pengelola JARINGAN WIFI INTERNET di Kecamatan Batang,Kabupaten Batang & Kecamatan Pekalongan Utara,Kota Pekalongan

Alamat:
Jl.Akasia Raya No.5 Perum.Kalisalak,Kauman,Batang
Flexi: 0285 7990476 Telkomsel: 0852-9390-3200 Indosat:0858-6911-1678

LUSCA proxy di CentOS 5.5, Konfigurasi dan Tunning

Lusca bertujuan untuk memperbaiki kekurangan-2 dalam basis kode sementara squid, serta menjaga kestabilan fungsionalitas dan stabilitas Squid.
mendukung mayoritas HTTP/1.1 HTTP/1.0
Mendukung protokol dan caching untuk merekonstruksi : konten load balancing HTTP, kegagalan, permintaan cerdas / jawaban routing, memori dengan kinerja tinggi dan cache disk, sistem kontrol akses yang fleksibel
Peningkatan kinerja yang lebih cepat karena memperbaiki kelemahan squid proxy
Menangani local cache Content dynamic
web proxy / cache platform dengan kinerja lebih stabil, fitur lebih banyak dan skalabilitas yang dynamis.
mendukung cpu single core ataupun multicore
Lusca terus meliputi perbaikan dan perkembangan dari proyek Squid

[root@lusca-proxy ~]# yum install squid
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
addons | 951 B 00:00
addons/primary | 202 B 00:00
base | 2.1 kB 00:00
base/primary_db | 1.6 MB 00:02
extras | 2.1 kB 00:00
extras/primary_db | 188 kB 00:00
updates | 1.9 kB 00:00
updates/primary_db | 840 kB 00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package squid.i386 7:2.6.STABLE21-6.el5 set to be updated
--> Processing Dependency: perl(URI::URL) for package: squid
--> Running transaction check
---> Package perl-URI.noarch 0:1.35-3 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
squid i386 7:2.6.STABLE21-6.el5 base 1.3 M
Installing for dependencies:
perl-URI noarch 1.35-3 base 116 k

Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)

Total download size: 1.4 M
Is this ok [y/N]: y


Setelah terinstall maka kita remove lagi


[root@lusca-proxy ~]# yum remove squid
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package squid.i386 7:2.6.STABLE21-6.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
squid i386 7:2.6.STABLE21-6.el5 installed 3.5 M

Transaction Summary
================================================================================
Remove 1 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)

Is this ok [y/N]: y


Setelah itu kita install paket yang di butuhkan untuk kompilasi LUSCA yaitu :
- automake
- gcc
- glibc-devel
- e2fsprogs-devel
- sharutils


[root@lusca-proxy ~]# yum install automake gcc glibc-devel e2fsprogs-devel sharutils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package automake.noarch 0:1.9.6-2.3.el5 set to be updated
--> Processing Dependency: autoconf >= 2.58 for package: automake
---> Package e2fsprogs-devel.i386 0:1.39-23.el5_5.1 set to be updated
--> Processing Dependency: e2fsprogs-libs = 1.39-23.el5_5.1 for package: e2fspro gs-devel
---> Package gcc.i386 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: cpp = 4.1.2-48.el5 for package: gcc
--> Processing Dependency: libgomp >= 4.1.2-48.el5 for package: gcc
---> Package glibc-devel.i386 0:2.5-49.el5_5.7 set to be updated
--> Processing Dependency: glibc-headers = 2.5-49.el5_5.7 for package: glibc-dev el
--> Processing Dependency: glibc = 2.5-49.el5_5.7 for package: glibc-devel
--> Processing Dependency: glibc-headers for package: glibc-devel
---> Package sharutils.i386 0:4.6.1-2 set to be updated
--> Running transaction check
---> Package autoconf.noarch 0:2.59-12 set to be updated
--> Processing Dependency: imake for package: autoconf
---> Package cpp.i386 0:4.1.2-48.el5 set to be updated
--> Processing Dependency: e2fsprogs-libs = 1.39-23.el5 for package: e2fsprogs
---> Package e2fsprogs-libs.i386 0:1.39-23.el5_5.1 set to be updated
--> Processing Dependency: glibc = 2.5-49 for package: nscd
---> Package glibc.i686 0:2.5-49.el5_5.7 set to be updated
--> Processing Dependency: glibc-common = 2.5-49.el5_5.7 for package: glibc
---> Package glibc-headers.i386 0:2.5-49.el5_5.7 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
--> Processing Dependency: kernel-headers for package: glibc-headers
---> Package libgomp.i386 0:4.4.0-6.el5 set to be updated
--> Running transaction check
---> Package e2fsprogs.i386 0:1.39-23.el5_5.1 set to be updated
---> Package glibc-common.i386 0:2.5-49.el5_5.7 set to be updated
---> Package imake.i386 0:1.0.2-3 set to be updated
---> Package kernel-headers.i386 0:2.6.18-194.26.1.el5 set to be updated
---> Package nscd.i386 0:2.5-49.el5_5.7 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
automake noarch 1.9.6-2.3.el5 base 476 k
e2fsprogs-devel i386 1.39-23.el5_5.1 updates 569 k
gcc i386 4.1.2-48.el5 base 5.2 M
glibc-devel i386 2.5-49.el5_5.7 updates 2.0 M
sharutils i386 4.6.1-2 base 201 k
Installing for dependencies:
autoconf noarch 2.59-12 base 647 k
cpp i386 4.1.2-48.el5 base 2.6 M
glibc-headers i386 2.5-49.el5_5.7 updates 602 k
imake i386 1.0.2-3 base 319 k
kernel-headers i386 2.6.18-194.26.1.el5 updates 1.1 M
libgomp i386 4.4.0-6.el5 base 70 k
Updating for dependencies:
e2fsprogs i386 1.39-23.el5_5.1 updates 977 k
e2fsprogs-libs i386 1.39-23.el5_5.1 updates 118 k
glibc i686 2.5-49.el5_5.7 updates 5.3 M
glibc-common i386 2.5-49.el5_5.7 updates 16 M
nscd i386 2.5-49.el5_5.7 updates 166 k

Transaction Summary
================================================================================
Install 11 Package(s)
Upgrade 5 Package(s)

Total download size: 37 M
Is this ok [y/N]:y

selesai install paket-paket di atas kemudian download LUSCA nya dari google

[root@lusca-proxy ~]#wget http://lusca-cache.googlecode.com/files/LUSCA_HEAD-r14809.tar.gz


Setelah itu di extrak


[root@lusca-proxy ~]# tar -zxvf LUSCA_HEAD-r14809.tar.gz


Pindah ke dalam direktori lusca, naikkan filedescriptors, dan kemudian configure menggunakan opsi-opsi di bawah ini

[root@lusca-proxy ~]# cd LUSCA_HEAD-r14809
[root@lusca-proxy ~]# ulimit -n 8192
[root@lusca-proxy LUSCA_HEAD-r14809]# ./configure --prefix=/usr/local/squid --exec-prefix=/usr/local/squid --enable-delay-pools --enable-cache-digests --enable-poll --enable-linux-netfilter --enable-removal-policies --with-maxfd=8192 --enable-storeio=aufs --disable-wccp --enable-x-accelerator-vary --enable-kill-parent-hack --enable-async-io=30 --disable-ident-lookups


semua file instalasi terletak di /usr/local/squid/ jadi kita tidak akan repot-repot mencari-cari file squid

Kemudian install

[root@lusca-proxy LUSCA_HEAD-r14809]# make all && make install


menunggu instalasi selesai sekarang waktu nya Konfigurasi.
- Pindah ke direktori /usr/local/squid/etc

[root@lusca-proxy LUSCA_HEAD-r14809]# cd /usr/local/squid/etc/


kemudian config squid nya kaya gini nih,..

##start of config
http_port 3128 transparent
icp_port 0
#icp_port 3130

pid_filename /var/run/squid.pid
cache_effective_user squid
cache_effective_group squid
#error_directory /usr/share/squid/errors/templates
#icon_directory /usr/share/squid/icons
visible_hostname lusca.net
cache_mgr admin@localhost
access_log /cache1/access.log
cache_log /cache1/cache.log
cache_store_log none
logfile_rotate 1
shutdown_lifetime 10 seconds


####################################################################
# Allow local network(s) on interface(s)
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.25.0/24 # RFC1918 possible internal network
####################################################################

uri_whitespace strip
#dns_nameservers
#dns_testnames 127.0.0.1

cache_mem 8 MB
maximum_object_size_in_memory 128 MB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA

cache_dir aufs /cache1 32768 64 256

minimum_object_size 512 bytes
maximum_object_size 128000 KB
offline_mode off
cache_swap_low 98
cache_swap_high 99

# No redirector configured

# Setup some default acls
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 1025-65535
acl sslports port 443 563 81
acl manager proto cache_object
acl purge method PURGE
acl connect method CONNECT
#acl dynamic urlpath_regex cgi-bin \?

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !safeports
http_access deny CONNECT !sslports

# Always allow localhost connections
http_access allow localhost

# Allow local network(s) on interface(s)
http_access allow localnet

# Default block all to be sure
http_access deny all

#include /usr/local/squid/etc/storeurl-el5.pl
include /usr/local/squid/etc/tunning.conf

##end of config


terus save.as storeurl.pl


#!/usr/bin/perl5.8.8
# by chudy_fernandez@yahoo.com
# Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (<>) {
@X = split;
$X[1] =~ s/&sig=.*//;
$x = $X[0] . " ";
$_ = $X[1];
$u = $X[1];


# compatibility for old cached get_video?video_id
if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $z . "\n";

# youtube HD itag=22
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&(itag=22).*?\&(id=[a-zA-Z0-9]*)/) {
print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $2 . "&" . $3 . "\n";

# youtube Normal screen always HD itag 35, Normal screen never HD itag 34, itag=18 <--normal? } elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&(itag=[0-9]*).*?\&(id=[a-zA-Z0-9]*)/) { print $x . "http://video-srv.youtube.com.SQUIDINTERNAL/" . $3 . "\n"; } elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) { print $x . "http://www.google-analytics.com/__utm.gif\n"; #Cache High Latency Ads } elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com)(.*)/) { $y = $3;$z = $2; for ($y) { s/pixel;.*/pixel/; s/activity;.*/activity/; s/(imgad[^&]*).*/\1/; s/;ord=[?0-9]*//; s/;×tamp=[0-9]*//; s/[&?]correlator=[0-9]*//; s/&cookie=[^&]*//; s/&ga_hid=[^&]*//; s/&u_his=[^&]*//; s/&dt=[^&]*//; s/&lmt=[^&]*//; s/(&alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/; s/(&url=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/; s/(&ref=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/; s/(&cookie=http%3A%2F%2F[^(%2F)]*)[^&]*/\1/; s/[;&?]ord=[?0-9]*//; s/[;&]mpvid=[^&;]*//; } print $x . "http://" . $1 . $2 . $y . "\n"; #cache high latency ads } elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) { print $x . "http://" . $1 . "/" . $2 . "\n"; # spicific servers starts here.... } elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) { print $x . "http://" . $1 . "\n"; # # indowebster added by fahmi[at]airputih.or.id #} elsif (($u =~ /indowebster/) && (m/^http:\/\/www[0-9][0-9]\.indowebster.com.*\/(.*?)/)) { # print $x . "http://cdn.indowebster.com/" . $2 . "\n"; #cdn, varialble 1st path } elsif (($u =~ /filehippo/) && (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) { @y = ($1,$2,$4,$5); $y[0] =~ s/[a-z0-9]{2,5}/cdn./; print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n"; #rapidshare } elsif (($u =~ /rapidshare/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&]{4,})$/)) { print $x . "http://cdn." . $3 . "/SQUIDINTERNAL/" . $5 . "\n"; } elsif (($u =~ /maxporn/) && (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) { print $x . "http://" . $1 . "/SQUIDINTERNAL/" . $3 . "\n"; #like porn hub variables url and center part of the path, filename etention 3 or 4 with or withour ? at the end } elsif (($u =~ /tube8|pornhub|xvideos/) && (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) { print $x . "http://cdn." . $3 . $5 . "\n"; #...spicific servers end here. #general purpose for cdn servers. add above your specific servers. } elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) { print $x . "http://squid-cdn-url//" . $2 . "." . $3 . "\n"; #for yimg.com doubled } elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) { print $x . "http://cdn.yimg.com/" . $3 . "\n"; #for yimg.com with &sig= } elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) { @y = ($1,$2); $y[0] =~ s/[a-z]+[0-9]+/cdn/; $y[1] =~ s/&sig=.*//; print $x . "http://" . $y[0] . ".yimg.com/" . $y[1] . "\n"; #generic http://variable.domain.com/path/filename."ext" or "exte" with or withour "?" } elsif (m/^http:\/\/(.*)([^\.\-]*?\..*?)\/(.*)\.([^\/\?\&]{3,4})(\?.*)?$/) { @y = ($1,$2,$3,$4); $y[0] =~ s/(([a-zA-A-]+[0-9-]+)|(.*cdn.*)|(.*cache.*))/cdn/; print $x . "http://" . $y[0] . $y[1] . "/" . $y[2] . "." . $y[3] . "\n"; # generic http://variable.domain.com/... } elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) { print $x . "http://cdn." . $3 . "." . $4 . "/" . $5 . "\n"; # spicific extention that ends with ? } elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|on2)\?(.*)/) { print $x . "http://" . $1 . "/" . $2 . "." . $3 . "\n"; # all that ends with ; } elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) { print $x . "http://" . $1 . "/" . $2 . "\n"; } else { print $x . $_ . "\n"; } } save as lagi tunning.conf acl store_rewrite_list urlpath_regex \/(get_video|videoplayback\?id|videoplayback.*id) acl store_rewrite_list urlpath_regex \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar)\? acl store_rewrite_list_domain url_regex ^http:\/\/([a-zA-Z-]+[0-9-]+)\.[A-Za-z]*\.[A-Za-z]* acl store_rewrite_list_domain url_regex (([a-z]{1,2}[0-9]{1,3})|([0-9]{1,3}[a-z]{1,2}))\.[a-z]*[0-9]?\.[a-z]{3} acl store_rewrite_list_path urlpath_regex \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|avc|zip|mp3|3gp|rar|on2|mar|exe)$ acl store_rewrite_list_domain_CDN url_regex \.rapidshare\.com.*\/[0-9]*\/.*\/[^\/]* ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*) \.doubleclick\.net.* acl store_rewrite_list_domain_CDN url_regex ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$ quantserve\.com acl store_rewrite_list_domain_CDN url_regex ^http:\/\/[a-z]+[0-9]\.google\.co(m|\.id) acl store_rewrite_list_domain_CDN url_regex ^http:\/\/\.www[0-9][0-9]\.indowebster\.com\/(.*)(rar|zip|flv|wm(a|v)|3gp|mp(4|3)|exe|msi|avi|(mp(e?g|a|e|1|2|3|4))|cab|exe) acl dontrewrite url_regex redbot\.org \.php acl getmethod method GET storeurl_access deny dontrewrite storeurl_access deny !getmethod storeurl_access allow store_rewrite_list_domain_CDN storeurl_access allow store_rewrite_list storeurl_access allow store_rewrite_list_domain storeurl_access allow store_rewrite_list_path storeurl_access deny all storeurl_rewrite_program /usr/local/squid/etc/storeurl.pl storeurl_rewrite_children 7 storeurl_rewrite_concurrency 0 # 1 year = 525600 mins, 1 month = 43800 mins refresh_pattern imeem.*\.flv 0 0% 0 override-lastmod override-expire store-stale refresh_pattern \.rapidshare.*\/[0-9]*\/.*\/[^\/]* 161280 90% 161280 ignore-reload store-stale refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale #refresh_pattern -i (get_video\?|videoplayback\?id|videoplayback.*id||videodownload\?|\.flv?) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern \.(ico|video-stats) 129600 999999% 129600 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod ignore-must-revalidate negative-ttl=10080 store-stale refresh_pattern \.etology\? 129600 999999% 129600 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern galleries\.video(\?|sz) 129600 999999% 129600 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern brazzers\? 129600 999999% 129600 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern \.adtology\? 129600 999999% 129600 override-expire ignore-reload ignore-no-cache store-stale refresh_pattern ^.*(utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 129600 20% 129600 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth ignore-must-revalidate store-stale negative-ttl=40320 max-stale=10 refresh_pattern ^.*safebrowsing.*google 129600 999999% 129600 override-expire ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stale refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.uk) 129600 999999% 129600 override-expire ignore-reload ignore-private store-stale negative-ttl=10080 refresh_pattern ytimg\.com.*\.jpg 129600 999999% 129600 override-expire ignore-reload store-stale refresh_pattern images\.friendster\.com.*\.(png|gif) 129600 999999% 129600 override-expire ignore-reload store-stale refresh_pattern garena\.com 129600 999999% 129600 override-expire reload-into-ims store-stale refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 129600 999999% 129600 override-expire ignore-reload store-stale refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 129600 999999% 129600 ignore-no-cache override-expire override-lastmod store-stale refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png) 129600 999999% 129600 reload-into-ims override-expire ignore-private store-stale refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\. 129600 999999% 129600 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale refresh_pattern ^http:\/\/www.onemanga.com.*\/ 129600 999999% 129600 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale # ANTI VIRUS refresh_pattern guru.avg.com/.*\.(bin) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern (avgate|avira).*(idx|gz)$ 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern kaspersky.*\.avc$ 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern kaspersky 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern update.nai.com/.*\.(gem|zip|mcs) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern ^http:\/\/liveupdate.symantecliveupdate.com.*\(zip) 43200 999999% 43200 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern windowsupdate.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern update.microsoft.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale refresh_pattern download.microsoft.com/.*\.(cab|exe) 43200 999999% 129600 ignore-no-cache ignore-no-store ignore-reload reload-into-ims store-stale #images facebook refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale #banner IIX refresh_pattern ^http:\/\/openx.*\.(jp(e?g|e|2)|gif|pn[pg]|swf|ico|css|tiff?) 129600 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/ads(1|2|3).kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/img.ads.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern .kompasimages.com.*\.(jpg|gif|png|swf) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/openx.kompas.com.*\/ 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern kaskus.\us.*\.(jp(e?g|e|2)|gif|png|swf) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/img.kaskus.us.*\.(jpg|gif|png|swf) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale #IIX DOWNLOAD refresh_pattern ^http:\/\/\.www[0-9][0-9]\.indowebster\.com\/(.*)(mp3|rar|zip|flv|wmv|3gp|mp(4|3)|exe|msi|zip) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale ignore-auth #All File refresh_pattern -i \.(3gp|7z|ace|asx|avi|bin|cab|dat|deb|divx|dvr-ms) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|css|js) 129600 999999% 129600 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern -i \.(mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rar|rm|r(a|p)m|snd|vob|wav) 129600 999999% 129600 ignore-no-cache ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern -i \.(pp(s|t)|wax|wm(a|v)|wmx|wpl|zip|cb(r|z|t)) 129600 999999% 43200 ignore-no-cache ignore-private override-expire override-lastmod reload-into-ims store-stale refresh_pattern (cgi-bin|\?) 0 0% 0 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern ^ftp: 10080 95% 43200 override-lastmod reload-into-ims store-stale refresh_pattern . 180 95% 43200 override-lastmod reload-into-ims store-stale global_internal_static off max_stale 10 years retry_on_error on buffered_logs on read_ahead_gap 32 KB header_access Accept-Encoding deny all client_persistent_connections off server_persistent_connections on half_closed_clients off strip_query_terms off quick_abort_min 0 KB quick_abort_max 0 KB quick_abort_pct 100 vary_ignore_expire on reload_into_ims on pipeline_prefetch on #range_offset_limit 50 KB read_timeout 30 minutes client_lifetime 6 hours negative_ttl 30 seconds positive_dns_ttl 6 hours negative_dns_ttl 60 seconds pconn_timeout 15 seconds request_timeout 1 minute store_avg_object_size 13 KB log_icp_queries off ipcache_size 16384 ipcache_low 98 ipcache_high 99 log_fqdn off fqdncache_size 16384 memory_pools off forwarded_for on zph_mode tos zph_local 0x30 zph_parent 0 zph_option 136 #cachemgr_passwd none info cachemgr_passwd none all client_db on max_filedescriptors 4096 n_aiops_threads 24 #client_socksize 16 MB load_check_stopen on load_check_stcreate on download_fastest_client_speed on – Buat direktori untuk nampung cache di /cache1, – kemudian ubah permission nya untuk squid – kemudian ubah permission file tunning.conf dan storeurl.pl agar bisa di exekusi [root@lusca-proxy etc]# mkdir /cache1 [root@lusca-proxy etc]# chown squid:squid /cache1 [root@lusca-proxy etc]# chmod 777 tunning.conf storeurl.pl Building cache dir squid [root@lusca-proxy etc]# /usr/local/squid/sbin/squid -z edit localnet pada squid.conf. sesuaikan network client kita : potongan squid.conf [root@lusca-proxy etc]# nano -c squid.conf ....................... #################################################################### # Allow local network(s) on interface(s) # Example rule allowing access from your local networks. # Adapt to list your (internal) IP networks from where browsing # should be allowed #acl localnet src 10.0.0.0/8 # RFC1918 possible internal network #acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 7.7.9.0/24 # RFC1918 possible internal network #################################################################### Cek apakah ada config error di squid dan apabila tidak ada error Jalankan squid sebagai daemon root@lusca-proxy etc]# /usr/local/squid/sbin/squid -k parse [root@lusca-proxy etc]# /usr/local/squid/sbin/squid -NDd1 & Testing. Silahkan arahkan browser menggunakan proxy ke server LUSCA dengan port 3128 [root@lusca-proxy etc]# tail -f /cache1/access.log catatan : buat ngecek idup apa ngga di nmap saja liat port nya kebuka atau ngga jika ketemu error Filedescriptors blabla, edit di file [root@lusca-proxy ~]# nano -c /usr/local/squid/etc/storeurl.pl pada bagian paling atas #!/usr/bin/perl5.8.8 <===== edit menjadi "#!/usr/bin/perl" tanpa tanda kutip # by chudy_fernandez@yahoo.com # Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/D iscussion $|=1; ............................. untuk menjalankan lusca setiap abis restart secara otomatis ketik perintah ini di console [root@lusca-proxy ~]# echo "/usr/local/squid/sbin/squid -NDd1 &" >> /etc/rc.local







Menghitung Disk Cache (cache_dir) pada Squid

Pada squid kita akan menggunakan space kosong pada disk qt untuk meletakkan content cache yang tersimpan.

Ada beberapa pendapat mengenai besar cache_dir atau disk cache yang bisa kita gunakan agar performansi proxy dapat berjalan dengan maksimal.

1. Gunakan 80% dari ukuran disk sebagai ruang penyimpanan cache
2. Pada squid, disk cache di definisikan dengan tag “cache_dir”. adapun format defaultnya adalah : “cache_dir Type Directory-Name Mbyte L1 L2 [options]”

keterangan:

1. cache_dir adalah tag yang mendefinisikan directory cache.
2. Type adalah jenis penyimpanan sistem, defaultnya adalah ufs. jika akan menggunakan sistem penyimpanan jenis lain seperti diskd atau aufs maka perlu menambah options –enable-storeio=”diskd, aufs” ketika mengkompile squid.
3. Directory-Name adalah menunjukkan letak directory akan di buat cache misalkan /cache. ingat, owner dan group directory ini harus sesuai dengan user yang menjalankan squid. adalah sebuah larangan squid di jalankan dengan user root.
4. Mbyte (numeric) adalah pendifinisian besarnya media penyimpanan yang akan di gunakan cache, misalkan yang akan di gunakan adalah 40GB maka pada Mbyte harus tertulis 20000, MByte ini akan berhubungan dengan tag lain yaitu “cache_swap_low 90″ dan “cache_swap_high 95″.
5. L1 (numeric) adalah jumlah directory yang akan di buat di dalam directory /cache ketika perintah #/usr/local/sbin/squid -z di eksekusi.
6. L2 (numeric) adalah jumlah directory yang akan di buat di dalam masing-masing directory L1 ketika perintah #/usr/local/sbin/squid -z di eksekusi.



Misalnya kita akan melakukan instalasi squid pada HDD berukuran 250 Giga, berdasarkan rule pertama, bahwa gunakan 80% dari space disk kita sebagai cache_dir, maka didapatkan:

80% x 250 Giga = 200 Giga

Dari 200 Giga tersebut, kita bagi menjadi 5 direktory

/cache1
/cache2
/cache3
/cache4
/cache5

Lalu bagaimana menentukan L1 ?, berikut adalah rumus yang di pakai.

((( x / y ) / 256 ) / 256 ) * 2 ≈ L1
x = besarnya disk cache yang akan di gunakan, satuannya adalah Kb (40 GB = 40.000.000 KB)
y = jumlah rata-rata object biasanya bernilai 13Kb
misalkan besarnya cache disk adalah 20 GB maka:

(((40.000.000/13)/256)/256)*2 ≈ 94 (dibulatkan ke atas)

Maka nilai L1 adalah 94.

Bila cache disk 40GB, maka scrip squidnya adalah sebagai berikut

cache_dir aufs /cache1 40000 94 256
cache_dir aufs /cache2 40000 94 256
cache_dir aufs /cache3 40000 94 256
cache_dir aufs /cache4 40000 94 256
cache_dir aufs /cache5 40000 94 256

Membatasi Download pada Squid

Dalam pengelolaan bandwidth, terutama yang bandwidthnya terbatas, maka pembatasan download sangat diperlukan.

Dengan squid pembatasan dapat dilakukan dengan bebarapa cara. Dalam bahasan ini akan dibahas dua hal saja yaitu :

1. Membatasi besarnya file yang boleh di download

Misalnya tidak boleh download dengan fle ukuran 650MB (satu CD)

ini dapat dilakukan dengan menambahkan tag reply_body_max_size

# Filter Download
acl download url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .tar .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav .mov .msi .mp4

# TAG: reply_body_max_size bytes allow|deny acl acl…
# This option specifies the maximum size of a reply body in bytes.
# It can be used to prevent users from downloading very large files,
# such as MP3’s and movies. When the reply headers are received,
# the reply_body_max_size lines are processed, and the first line with
# a result of “allow” is used as the maximum body size for this reply.
# This size is checked twice. First when we get the reply headers,
# we check the content-length value. If the content length value exists
# and is larger than the allowed size, the request is denied and the
# user receives an error message that says “the request or reply
# is too large.” If there is no content-length, and the reply
# size exceeds this limit, the client’s connection is just closed
# and they will receive a partial reply.
#
# WARNING: downstream caches probably can not detect a partial reply
# if there is no content-length header, so they will cache
# partial responses and give them out as hits. You should NOT
# use this option if you have downstream caches.
#
# If you set this parameter to zero (the default), there will be
# no limit imposed.
#
#Default:
# reply_body_max_size 0 allow all
reply_body_max_size 6500000000 allow download

2. Cara yang kedua dengan cara membatasi download dengan memperlambat atau shaping paket yang dilewatkan. Misalnya badwidth yang tersedia 256kbps, dimana saat download bisa rata-rata 30KBps.

Akan dibuat aturan sebagai berikut :

a. Untuk browsing biasa tidak ada pembatasan

b. Untuk download dengan ukuran dibawah 1MB tidak ada pembatasan kecepatan

c. Untuk download dengan ukuran diatas 1MB dibatasi dengan kecepatan 10 byte / detik

# Filter Download
acl download url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .tar .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav .mov .msi .mp4

# dibuat 2 aturan

delay_pools 2

# aturan 1, tidak ada pembatasan
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1

# aturan 2, setelah download 2048000 bytes mk download menjadi 10000 bytes/s
delay_class 2 2
delay_parameters 2 -1/2048000 10000/2049000

delay_access 2 allow download
delay_access 2 deny all
delay_access 1 deny download
delay_access 1 allow all

Instalasi Dan Setting Proxy Server Menggunakan Squid Pada Ubuntu 10.04

Pada kesempatan kali ini, saya akan sedikit mengulas tentang instalasi dan konfigurasi proxy server menggunakan squid pada Ubuntu 10.04. Mengapa saya memilih menggunakan ubuntu?? Karena Ubuntu memiliki repository atau kumpulan paket yang relatif lengkap dan dengan menggunakan perintah apt-get kita dapat menginstallnya dengan begitu mudahnya.

Saya menganggap anda telah melakukan instalasi Ubuntu 10.04 dan telah login sebagai root di mesin ubuntu anda.

Langkah pertama adalah mengupdate repository kita dengan mengetikkan perintah:

#apt-get update

Selanjunya ketikkan perintah berikut

#apt-get install squid

Tunggu proses instalasi yang dilakukan secara otomatis oleh ubuntu anda.

Bila sudah selesai, ketikkan perintah berikut untuk membuat directory squid anda.

#mkdir /cache1 && mkdir /cache2 && mkdir /cache3 && mkdir /cache4

#touch /var/log/squid/access.log

#touch /var/log/squid/cache.log

sesuaikan dengan space HDD anda.

ubah kepemilikan directory /cache anda dengan perintah:

#chmod 777 /cache1

#chmod 777 /cache2

#chmod 777 /cache3

#chmod 777 /cache4

#chmod 777 /var/log/squid/cache.log

#chmod 777 /var/log/squid/access.log

kemudian edit file /etc/squid/squid.conf dengan perintah:

#pico /etc/squid/squid.conf

ini adalah contoh isi dari file /etc/squid/squid.conf

http_port 8080 transparent
cache_mgr support@netsolusindo.com
forwarded_for off
visible_hostname proxy1.netsolusindo.com

cache_mem 6 MB
cache_swap_low 98
cache_swap_high 99

maximum_object_size 128 MB
maximum_object_size_in_memory 32 KB

ipcache_size 2048
ipcache_low 98
ipcache_high 99

memory_pools off
reload_into_ims on
pipeline_prefetch on

cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

cache_dir aufs /cache1 40000 94 256
cache_dir aufs /cache2 40000 94 256
cache_dir aufs /cache3 40000 94 256
cache_dir aufs /cache4 40000 94 256

access_log /var/log/squid/access.log
cache_store_log none
cache_log /var/log/squid/cache.log

acl all src 0.0.0.0/0.0.0.0
acl localNet src 172.0.0.0/8, 10.14.200.0/24, 192.168.4.0/24, 10.14.201.0/24
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
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
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

http_access allow manager localhost
http_access allow localhost
http_access allow localNet
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow all

selanjutnya coba check file /etc/squid/squid.conf anda dengan perintah:

#squid -k parse

bila masih muncul baris errot, edit kembali file /etc/squid/squid.conf anda, setelah tidak ada baris error yang muncul silahkan ketikkan perintah di bawah ini:

#squid -z

#squid -DFY

sekarang check apakah squid anda telah berjalan dengan perintah:

#ps -ax|grep squid

bila muncul baris seperti berikut ini, maka squid anda telah berjalan.

684 ? Ss 0:00 /usr/sbin/squid
686 ? Sl 45:47 (squid)