[ASK] Squid Lusca ubuntu

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
Post Reply
User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

[ASK] Squid Lusca ubuntu

Post by citizen » 21 Dec 2014, 22:58

malam agan2 baru saya instal squid ubuntu lusca sudah selesai tetapi pas waktu menjalankan squid lusca terjadi eror

root@ubuntu:~# /etc/init.d/squid stop
/etc/init.d/squid: 78: /etc/init.d/squid: Syntax error: ")" unexpected (expecting "}")
root@ubuntu:~#

perintah ini juga tetap permasalahan sama saja

root@ubuntu:~# sudo service squid stop
/etc/init.d/squid: 78: /etc/init.d/squid: Syntax error: ")" unexpected (expecting "}")
root@ubuntu:~#

mohon pencerahan aga2 sekalian


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 22 Dec 2014, 21:30

itu sepertinya script /etc/init.d/squid nya yg bermasalah...ada syntax error

di line 78...

coba di fix dg

Code: Select all

nano /etc/init.d/squid
cari ")" dg ctrl+w lalu ubah mnjadi "}", memang smbol kurung ini mirip2 klo tdk teliti jdi salah

klo anda copas script nya coba di cek lgi sblm diterapkan.


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 23 Dec 2014, 00:22

terima kasih gan solisinya sudah clear permasalahanya

root@ubuntu:~# /etc/init.d/squid stop
* Stopping Squid HTTP Proxy 3.X squid [ OK ]
saya lanjut dengan perintah ini masih ada permasalahan

root@ubuntu:~# /usr/local/squid/sbin/squid -NDd1
FATAL: cache_dir /usr/local/squid/var/cache: (2) No such file or directory
Squid Cache (Version LUSCA_HEAD-r14809): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 6144 KB
Page faults with physical i/o: 0
Aborted (core dumped)



untu cache yang saya pakai
cache_dir aufs /cache 200000 469 256
partisi case yang saya buat 200gb
memory yang saya gunakan 4 GB

mohon pencerahan agan


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 23 Dec 2014, 07:11

brdasarkan notifikasi error itu, cache_ dir nya salah tujuan yaitu

ke cache_dir /usr/local/squid/var/cache

seharusnya ke cache_dir aufs /cache

jgn lupa set permision nya

Code: Select all

mkdir /cache
chown -R proxy:proxy /cache
squid -z
squid -d1
coba dicek ulang konfigurasinya...


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 23 Dec 2014, 14:55

sudah saya jalankan perintah agan sarankan

terahir saya jalan kan perintah ini squid -d1
2014/12/23 14:44:35| Process ID 2298
2014/12/23 14:44:35| NOTICE: Could not increase the number of filedescriptors
2014/12/23 14:44:35| With 1024 file descriptors available
2014/12/23 14:44:35| Using epoll for the IO loop
2014/12/23 14:44:35| Performing DNS Tests...
2014/12/23 14:44:35| Successful DNS name lookup tests...
2014/12/23 14:44:35| Adding nameserver 127.0.0.1 from squid.conf
2014/12/23 14:44:35| helperOpenServers: Starting 15 'storeurl.pl' processes
2014/12/23 14:44:35| logfileOpen: opening log /var/log/squid/access.log
2014/12/23 14:44:35| logfileOpen: opening log /var/log/squid/yt.log
2014/12/23 14:44:35| Swap maxSize 204800000 + 32768 KB, estimated 15756366 objects
2014/12/23 14:44:35| Target number of buckets: 787818
2014/12/23 14:44:35| Using 1048576 Store buckets
2014/12/23 14:44:35| Max Mem size: 32768 KB
2014/12/23 14:44:35| Max Swap size: 204800000 KB
2014/12/23 14:44:35| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/12/23 14:44:35| logfileOpen: opening log /dev/null
2014/12/23 14:44:35| AUFS: /cache: log '/cache/swap.state' opened on FD 27
2014/12/23 14:44:35| AUFS: /cache: tmp log /cache/swap.state.new opened on FD 27
2014/12/23 14:44:35| Rebuilding storage in /cache (DIRTY)
2014/12/23 14:44:35| Using Least Load store dir selection
2014/12/23 14:44:35| Set Current Directory to /var/spool/squid/
2014/12/23 14:44:35| Loaded Icons.
2014/12/23 14:44:35| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 29.
2014/12/23 14:44:35| Accepting HTCP messages on port 4827, FD 30.
2014/12/23 14:44:35| Accepting SNMP messages on port 3401, FD 31.
2014/12/23 14:44:35| WCCP Disabled.
2014/12/23 14:44:35| Ready to serve requests.
2014/12/23 14:44:35| WARNING: store_rewriter #1 (FD 7) exited
2014/12/23 14:44:35| WARNING: store_rewriter #2 (FD 8) exited
2014/12/23 14:44:35| WARNING: store_rewriter #3 (FD 9) exited
2014/12/23 14:44:35| WARNING: store_rewriter #4 (FD 10) exited
2014/12/23 14:44:35| WARNING: store_rewriter #5 (FD 11) exited
2014/12/23 14:44:35| WARNING: store_rewriter #6 (FD 12) exited
2014/12/23 14:44:35| WARNING: store_rewriter #7 (FD 13) exited
2014/12/23 14:44:35| WARNING: store_rewriter #8 (FD 14) exited
2014/12/23 14:44:35| Too few store_rewriter processes are running
FATAL: The store_rewriter helpers are crashing too rapidly, need help!
masih tetap terjadi masalah yang di atas
root@ubuntu:~# /usr/local/squid/sbin/squid -NDd1
FATAL: cache_dir /usr/local/squid/var/cache: (2) No such file or directory
Squid Cache (Version LUSCA_HEAD-r14809): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 6176 KB
Page faults with physical i/o: 0
Aborted (core dumped)
mohon gan kereksinya, maklum gan newbe dengan ubuntu server


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 23 Dec 2014, 15:21

