0% found this document useful (0 votes)
212 views

PC Route

The document provides instructions for configuring a PC router with Linux Ubuntu server. It includes steps to: 1. Update and upgrade packages, configure network and DNS files. 2. Install DHCP and Squid servers and additional packages. 3. Configure Squid, firewall rules, and crontab jobs for log analysis tools. 4. Set up a captive portal with YFi using CakePHP, additional languages, and FreeRADIUS/Coova Chilli for authentication.

Uploaded by

virbo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views

PC Route

The document provides instructions for configuring a PC router with Linux Ubuntu server. It includes steps to: 1. Update and upgrade packages, configure network and DNS files. 2. Install DHCP and Squid servers and additional packages. 3. Configure Squid, firewall rules, and crontab jobs for log analysis tools. 4. Set up a captive portal with YFi using CakePHP, additional languages, and FreeRADIUS/Coova Chilli for authentication.

Uploaded by

virbo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Langkah konfigurasi PC Route dengan linux ubuntu server

1. apt-get update dan apt-get upgrade


2. Konfigurasi file interfaces (/etc/network/interfaces), kemudian restart.
3. Konfigurasi file resolv.conf
4. Konfigurasi file sysctl.conf
5. Buat dns server local (bisa juga diabaikan)
6. Install DHCP Server (dhcp3-server)
7. Install package2 yang diperlukan (lihat daftar)
8. Install squid (squid, squid-common, squid-cgi, squidclient). Kemudian konfigurasi squid sesuai dengan kebutuhan.
9. Konfigurasi file rc.local

Package2 yang dibutuhkan


1. libphp-adodb
2. php5-cli
3. php5-gd
4. php-pear
5. php5-snmp
6. php5-adodb
7. snmp
8. snmpd
9. rrdtool
10. dbconfig-common
11. clamav, clamav-daemon, clamav-docs, clamav-testfiles, clamav-freshclam, clamav-base
12. havp
13. squidguardian
14. calamaris
15. sarg (sarg calamaris libgd-graph-perl libnetaddr-ip-perl ttf-dustin)

Tools2 yang sering digunakan:


1. phpmyadmin
2. webmin
3. iptraf
4. iftop
5. whois
6. sysstat
7. nbtscan

Setting DHCP Server


/etc/dhcp3/dhcpd.conf
/etc/default/dhcp3-server
/etc/init.d/dhcp3-server restart

Install squid
apt-get install havp squid squid-common squid-cgi squidclient
Konfigurasi squid
/etc/init.d/squid stop
chown -R proxy.proxy /home/proxy1
chown -R proxy.proxy /home/proxy2
chown -R proxy.proxy /home/proxy3
# squid -f /etc/squid/squid.conf -z
# /etc/init.d/squid restart

iptables -t nat -I PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -I PREROUTING -i eth0 -p udp -m udp --dport 80 -j REDIRECT --to-ports 3128

Untuk Crontab (crontab –e)


* * */1 * * /usr/bin/freshclam
* */1 * * * /usr/sbin/sarg-reports today
* */6 * * * calamaris -a -F html /var/log/squid/access.log > /var/www/calamaris/index.html
CAPTIVE PORTAL + YFI

PACKAGE2 YANG DIPERLUKAN:


 php5-cli
 imagemagick
 language-pack-id --- bahasa Indonesia
 language-pack-af
 language-pack-fr
 language-pack-ms
 language-pack-nl
 language-pack-es
 LAMP (Linux-Apache-Mysql-Php)

LANGKAH KONFIGURASI PC-ROUTER:


1. Konfigurasi interface network (/etc/network/interfaces)

auto lo
iface lo inet loopback

iface eth0 inet static


address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1 ----- ip modem

iface eth2 inet static


address 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

2. Konfigurasi file sysctl.conf. ini dimaksudkan agar pc-route kita bias memformat request dari klient ke internet. Edit file tersebut menjadi seperti
dibawah ini:
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1

net.ipv4.ip_forward=1

LANGKAH PENGINSTALL
Yang akan diinstall:
 CakePHP
 YFi CakePHP Application
 YFi View Component
 FreeRADIUS
 Coova Chilli

1. Install CakePHP

a. Download CakePHP di http://cakephp.org saat ini sudah versi 1.2.6


b. Copy, extract di direktori apache. Default ubuntu di /var/www

cp cakephp-cakephp1x-1.2.6-0-gbe7ddfb.tar.gz /var/www
cd /var/www
tar -xzvf cakephp-cakephp1x-1.2.6-0-gbe7ddfb.tar.gz

c. Rename direktori hasil ekstrak, agar lebih simpel (misal:cake_1.2.6). setelah itu buat symbolic link

cd /var/www
ln -s ./cake_1.2.6 ./c2

d. Enable beberapa modul apache: rewrite, deflate untuk kompresi, dan headers untuk memodifikasi http header. Modul tersebut diperlukan
untuk meningkatkan performance dan kecepatan web aplikasi..

sudo a2enmod rewrite


sudo a2enmod deflate
sudo a2enmod headers
sudo /etc/init.d/apache2 reload

e. Edit file "/etc/php5/apache2/php.ini"


output_buffering = Off

Ubah menjadi:
output_buffering = 4096
f. Edit file /etc/apache2/apache2.conf dan masukkan script dibawah ini:

<Directory /var/www/c2>
AllowOverride All
</Directory>

#-------COMPRESS CONTENT-----------

# place filter 'DEFLATE' on all outgoing content


SetOutputFilter DEFLATE

# exclude uncompressible content via file type


SetEnvIfNoCase Request_URI \.(?:exe|t?gz|jpg|png|pdf|zip|bz2|sit|rar)$ no-gzip

#dont-vary

# Keep a log of compression ratio on each request


DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog /var/log/apache2/deflate.log deflate

# Properly handle old browsers that do not support compression


BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

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

#------ADD EXPIRY DATE-------------

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
</FilesMatch>

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

#--------Remove ETags --------------------

FileETag none

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

g. Reload Apache
/etc/init.d/apache2 reload

2. Install YFi CakePHP Application


a. Download versi terbaru di http://sourceforge.net/projects/hotcakes/files/ saat ini versi yfi_cake-Beta-4.tar.gz
b. Extract di direktori "/var/www/c2" (direktori yang telah dibuat pada langkah diatas).
cp yfi_cake-Beta-4.tar.gz /var/www/c2
cd /var/www/c2
tar -xzvf yfi_cake-Beta-4.tar.gz
chown -R www-data. /var/www/c2/yfi_cake/tmp
chown -R www-data. var/www/c2/yfi_cake/webroot/img/graphics

c. Buat database 'yfi' dengan username dan password default 'yfi' (default). Untuk settingan default gunakan perintah ini :

mysql -u root -p
create database yfi;
GRANT ALL PRIVILEGES ON yfi.* to 'yfi'@'127.0.0.1' IDENTIFIED BY 'yfi';
GRANT ALL PRIVILEGES ON yfi.* to 'yfi'@'localhost' IDENTIFIED BY 'yfi';
exit;

Catatan: Untuk keamanan anda bisa ubah username dan password, misal: “hotspot". Jangan lupa untuk ubah File
'/var/www/c2/yfi_cake/config/database.php', Dibagian username dan password.

d. Masukkan database sample:


mysql -u root -p yfi < /var/www/c2/yfi_cake/setup/db/yfi.sql

e. Test YFI CakePHP di browser dengan ketik alamat: http://ip_server/yfi_cake/users . Jika yang ditampilkan halaman login maka installasi
berhasil.

3. Install YFi View Component


a. Download TFI View component dari http://sourceforge.net/projects/hotcakes/files/ saat ini versi yfi-Beta-4.tar.gz
b. Extract di directory default apache2 “/var/www "
cp yfi-Beta-4.tar.gz /var/www
cd /var/www
tar -xzvf yfi-Beta-4.tar.gz

c. Test viewer component dengan mengetikkan http://ip_server/yfi di browser. Jika instalasi berhasil akan keluar splash page dan kemudian
akan tampil halaman login.
d. Test login menggunakan salah satu user default berikut:
ROLE USERNAME PASSWORD
Administrator root admin
4. Access Provider
Install FreeRADIUS ap ap
Permanent User dvdwalt@ri dvdwalt@ri
YFi Hotspot Manager merupakan front-end dari mysql database yang digunakan oleh FreeRADIUS. Yang dipakai adalah versi radius terbaru
yaitu 2.1.8.
a. Pastikan package berikut sudah terinstall:

sudo apt-get install build-essential libmysqlclient15-dev libperl-dev libxml-simple-perl


libmail-sendmail-perl

b.

5. Install Coova Chilli

You might also like