17 February 2012

Squid Stabil bawah CentOS 5.4 9 Minimal

CentOS 5.4 minimal? WTM? (Apa yang Minimal - lol). Nah, biasanya instalasi CentOS kebutuhan 5 CD, tetapi di sini kita hanya perlu 1 CD, hanya paket dasar untuk instalasi, itulah sebabnya saya disebut CentOS minim, bahkan kamar itu untuk kebutuhan mesin proxy, kita hanya menginstal paket yang diperlukan sehingga akan lebih ringan.
Apa itu cumi?
http://www.squid-cache.org/
PC Rig
  • Intel Atom D945GCLF2D
  • HDD 80GB Seagate Barracuda SATAII
  • RAM VGEN 2GB PC6400
  • NIC 100Mbps Teknis
  • PSU Acbel 420 Watt

BAB 1: Persiapan
a. Persyaratan
CentOS 5.4 CD 1 saja
http://mirror.optus.net/centos/5.4/isos/i386/CentOS-5.4-i386-bin-1of6.iso
atau
http://isoredirect.centos.org/centos/5/isos/i386
b. Periksa file MD5 dan membakar ke CD
c. Pengaturan BIOS
  • Matikan fitur Hyper Threading untuk Pengguna Processor Intel karena dalam proses instalasi kita akan memilih "acpi = off", sehingga akan ada gunakan untuk mengaktifkan fitur ini di BIOS.
  • Matikan perangkat onboard, kecuali SEMUA VGA. Jika Anda bertanya tentang "bagaimana dengan NIC? Kenapa tidak kita gunakan pada NIC papan? ". Anda harus menggunakan NIC yang lebih baik bagi cumi-cumi, untuk menstabilkan koneksi Anda inbound dan outbound, pada NIC dewan tidak baik untuk itu.
  • Tetapkan SATA AHCI seperti (jika motherboard anda memiliki fitur ini), jika tidak diatur untuk NATIVE WARISAN, tidak
  • Dan tentu saja jangan lupa untuk mengatur boot dari CD-lol-
  • Untuk yang lain tweak pengaturan, Anda dapat mencari di google
BAB 2: Instalasi CentOS
a. Boot dari CD CentOS
b. Instalasi kemajuan
Membuang acpi dari kernel CentOS:

 # Boot: linux acpi = off 
s41iqb Squid Stable 9 Under CentOS 5.4 Minimal
Instalasi dimulai. Instalasi CentOS adalah mudah, Anda hanya perlu klik next berulang kali, tetapi ada 3 langkah yang harus diperhatikan.
1. Partisi
16k3tsp Squid Stable 9 Under CentOS 5.4 Minimal
Ini adalah setting partisi saya misalnya.
/boot ext3 110MB
/swap 2GB
/cache1 ext2 10GB
/cache2 ext2 10GB
/cache3 ext2 10GB
/ext3 leftover space

catatan: CentOS adalah kadang-kadang bertindak aneh jika swap yang <ram, swap sehingga mengatur = ram
2. Antarmuka Jaringan Mengatur
Topologi:
Mikrotik IP interface yang terhubung ke mesin CentOS: 192.168.2.1/24
CentOS IP mesin: 192.168.2.2/24
Gateway & DNS CentOS mesin server: 192.168.2.1
nz0hec Squid Stable 9 Under CentOS 5.4 Minimal
jangan lupa untuk mematikan IPv6
3. Paket Seleksi
Jangan memilih paket apapun atau Anda akan diminta untuk CD 2
eqtibp Squid Stable 9 Under CentOS 5.4 Minimal
28u0jts Squid Stable 9 Under CentOS 5.4 Minimal
1ta9uq Squid Stable 9 Under CentOS 5.4 Minimal
Anda membuat kopi atau teh saat instalasi pada kemajuan
vmrozk Squid Stable 9 Under CentOS 5.4 Minimal
BAB 3: fstab, iptables & SELinux
Login ke mesin squid
1. Mengedit fstab

 # Vi / etc / fstab 