begini, agan buka squid.conf nya, llu cari cache_dir dg ctrl+w.

nah ubah sesuai cache dir yg telah agan buat misalnya di /cache

contoh :

Code: Select all

nano /etc/squid/squid.conf
tekan ctrl+w, ketik cache_dir aufs, llu enter
nanti ketemu sprti di bwh ini
cache_dir /usr/local/squid/var/cache ------ sprti notifikasi error

ubah mnjadi
cache_dir aufs /cache ----- ini cache dir yg tlh agan buat

simpan, llu coba jlnkan lg squid nya.


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 23 Dec 2014, 15:28

hmm... apa agan pernah instal squid2.7 selain squid lusca, walapun brbeda versi nmun file konfigurasinya tetap sama namanya yaitu squid.conf.

coba cek dir squid lusca agan di dalam dir /etc

klo boleh tahu agan baca panduan squid lusca nys dimana?


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 23 Dec 2014, 17:16

utntuk /cache ini sudah saya terapkan gan
cache_dir aufs /cache 200000 469 256
klo squid2.7 aku blm pernah buat gan, saya baca di forum ini dan blog mengenai squid pada ubuntu, dulu pernah ada orang yang membuat program proxy di net saya, karena teknisi na tidak pernah perbaiki saya coba pelajari dan instal ulang dari awal


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 23 Dec 2014, 17:29

ya sdhlah...begini sj sy kasih cara singkatnya, praktis.

tpi tetap nnti agan harus pahami agar bisa disesuaikan dg keinginan agan konfigurasinya, jg agar bsa troubleshooting sndiri.

berikut linknya, semoga berhasil ya, nnti kbri sj
lusca automated install script


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 23 Dec 2014, 22:01

info yang agan aranin sudah saya peraktekkan squid.conf sudah saya ganti
dan masih ada eror ya, mohon koreksi agan
2014/12/23 21:47:37| parseConfigFile: squid.conf:24 unrecognized: 'referer_log'
2014/12/23 21:47:37| aclParseIpData: WARNING: Netmask masks away part of the spe cified IP in '192.168.10.0/16'
2014/12/23 21:47:37| parse_refreshpattern: Unknown option '(get_video\?|videopla yback\?|videodownload\?|\.flv\?|\.fid\?)': ignore-must-revalidate
WARNING: Cannot write log file: none
none: Permission denied
messages will be sent to 'stderr'.
2014/12/23 21:47:37| Starting Squid Cache version LUSCA_HEAD-r14809 for i686-pc- linux-gnu...
2014/12/23 21:47:37| Starting Squid Cache version LUSCA_HEAD-r14809 for i686-pc- linux-gnu...
2014/12/23 21:47:37| Process ID 1513
2014/12/23 21:47:37| Process ID 1513
2014/12/23 21:47:37| NOTICE: Could not increase the number of filedescriptors
2014/12/23 21:47:37| NOTICE: Could not increase the number of filedescriptors
2014/12/23 21:47:37| With 1024 file descriptors available
2014/12/23 21:47:37| With 1024 file descriptors available
2014/12/23 21:47:37| Using epoll for the IO loop
2014/12/23 21:47:37| Using epoll for the IO loop
2014/12/23 21:47:37| Performing DNS Tests...
2014/12/23 21:47:37| Performing DNS Tests...
2014/12/23 21:47:37| Successful DNS name lookup tests...
2014/12/23 21:47:37| Successful DNS name lookup tests...
2014/12/23 21:47:37| Adding nameserver 8.8.8.8 from squid.conf
2014/12/23 21:47:37| Adding nameserver 8.8.8.8 from squid.conf
2014/12/23 21:47:37| DNS Socket created at 0.0.0.0, port 58125, FD 5
2014/12/23 21:47:37| Adding nameserver 8.8.4.4 from squid.conf
2014/12/23 21:47:37| Adding nameserver 8.8.4.4 from squid.conf
2014/12/23 21:47:37| helperOpenServers: Starting 10 'storeurl.pl' processes
2014/12/23 21:47:37| helperOpenServers: Starting 10 'storeurl.pl' processes
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
2014/12/23 21:47:37| logfileOpen: opening log daemon:/var/log/squid/access.log
2014/12/23 21:47:37| logfileOpen: opening log daemon:/var/log/squid/access.log
2014/12/23 21:47:37| Logfile Daemon: opening log /var/log/squid/access.log
2014/12/23 21:47:37| Logfile Daemon: opening log /var/log/squid/access.log
2014/12/23 21:47:37| logfileOpen: opening log /var/log/squid/yt.log
2014/12/23 21:47:37| logfileOpen: opening log /var/log/squid/yt.log
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
2014/12/23 21:47:37| Swap maxSize 204800000 + 6144 KB, estimated 15754318 object s
2014/12/23 21:47:37| Swap maxSize 204800000 + 6144 KB, estimated 15754318 object s
2014/12/23 21:47:37| Target number of buckets: 787715
2014/12/23 21:47:37| Target number of buckets: 787715
2014/12/23 21:47:37| Using 1048576 Store buckets
2014/12/23 21:47:37| Using 1048576 Store buckets
2014/12/23 21:47:37| Max Mem size: 6144 KB
2014/12/23 21:47:37| Max Mem size: 6144 KB
2014/12/23 21:47:37| Max Swap size: 204800000 KB
2014/12/23 21:47:37| Max Swap size: 204800000 KB
2014/12/23 21:47:37| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/12/23 21:47:37| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/12/23 21:47:37| Store logging disabled
2014/12/23 21:47:37| Store logging disabled
2014/12/23 21:47:37| AUFS: /cache: log '/cache/swap.state' opened on FD 20
2014/12/23 21:47:37| AUFS: /cache: log '/cache/swap.state' opened on FD 20
Can't locate File/ReadBackwards.pm in @INC (@INC contains: /etc/perl /usr/local/ lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /us r/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /etc/squid/s toreurl.pl line 147.
BEGIN failed--compilation aborted at /etc/squid/storeurl.pl line 147.
2014/12/23 21:47:37| AUFS: /cache: tmp log /cache/swap.state.new opened on FD 20
2014/12/23 21:47:37| AUFS: /cache: tmp log /cache/swap.state.new opened on FD 20
2014/12/23 21:47:37| Rebuilding storage in /cache (DIRTY)
2014/12/23 21:47:37| Rebuilding storage in /cache (DIRTY)
2014/12/23 21:47:37| Using Round Robin store dir selection
2014/12/23 21:47:37| Using Round Robin store dir selection
2014/12/23 21:47:37| Set Current Directory to /var/spool/squid/
2014/12/23 21:47:37| Set Current Directory to /var/spool/squid/
2014/12/23 21:47:37| ufs_rebuild: /cache: rebuild type: REBUILD_DISK
2014/12/23 21:47:37| ufs_rebuild: /cache: beginning rebuild from directory
2014/12/23 21:47:37| Loaded Icons.
2014/12/23 21:47:37| Loaded Icons.
2014/12/23 21:47:37| Accepting transparently proxied HTTP connections at 0.0.0.0 , port 8080, FD 22.
2014/12/23 21:47:37| Accepting transparently proxied HTTP connections at 0.0.0.0 , port 8080, FD 22.
2014/12/23 21:47:37| Accepting HTCP messages on port 4827, FD 23.
2014/12/23 21:47:37| Accepting HTCP messages on port 4827, FD 23.
2014/12/23 21:47:37| Accepting SNMP messages on port 3401, FD 24.
2014/12/23 21:47:37| Accepting SNMP messages on port 3401, FD 24.
2014/12/23 21:47:37| WCCP Disabled.
2014/12/23 21:47:37| WCCP Disabled.
2014/12/23 21:47:37| Ready to serve requests.
2014/12/23 21:47:37| Ready to serve requests.
2014/12/23 21:47:37| WARNING: store_rewriter #2 (FD 7) exited
2014/12/23 21:47:37| WARNING: store_rewriter #2 (FD 7) exited
2014/12/23 21:47:37| WARNING: store_rewriter #1 (FD 6) exited
2014/12/23 21:47:37| WARNING: store_rewriter #1 (FD 6) exited
2014/12/23 21:47:37| WARNING: store_rewriter #3 (FD 8) exited
2014/12/23 21:47:37| WARNING: store_rewriter #3 (FD 8) exited
2014/12/23 21:47:37| WARNING: store_rewriter #4 (FD 9) exited
2014/12/23 21:47:37| WARNING: store_rewriter #4 (FD 9) exited
2014/12/23 21:47:37| WARNING: store_rewriter #5 (FD 10) exited
2014/12/23 21:47:37| WARNING: store_rewriter #5 (FD 10) exited
2014/12/23 21:47:37| Too few store_rewriter processes are running
2014/12/23 21:47:37| Too few store_rewriter processes are running
FATAL: The store_rewriter helpers are crashing too rapidly, need help!
itu erorr di mana ya gan

ini perintah cek squid
root@ubuntu:/etc/squid# ps aux |grep squid
root 1590 0.0 0.0 3836 816 pts/0 S+ 22:03 0:00 grep --color=auto squid


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 24 Dec 2014, 08:43

apa agan terapkan link lusca automated install script yg sy berikan?

cara yg paling aman adalah setelah instalasi selesai, squid.conf jgn diganti tapi diubah/ disesuaikan sj localnet nya, port nya, dir cache nya.

dari notifikasi error itu yaitu referer lognya, refresh pattern, netmask, permission akses file log.

solusinya, agan beri tanda comment/pagar ( # ) dahulu pada yg error itu satu persatu.

contoh :
#acl localnet src 192.168.10.0/16
#referer_log

kmudian cek, hrusnya errornya sdh berkurang dg

Code: Select all

squid -d1
llu cek lgi, smpai squid bisa running


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 25 Dec 2014, 00:48

@bang_andi saya sudah coba instal ulang dengan penerapan yang agan berikan setelah saya jalan kan hasil seperti ini gan
root@proxy:~# squid -Nd1
2014/12/25 00:44:32| Starting Squid Cache version 2.7.STABLE9 for i686-pc-linux- gnu...
2014/12/25 00:44:32| Process ID 1783
2014/12/25 00:44:32| With 8192 file descriptors available
2014/12/25 00:44:32| Using epoll for the IO loop
2014/12/25 00:44:32| Performing DNS Tests...
2014/12/25 00:44:32| Successful DNS name lookup tests...
2014/12/25 00:44:32| DNS Socket created at 0.0.0.0, port 43137, FD 6
2014/12/25 00:44:32| Adding nameserver /etc/resolv.conf from squid.conf
2014/12/25 00:44:32| WARNING: rejecting '/etc/resolv.conf' as a name server, bec ause it is not a numeric IP address
2014/12/25 00:44:32| Adding nameserver 208.67.222.222 from /etc/resolv.conf
2014/12/25 00:44:32| Adding nameserver 208.67.220.220 from /etc/resolv.conf
2014/12/25 00:44:32| Adding nameserver 202.134.0.155 from /etc/resolv.conf
2014/12/25 00:44:32| Adding nameserver 192.168.10.1 from /etc/resolv.conf
2014/12/25 00:44:32| logfileOpen: opening log /var/log/squid/access.log
2014/12/25 00:44:32| Swap maxSize 191488000 + 8192 KB, estimated 14730476 object s
2014/12/25 00:44:32| Target number of buckets: 736523
2014/12/25 00:44:32| Using 1048576 Store buckets
2014/12/25 00:44:32| Max Mem size: 8192 KB
2014/12/25 00:44:32| Max Swap size: 191488000 KB
2014/12/25 00:44:32| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/12/25 00:44:32| Store logging disabled
2014/12/25 00:44:32| diskHandleWrite: FD 10: disk write error: (28) No space lef t on device
FATAL: Write failure -- check your disk space and cache.log
Aborted
mohon gan di croscek apa kesalahan pada squid yang saya buat ini


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 25 Dec 2014, 10:53

sepertnya agan sdh berhasil, syg sy tdk bisa lihat tuntas hnya smpai adding name server.

apa sdh cek dg

Code: Select all

tail -f /var/log/squid/access.log
dri situ cuma ada warning name server, ini bisa diabaikan sj, yg pnting squid luscanya sdh running tpi klo mau di fix maka buka squid.conf llu sesuaikan dengan hostname server agan, cri dg ctrl+w ketik hostname, nnt ketemu visible_hostname.

jika boleh sy ingin lihat isi dri file resolv.conf server agan?


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 26 Dec 2014, 11:23

host name sudah saya beri nama berikut yang akagan maksut kan
visible_hostname inilah-proxy-dongannet
untuk resolv.conf beikut isi file na
nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 202.134.0.155
nameservers 127.0.0.1
nameserver 192.168.10.1
mohon koreksinya dan bimbingan agan ya

apa bila perintah ini saya jalankan
tail -f /var/log/squid/access.log
tidak ada akses yang berjalan

saya coba browsing dari clien jalan haya bisa di akses hanya youtube, facebook, yahoo.
kalau coba brosing ke web http://www.ubuntu-indonesia.com akan terjadi server not found jadi masalah nya kira2 dimana ya gan

saya terapkan pada mikrotik pada feriwel nat
;;; TRANSPARENT-proxy
chain=dstnat action=dst-nat to-addresses=192.168.100.253 to-ports=3128
protocol=tcp src-address=192.168.10.0/24 dst-address-list=!proxyNET


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 26 Dec 2014, 16:50

file resolv.conf ini apabila diubah akan blik lgi ke konfigurasi awalny saat kita reboot/ shutdown server.

aturan dns server di resolv.conf adalah hnya 2 dns server sj yg akan dibaca/ digunakan oleh sistem yaitu dns primary & secondary,

contoh :

Code: Select all

nameserver 127.0.0.1
nameserver 208.67.222.222
#atau
nameserver 208.67.220.220
nameserver 208.67.222.222
klo ingin tetap menkonfigurasi si resolv.conf, maka tdk usah agan tulis semua dns servernya disitu, ckup 2 dns server saja, nmun hrus di konfig ulang lgi saat server di shutdown/ reboot.

begini sj instal dns masq,

Code: Select all

apt-get update
apt-get install dnsmasq
biarkan sj dnsmasq nya dlm kondisi default.


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 26 Dec 2014, 17:01

bila dns masq sdh terpasan, agan biarkan sj resolv.conf dlm kondisi default nya yaitu ya kurang lebih sperti ini

Code: Select all

nameserver 127.0.0.1
search proxy_name.com
domain proxy_name.com
kemudian agar dns server jadi permanen konfigurasinya maka di konfig di

Code: Select all

nano /etc/network/interfaces
tambahkan dns server yg diinginkan setelah konfigurasi ip address nya, dibagian bawah

Code: Select all

dns-nameservers 208.67.222.222 208.67.220.220
dns-search proxy_name.com
#atau 
dns-nameservers 208.67.222.222
dns-nameservers 208.67.220.220
dns-search proxy_name.com
lalu

Code: Select all

service networking restart
#atau 
/etc/init.d/networking restart


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 26 Dec 2014, 17:21

maaf sy balas sepotong-sepotong krn sy pke smartphone, box balasn jd trbatas pnulisannya.

lnjut, di mikrotik
agar yg terlihat di access.log squid tdk hnya ip address proxy server saja, maka agar terlihat juga ip address client/ user
- Di konfig srcnat, pd out.interfaces isi & plih ethernet yg ke ISP
lalu,
- Di konfig dstnat, pd src.address beri centang/tanda seru [!] di kotak kecil llu ip address network server proxy misal 192.168.10.0/24, pd protocol 6 (tcp), dst. port 80, pd action to addresses ip proxy misal 192.168.10.1 to port proxy misal 3128, address list di kosongkan sj.

agan pke address list ke proxyNet itu ke ip nya siapa?


User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Post by q_p » 26 Dec 2014, 18:20

bang_andi wrote:file resolv.conf ini apabila diubah akan blik lgi ke konfigurasi awalny saat kita reboot/ shutdown server.
Kalau mau meng-ubah resolv.conf secara permanen, silahkan coba seperti di bawah ini =

[font:Courier New]root@ns1:~# cat /etc/resolv.conf
nameserver 127.0.0.1
search warnet-ersa.net
root@ns1:~# echo "8.8.8.8" >> /etc/resolvconf/resolv.conf.d/tail
root@ns1:~# resolvconf -u
root@ns1:~# cat /etc/resolv.conf
nameserver 127.0.0.1
search warnet-ersa.net
8.8.8.8[/font]


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 26 Dec 2014, 18:37

betul sekali, klo mau dibuat permanen konfigny silahkan ikuti lngkah kang q_p diatas, trims kang :)


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 28 Dec 2014, 01:06

terima kasih kang bang_andi dan kang q_p sudah memberikan moti pasi kepada saya selama ini dengan hasil sudah saya terapkan squid sudah running terima kasih atas partisifasinya,

dan akhirnya pada squid saya ganta ganti masih terjadi masalah seperti ini
root@proxyku:~# squid -d1
FATAL: Bungled squid.conf line 2: http_port 3128 transparent
Squid Cache (Version 2.5.STABLE12): Terminated abnormally.
apa bila saya tambahain tanda # http_port 3128 transparent squid running tetapi masih ada eror seperti di bawah ini
root@proxyku:~# squid -d1
2014/12/28 00:40:08| parseConfigFile: line 5 unrecognized: 'server_http11 on'
2014/12/28 00:40:08| parseConfigFile: line 10 unrecognized: 'max_filedesc 8192'
2014/12/28 00:40:08| parseConfigFile: line 95 unrecognized: 'zph_mode tos'
2014/12/28 00:40:08| parseConfigFile: line 96 unrecognized: 'zph_local 0x30'
2014/12/28 00:40:08| parseConfigFile: line 97 unrecognized: 'zph_parent 0'
2014/12/28 00:40:08| parseConfigFile: line 98 unrecognized: 'zph_option 136'
2014/12/28 00:40:08| Squid is already running! Process ID 1278
untuk lebih jelasna saya sudah coba untuk menambahkan tanda "#" di setiap line yang erorr dan saya jalankan squid
dan saya coba dan meliat access log dengan perintan tail -f /var/log/squid/access.log
1419703050.304 0 192.168.10.114 TCP_DENIED/400 1542 GET /ncsi.txt - NONE/- text/html
1419703053.565 0 192.168.10.114 TCP_DENIED/400 1542 GET /ncsi.txt - NONE/- text/html
1419703061.511 0 192.168.10.114 TCP_DENIED/400 356 HEAD /edgedl/update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703061.523 0 192.168.10.114 TCP_DENIED/400 1618 GET /edgedl/update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703064.263 0 192.168.10.114 TCP_DENIED/400 356 HEAD /edgedl/update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703067.140 0 192.168.10.114 TCP_DENIED/400 356 HEAD /update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703067.154 0 192.168.10.114 TCP_DENIED/400 1604 GET /update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703068.368 0 192.168.10.114 TCP_DENIED/400 1554 GET /us/catalystxml - NONE/- text/html
1419703068.396 0 192.168.10.114 TCP_DENIED/400 1554 GET /us/catalystxml - NONE/- text/html
1419703069.906 0 192.168.10.114 TCP_DENIED/400 356 HEAD /update2/1.3.25.11/GoogleUpdateSetup.exe - NONE/- text/html
1419703083.561 0 192.168.10.114 TCP_DENIED/400 1542 GET /ncsi.txt - NONE/- text/html
mohon akang2 memberi solusi masalah ini

terima kasih


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 28 Dec 2014, 06:31

loh...rasanya waktu itu cuma ada warning rejecting resolv.conf, kok skrg jd byk lgi?

apa agan trlalu semangat jd oprek squid.conf nya kebablasan :)

agan kasih sj tanda pagar (#) didepan server_http, max_file dan zph tsb.

yg http_port itu knp bisa jdi error, apa di deklarasikan 2 kali di dlm squid.conf ya

klo boleh coba copas squid.conf nya disini...soalnya syntax2 di situ tdk bisa sembarangan asal comot dri versi squid lainnya llu digabungkn, ya bisa error krn hrus dilihat dlu cocok atau tdk atau berbeda penulisan syntax-nya :)


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 31 Dec 2014, 00:02

maaf gan baru ni bisa saya bls

berikut isi squid.conf
# Port
#http_port 3128 transparent
icp_port 3130
prefer_direct off
#server_http11 on
# Cache
cache_mem 8 MB
cache_swap_low 98
cache_swap_high 99
#max_filedesc 8192
maximum_object_size 128 MB
minimum_object_size 0 KB
maximum_object_size_in_memory 128 KB
ipcache_size 10240
ipcache_low 98
ipcache_high 99
fqdncache_size 4096
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir aufs /cache-1 28000 67 256
cache_dir aufs /cache-2 28000 67 256
cache_dir aufs /cache-3 28000 67 256
cache_dir aufs /cache-4 28000 67 256
cache_dir aufs /cache-5 28000 67 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log none
pid_filename /var/run/squid.pid
cache_swap_log /var/log/squid/swap.state
dns_nameservers /etc/resolv.conf
emulate_httpd_log off
hosts_file /etc/hosts
half_closed_clients off
negative_ttl 1 minutes
acl all src 0.0.0.0/0.0.0.0
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 563 873 # https snews rsync
acl Safe_ports port 80 # http
acl Safe_ports port 20 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 631 # cups
acl Safe_ports port 10000 # webmin
acl Safe_ports port 901 # SWAT
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 Safe_ports port 873 # rsync
acl Safe_ports port 110 # POP3
acl Safe_ports port 25 # SMTP
acl Safe_ports port 2095 2096 # webmail from cpanel
acl Safe_ports port 2082 2083 # cpanel
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny purge
http_access deny !Safe_ports !SSL_ports
# 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-auth
#refresh_pattern ^http://*.theinquirer.*/.* 720 100% 10080 override-expire ignore-no-cache ignore-auth
#refresh_pattern ^http://*.yahoo.com/.* 720 80% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-auth
#refresh_pattern ^http://*.google.com/.* 720 80% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-auth
#refresh_pattern ^http://*.forummikrotik.com/.* 720 80% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-auth
#refresh_pattern ^http://*.linux.or.id/.* 720 100% 10080 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-auth
#default option
#refresh_pattern ^ftp: 1440 20% 10080
#refresh_pattern ^gopher: 1440 0% 1440
#refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
#refresh_pattern . 0 20% 4320
# ALLOWED ACCESS
acl localnet src 192.168.100.0/24
http_access allow localnet
http_access allow localhost
#http_access deny all
http_reply_access allow all
icp_access allow localnet
icp_access allow localhost
icp_access deny all
always_direct deny all
cache_mgr dongan@telkom.net.id
visible_hostname inilah-proxy-dongannet
cache_effective_user proxy
cache_effective_group proxy
coredump_dir /var/spool/squid
shutdown_lifetime 10 seconds
logfile_rotate 14
#-----------------------------------------------------------------#
#tcp_outgoing_tos 0x30 localnet
#-----------------------------------------------------------------#
#zph_mode tos
#zph_local 0x30
#zph_parent 0
#zph_option 136
mohon gan di koreksi
squid sudah jalan apabila saya tambah "#" pada yang eror
root@proxyku:~# squid -NC -d1
2014/12/31 01:26:13| Squid is already running! Process ID 1077


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 31 Dec 2014, 20:34

sy cuma bis liat smpe heap LFUDA, mklum ol pke smartphone, kyakny sy hrus isi ulang pulsa modem sy :)

lnjut, di squid.conf itu sy lihat pnulisan http_port, server_http sdh benar, mngkin ada kesalahan letak/ penempatan syntax-nya?

- yg kurang tepat penulisan max_filedesc, seharusnya max_filedescriptors, syntax ini letakan di bag. paling bawah sekali.

coba perbaiki max_filedescriptors ini dlu bru lnjut yg lainnya...

intinya satu persatu dulu di perbaiki biar ketahuan letak errornya, yg masih error beri lgi # di depanny kmdian lnjut fix parameter lainnya.

lalu,

- syntax server_http11 on, letakan persis sesudah http_port

- syntax icp_port, letakan persis setelah icp_access deny all

- syntax zph, letakan setelah parameter max_filedescriptors

Code: Select all

zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 31 Dec 2014, 21:05

utk http_port 3128 transparent yg error? ini biasanya terjdi krn syntax ini digunakan dlm konfigurasi squid versi lawas 2.5, syntax ini bru diterapkan dlm squid.conf mulai dri squid versi 2.6, di versi 2.7 & 3.0 pun bisa digunakan.

dri error pada kasusmu, sepertinya squid mu versi lawas? lucu, krn solusiny adalah upgrade squid ke versi 2.7 atau 3.0.x

coba lakukan ini, hilangkan dlu transparent nya shg mnjd

Code: Select all

http_port 3128
llu cek lgi dg mnjalankan/ reconfigure ulang squid

Code: Select all

squid -k reconfigure
jika squid running, coba jlnkn printah ini,

Code: Select all

netstat -ntlp | grep LISTEN
#atau
netstat -ntlp | grep :3128
#atau
lsof -i :3128
juga,

Code: Select all

squid -v
juga,

Code: Select all

ufw status
llu copas hasilnya disini, sy jd penasaran.


User avatar
citizen
Posts: 10
Joined: 06 Oct 2014, 17:33

Post by citizen » 01 Jan 2015, 21:55

Maaf bang_andi baru bisa balas

transparan sudah dihilangkan, berikut perintah yang bang andi minta hasil na
root@proxyku:~# squid -k reconfigure
root@proxyku:~# netstat -ntlp | grep LISTEN
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1033/lighttpd
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1001/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 978/sshd
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 1055/(squid)
tcp6 0 0 :::53 :::* LISTEN 1001/dnsmasq
tcp6 0 0 :::22 :::* LISTEN 978/sshd
root@proxyku:~# netstat -ntlp | grep :3128
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 1055/(squid)
root@proxyku:~# lsof -i :3128
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
squid 1055 proxy 9u IPv4 8168 0t0 TCP *:3128 (LISTEN)
root@proxyku:~# squid -v
Squid Cache: Version 2.5.STABLE12
configure options: --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindi r=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir= /var/spool/squid --datadir=/usr/share/squid --enable-async-io --with-pthreads -- enable-storeio=ufs,aufs,diskd,null --enable-linux-netfilter --enable-arp-acl --e nable-removal-policies=lru,heap --enable-snmp --enable-delay-pools --enable-htcp --enable-poll --enable-cache-digests --enable-underscores --enable-referer-log --enable-useragent-log --enable-auth=basic,digest,ntlm --enable-carp --with-larg e-files i386-debian-linux
root@proxyku:~# ufw status
Status: inactive
root@proxyku:~# squid -NC -d1
2015/01/01 21:52:20| Squid is already running! Process ID 1055
mohon bang andi koreksinya dan solusi na

apabila nat dari mikro dijalankan saya tes dari klient browsing jalan, saya coba login ke FUI terjadi ERROR
The requested URL could not be retrieved


User avatar
bang_andi
Posts: 403
Joined: 03 Sep 2010, 09:07
Location: Palembang
Been thanked: 4 times
Contact:

Post by bang_andi » 02 Jan 2015, 08:45

sprti dugaanku, versi squid agan adalah versi lawas, seharusny klo agan melakukan automated lusca install script sprti yg sy berikan diatas, maka saat cek versi squid akan muncul lusca head r14942.

nmpakny agan tdk memindahkan squid lama saat compile squid baru (lusca).

maaf jg, sy lupa bilang ke agan utk memindahkan dlu squid 2.5 nya.

Ada 2 Cara Sebagai Berikut :

Agan tentukan dulu mau pakai squid apa ? Pilih salah satu yang dibawah ini.

1. Untuk compile Squid2.7 STABLE9 secara otomatis dengan script

Code: Select all

squid -k shutdown
mkdir /etc/squid2.5
cp /etc/squid/* /etc/squid2.5
touch squid_2.7.9_install.sh
chmod +x squid_2.7.9_install.sh
nano squid_2.7.9_install.sh
Kemudian copas script yang ada pada link dibawah ini, ikuti saja petunjuknya.
Sumber : Automated Install Script of Squid2.7 STABLE9

Ini hasilnya pada server ubuntu utama saya,
Last login: Wed Dec 24 09:08:15 2014 from 10.5.x.x

root@main-proxy:~# squid -v
Squid Cache: Version 2.7.STABLE9
configure options: '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--sysconfdir=/etc/squid' '--localstatedir=/var/spool/squid' '--datadir=/usr/share/squid' '--enable-async-io=24' '--with-aufs-threads=24' '--with-pthreads' '--enable-storeio=aufs' '--enable-linux-netfilter' '--enable-arp-acl' '--enable-epoll' '--enable-removal-policies=heap,lru' '--with-aio' '--with-dl' '--enable-snmp' '--enable-delay-pools' '--enable-htcp' '--enable-cache-digests' '--disable-unlinkd' '--enable-large-cache-files' '--with-large-files' '--enable-err-languages=English' '--enable-default-err-language=English' '--with-maxfd=65536'
2. Untuk compile Squid Lusca r14942 secara otomatis dengan script

Code: Select all

squid -k shutdown
mkdir /etc/squid2.5
cp /etc/squid/* /etc/squid2.5
cd /tmp
touch lusca_install.sh
chmod +x lusca_install.sh
nano lusca_install.sh
Kemudian copas script yang ada pada link dibawah ini, ikuti saja petunjuknya.
Sumber : Automated Install Script of Squid Lusca r14942

ini hasilnya sprt pada server ubuntu 14.04 saya, hasilnya saat di cek adalah sprti berikut,
Last login: Fri Jan 2 08:27:59 2015 from 114.125.x.x

root@backup-proxy:~# squid -v
Squid Cache: Version LUSCA_HEAD-r14942
configure options: '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--sysconfdir=/etc/squid' '--localstatedir=/var/spool/squid' '--datadir=/usr/share/squid' '--enable-async-io=24' '--with-aufs-threads=24' '--with-pthreads' '--enable-storeio=aufs' '--enable-linux-netfilter' '--enable-arp-acl' '--enable-epoll' '--enable-removal-policies=heap' '--with-aio' '--with-dl' '--enable-snmp' '--enable-delay-pools' '--enable-htcp' '--enable-cache-digests' '--disable-unlinkd' '--enable-large-cache-files' '--with-large-files' '--enable-err-languages=English' '--enable-default-err-language=English' '--enable-referer-log' '--with-maxfd=65536'
root@backup-proxy:~#
Coba dulu gan, nanti laporan lagi disini :)


Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests