SQUID With Mysql
SQUID MYSQL_AUTH
by anto chuakev on Oct.22, 2009, under SQUID With Mysql
- Install SQUID
- install MySQL
- Install Apache
- download mysql_auth(http://people.arxnet.hu/airween/mysql_auth/mysql_auth-0.8.tar.gz)
- Install LibMySQLclient-dev
- Extrack mysql_auth (tar zxvf mysql_auth-0.8.tar.gz)
- Compile dan install (make, make install) Mysql_auth
- Buat database menggunakan script yang ada di direktori scripts.
mysql -u root -p < create_script
- Tambahkan beberapa user pd database tersebut. (lihat struktur tabel di file create_script)
- Ubah configurasi squid.conf tambahkan paramater :
auth_param basic program /usr/lib/squid/mysql_auth
auth_param basic children 5
auth_param basic realm Magnet Internet Authentication
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl mysql_user proxy_auth REQUIRED
http_access allow mysql_user
-start squid (/etc/init.d/squid start)
sumber : http//stikom.edu
artikel ini dibuat untuk kamu2 yg ingin membuat authentifikasi squid dan user dan password disimpan di database mysql
asumsi-2:
1. squid-2.4 atau squid-2.5 terinstall dgn baik, dan user dan group yg menjalankan Squid adalah squid (lihat /etc/passwd)
2. mysql (versi berapa aja) terinstall dgn baik
3. RH 7.1 (atau linux yg lainnya
4. gcc, et al
5. admin tidak gila
6. yg kurang mohon ditambahkan sendiri
file yg perlu di download:
mysql_auth-0.5.tar.gz (http://freshmeat.net/projects/mysql_auth/)
langkah2 :
1. Ekstrak file mysql_auth
# tar xzpf mysql_auth-0.5.tar.gz
# cd mysql_auth-0.5
2. Cari dan catat lokasi file mysql.h dan libmysqlclient.a
# locate mysql.h
/usr/include/mysql/mysql.h
# locate libmysqlclient.a
/usr/lib/mysql/libmysqlclient.a
3. edit file Makefile
# vi Makefile
ubah baris2 berikut :
a. CFLAGS = -I/usr/local/include -L/usr/local/lib
menjadi
CFLAGS = -I/usr/include/mysql -L/usr/lib/mysql
note : perhatikan yg dicetak tebal di langkah 2 harus sama dengan yg dicetak tebal pada langkah diatas
b. $(INSTALL) -o nobody -g nogroup -m 755 mysql_auth /usr/local/squid/bin/mysql_auth
menjadi
$(INSTALL) -o squid -g squid -m 755 mysql_auth /usr/bin/mysql_auth
c. $(INSTALL) -o nobody -g nogroup -m 600 $(CONF) /usr/local/squid/etc/mysql_auth.conf
menjadi
$(INSTALL) -o squid -g squid -m 600 $(CONF) /etc/mysql_auth.conf
d. $(INSTALL) -o nobody -g nogroup -m 600 $(CONF) /usr/local/squid/etc/mysql_auth.conf.default
menjadi
$(INSTALL) -o squid -g squid -m 600 $(CONF) /etc/mysql_auth.conf.default
catatan : bila user dan group yg menjalankan bukan “squid”, misalnya “otong”, ganti -o squid -g squid menjadi -o otong -g otong
4. edit src/define
# vi +5 src/define.h
ubah baris
#define CONFIG_FILE “/usr/local/squid/etc/mysql_auth.conf”
menjadi
#define CONFIG_FILE “/etc/mysql_auth.conf”
5. compile dan install
# make
# make install
6. tambahkan database untuk authentifikasi
# cd scripts
# mysql -u root -p < create_script
7. untuk konfigurasi file /etc/mysql_auth.conf, tambahkan user yang bisa menangani mysql_auth database, misalnya user squid dan password squid
a. ganti user menjadi
user squid
b. ganti password menjadi
password squid
c. enkripsi password user menjadi
encrypt_password_form YES
8. tambahkan user ke database
# /usr/bin/mypasswd userbaru passwordnya
9. test mysql_auth
# /usr/bin/mysql_auth
userbaru
passwordnya
OK / ERR
10. konfigurasi squid
a. untuk squid 2.4 tambahkan direktif ini
proxy_auth_realm Squid proxy server
authenticate_program /usr/bin/mysql_auth
authenticate_ttl 10 seconds
authenticate_children 10
acl butuhpasswd proxy_auth REQUIRED
http_access allow butuhpasswd
http_access deny all
b. untuk squid 2.5. tambahkan direktif ini
auth_param basic program /usr/bin/mysql_auth
auth_param basic realm Squid proxy-caching web server
auth_param basic children 5
auth_param basic credentialsttl 2 hours
acl password proxy_auth REQUIRED
http_access allow password
authenticate_ip_ttl 2 hours
http_access deny all
11. arahkan browser dengan menggunakan proxy, klik tool -> internet option -> Connections -> LAN Settings
12. smoga bisa
Note: Thanks linux2.arinet.org
sumber : http://linux2.arinet.org
Looking for something?
Use the form below to search the site:
Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!
Design by bonkqloph Production
Archives
All entries, chronologically...