Ini adalah contoh konfigurasi i digunakan di fstab
5fpx0j Squid Stable 9 Under CentOS 5.4 Minimal
2. Nonaktifkan SELinux

 # Vi / etc / selinux / config 
>
2qxu6n8 Squid Stable 9 Under CentOS 5.4 Minimal
perubahan selinux = menegakkan selinux = dinonaktifkan untuk
3. Iptables

 # Yum-y menghapus iptables 
dan kemudian reboot

 # Reboot 
BAB 4: Menyebarkan Squid 2,7 STABLE 9 pada CentOS
1. Instal paket yang dibutuhkan dependensi &
Pastikan CentOS terhubung ke internet

 # Yum install-y perl autoconf automake gcc sudo wget membuat 
2. Instalasi Squid

 # Cd / usr / src

 # Wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz

 # Tar-zxvf squid * & & cd cumi *

 #. / Configure

 -Program-prefix =-prefix = / usr 

 -Sysconfdir = / etc / squid 

 -Enable-async-io 

 -Enable-jajak pendapat 

 -Enable-gnuregex 

 -Enable-ikan mas 

 -Enable-storeio = aufs, diskd, ufs, nol 

 -Enable-forw-via-db 

 -Enable-icmp 

 -Enable-cache-mencerna 

 -Enable-removal-kebijakan = lru, heap 

 -Enable-truncate 

 -Enable-default-err-language = Inggris 

 -Enable-err-languages ​​= Bahasa Inggris 

 -Enable-linux-netfilter 

 -Disable-ident-lookups 

 -Disable-WCCP 

 -Disable-wccpv2 

 -Dengan-pthreads 

 -Dengan-aio 

 -Dengan-dl 

 -Dengan-maxfd = 65535

 # Make & & umask 022 & & make install & & make clean

 # Groupadd squid

 # Useradd-g squid squid 
Edit / etc / squid / squid.conf sebelum diinisialisasi & cumi cache yang berjalan

 # START HERE

 # --------------------------

 acl QUERY urlpath_regex-i cgi-bin? 
 localhost

 acl semua src semua

 acl manager proto cache_object

 acl localhost src 127.0.0.1/32

 src 192.168.2.0/24 acl mikrotik

 acl to_localhost dst 127.0.0.0 / 8

 src 192.168.1.0/24 acl OLCNETWORK

 SSL_ports port 443 acl

 acl Safe_ports port 80 # http

 acl Safe_ports port 21 # ftp

 acl Safe_ports port 443 # https

 acl Safe_ports port yang 70 # gopher

 acl Safe_ports port yang 210 # wais

 acl Safe_ports port 1025-65535 # port yang tidak terdaftar

 acl Safe_ports port yang 280 # http-mgmt

 acl Safe_ports port yang 488 # SSU-http

 acl Safe_ports port yang 591 # filemaker

 acl Safe_ports port yang 777 # multiling http

 acl snmppublic snmp_community publik

 acl CONNECT method CONNECT

 PURGE acl PURGE metode

 snmp_access memungkinkan localhost snmppublic

 PURGE localhost http_access allow

 http_access deny PURGE

 http_access allow localhost manajer

 http_access deny manager

 http_access deny! Safe_ports

 http_access deny CONNECT! SSL_ports

 http_access allow OLCNETWORK

 http_access allow mikrotik

 snmp_access menolak semua

 http_access deny all


 # JARINGAN PILIHAN

 # --------------------------


 http_port 3128 transparan

 zph_mode tos

 zph_local 0 × 30

 zph_parent 0

 zph_option 136


 # ORANGTUA / saudara CACHE PILIHAN

 # --------------------------


 hierarchy_stoplist cgi-bin localhost


 # PILIHAN YANG MEMPENGARUHI UKURAN CACHE

 # --------------------------


 cache_mem 8 MB

 maximum_object_size_in_memory 64 KB

 memory_replacement_policy tumpukan GDSF

 cache_replacement_policy tumpukan LFUDA

 cache_dir aufs / cache1 7500 16 256

 cache_dir aufs / cache2 7500 16 256

 cache_dir aufs / cache3 7500 16 256

 store_dir_select_algorithm setidaknya beban

 maximum_object_size 20480 KB

 cache_swap_low 90

 cache_swap_high 95

 update_headers off


 # LOGFILE nama path dan direktori cache

 # --------------------------


 access_log none

 cache_log / dev / null

 cache_store_log none

 logfile_rotate 5

 log_ip_on_direct off

 log_icp_queries off

 buffered_logs off

 netdb_filename tidak ada

 pid_filename / var / run / squid.pid


 # TUNING CACHE UNTUK PILIHAN ATAS

 # --------------------------


 Cache menyangkal QUERY

 refresh_pattern ^ ftp:1440 20% 10080

 refresh_pattern ^ gopher: 1440 0% 1440

 refresh_pattern-i. (gif | png |? jp g | ico | bmp |? tiff) $ 10080 95% 43200 override-lastmod berakhir menimpa-ulang-ke-ims ignore-no-cache ignore-private

 refresh_pattern-i (rpm | taksi | deb | exe | msi | PSD | MSU | zip | tar | gz | tgz | rar | bin | 7z | doc |? xls |? pdf |? pdf). $ 10080 90% 43200 override -berakhir-lastmod menimpa kembali-ke-ims ignore-no-cache ignore-private

 refresh_pattern-i (avi | iso | wav | pertengahan | mp | mpeg | mov |? 3gp | wm |? swf | flv | x-flv | AXD). $ 43.200 95% 432000 override-lastmod berakhir menimpa-ulang-ke- ims ignore-no-cache ignore-private

 refresh_pattern-i (/ cgi-bin / |?) 0 0% 0

 refresh_pattern. 
 1440 90% 10080


 quick_abort_min 0 KB

 quick_abort_max 0 KB

 quick_abort_pct 98

 store_avg_object_size 32 KB


 # HTTP PILIHAN

 # --------------------------


 server_http11 pada

 collapsed_forwarding pada

 vary_ignore_expire pada

 header_access Dari menyangkal semua

 header_access Server deny all

 Tautan header_access menolak semua

 header_access Via deny all

 header_access X-Forwarded-For deny all


 # Timeout

 # --------------------------


 forward_timeout 240 detik

 connect_timeout 60 detik

 peer_connect_timeout 5 detik

 read_timeout 600 detik

 request_timeout 60 detik

 persistent_request_timeout 60 detik

 client_lifetime 86400 detik

 half_closed_clients off

 pconn_timeout 60 detik

 shutdown_lifetime 15 detik


 # ADMINISTRASI PARAMETER

 # --------------------------


 cache_mgr OLCNETWORK

 cache_effective_user squid

 cache_effective_group squid

 httpd_suppress_version_string pada

 visible_hostname OLCNETWORK


 # ADVANCED NETWORKING PILIHAN

 # --------------------------


 max_filedescriptors 65535


 # DNS PILIHAN

 # --------------------------


 check_hostnames off

 dns_timeout 30 detik

 dns_nameservers 192.168.2.1

 hosts_file / etc / hosts

 ipcache_size 8192

 ipcache_low 95

 ipcache_high 98

 fqdncache_size 4096


 # LAIN-LAIN

 # --------------------------


 memory_pools off

 forwarded_for off

 reload_into_ims pada

 coredump_dir / home / squid

 pipeline_prefetch pada 
chown dir cache yang

 # Chown-R squid: squid / cache1

 # Chown-R squid: squid / cache2

 # Chown-R squid: squid / cache3 
diinisialisasi cache:

 # Sudo-u squid squid-z 
Menjalankan Squid:

 # Squid-SYD 
3. Startup
mengedit / etc / rc.local dan tambahkan baris ini:

 gema 1024 65535> / proc/sys/net/ipv4/ip_local_port_range

 ulimit-HSN 65535

 squid-YD 
Reboot, hanya untuk menguji bekerja startup atau tidak.
Selesai, menikmati squid Anda pada Centos 5.4
Previous Post
Next Post
Related Posts

0 komentar: