Sabtu, 16 Juni 2007
Mengkonfigurasi DNS server di Debian Woody
1)Pengertian
DNS (Domain Name System) berfungsi untuk merubah dari bentuk alamat IP internet computer ke dalam bentuk nama yang mudah kita ingat contohnya: alamat IP address 192.168.1.25 menjadi www.erwindebian.local.. Sehingga kita tidak akan kesulitan dalam mengingat suatu alamat dari server karena telah diubah kedalam nama-nama yang mudah diingat seperti alamat www.yahoo.com,www.google.com, dll.
2)Konfigurasi Server.
DNS di Depdiknux ini menggunakan software yang bernama Bind9. Dalam Mengkonfigurasi server DNS file konfigurasi utama terletak pada named.conf.
Didalam DNS itu ada yang dimaksud dengan Reverse zone dan Forward Zone.
a)Forward zone adalah pengubahan dari dalam bentuk IP address ke dalam bentuk nama
.
b)Reverse zone adalah pengubahan dari dalam bentuk nama kedalam bentuk IP, biasanya ini dikonfigurasi sesudah Forward zone dikonfigurasi.
Berikut contoh konfigurasi:
2.1)Buka dan edit file /etc/bind/named.conf :
#vi /etc/bind/named.conf
Note: vi adalah nama software editor kalau di Windows seperti notepad.
Sekarang anda tinggal tambahkan seperti dibawah ini:(gunakan tombol [insert] atau tombol I untuk mengedit)
zone "erwindebian.local" { #ini untuk konfigurasi forward zone
type master; #erwindebian.local adalah nama domain
file "/etc/bind/wien.zone"; #bisa kita ubah terserah nama
}; #yang kita kehendaki
zone "192.in-addr.arpa"{ #ini konfigurasi untuk reverse zone
type master;
file "/etc/bind/wien.rev";
};
Sekarang kita bisa keluar dari editor vi dengan menggunakan tombol [Esc] lalu :wq.
Seharusnya file asli named.conf akan seperti dibawah ini:
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
zone "erwindebian.local" {
type master;
file "/etc/bind/wien.zone";
};
zone "192.in-addr.arpa"{
type master;
file "/etc/bind/wien.rev";
};
Coba anda perhatikan konfigurasi file diatas. Untuk mempermudah anda tidak perlu mengingat kata-kata tambahan tadi, anda tinggal melihat konfigurasi atasnya saja.
Coba anda perhatikan baris kata file "/etc/bind/wien.zone" dan file "/etc/bind/wien.rev" itu merupakan file konfigurasi untuk forward zone dan reverse zone yang sekarang akan kita buat.
2.2)Untuk mempermudah konfigurasi Forward zone di file /etc/bind/wien.zone, kita kopikan file /etc/bind/db.local ke /etc/bind/wien.zone.
# cp /etc/bind/db.local /etc/bind/wien.zone
Lalu Edit file /etc/bind/wien.zone seperti dibawah ini:
# vi /etc/bind/wien.zone
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA erwindebian.local. root.erwindebian.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS erwindebian.local.
@ IN A 192.168.1.25
server IN A 192.168.1.25
www IN CNAME server
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Note:
@ IN NS erwindebian.local adalah NS (name server) yang dibuat tadi di /etc/bind/named.conf
@ IN A 192.168.1.25 adalah alamat IP untuk erwindebian.local.
server IN A 192.168.1.25 adalah bahwa server.erwindebian.local nama lain dari 192.168.1.25.
www IN CNAME server adalah bahwa www.erwindebian.local sama dengan server.erwindebian.local yaitu memiliki alamat 192.168.1.25.
Sekarang kita buat untuk reverse zone :
#cp /etc/bind/db.255 /etc/bind/wien.rev
Lalu buat masukkan konfigurasi seperti dibawah ini:
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA erwindebian.local. root.erwindebian.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS erwindebian.local.
14.1.168 IN PTR server.erwindebian.local.
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Note:
@ IN NS erwindebian.local. adalah NS (name server) yang dibuat tadi di /etc/bind/named.conf
14.1.168 IN PTR server.erwindebian.local. adalah alamat dari server.depdiknux.local, coba anda perhatikan alamat IP nya harus terbalik dan tidak ada angka 192, angka 192 di inisialisasikan di named.conf.Untuk lebih jelas buka kembali file /etc/bind/named.conf.
2.3)Kita restart DNS nya:
#/etc/init.d/bind9 restart
Jangan lupa untuk merubah name server ke IP address computer anda karena DNS kita belum dihosting.
#vi /etc/resolv.conf
nameserver 192.168.1.25 (IP address computer anda)
Masukkan nameserver [IP address computer anda] di barisan paling atas.
Kita check apakah sudah jalan DNS nya
#host erwindebian.local (enter) //maka akan tampil seperti dibawah ini
Depdiknux.local has address 192.168.1.25
Selamat DNS server anda sudah jalan, jika tidak sesuai dengan hasil diatas maka anda bisa mengulanginya.
DNS (Domain Name System) berfungsi untuk merubah dari bentuk alamat IP internet computer ke dalam bentuk nama yang mudah kita ingat contohnya: alamat IP address 192.168.1.25 menjadi www.erwindebian.local.. Sehingga kita tidak akan kesulitan dalam mengingat suatu alamat dari server karena telah diubah kedalam nama-nama yang mudah diingat seperti alamat www.yahoo.com,www.google.com, dll.
2)Konfigurasi Server.
DNS di Depdiknux ini menggunakan software yang bernama Bind9. Dalam Mengkonfigurasi server DNS file konfigurasi utama terletak pada named.conf.
Didalam DNS itu ada yang dimaksud dengan Reverse zone dan Forward Zone.
a)Forward zone adalah pengubahan dari dalam bentuk IP address ke dalam bentuk nama
.
b)Reverse zone adalah pengubahan dari dalam bentuk nama kedalam bentuk IP, biasanya ini dikonfigurasi sesudah Forward zone dikonfigurasi.
Berikut contoh konfigurasi:
2.1)Buka dan edit file /etc/bind/named.conf :
#vi /etc/bind/named.conf
Note: vi adalah nama software editor kalau di Windows seperti notepad.
Sekarang anda tinggal tambahkan seperti dibawah ini:(gunakan tombol [insert] atau tombol I untuk mengedit)
zone "erwindebian.local" { #ini untuk konfigurasi forward zone
type master; #erwindebian.local adalah nama domain
file "/etc/bind/wien.zone"; #bisa kita ubah terserah nama
}; #yang kita kehendaki
zone "192.in-addr.arpa"{ #ini konfigurasi untuk reverse zone
type master;
file "/etc/bind/wien.rev";
};
Sekarang kita bisa keluar dari editor vi dengan menggunakan tombol [Esc] lalu :wq.
Seharusnya file asli named.conf akan seperti dibawah ini:
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
zone "erwindebian.local" {
type master;
file "/etc/bind/wien.zone";
};
zone "192.in-addr.arpa"{
type master;
file "/etc/bind/wien.rev";
};
Coba anda perhatikan konfigurasi file diatas. Untuk mempermudah anda tidak perlu mengingat kata-kata tambahan tadi, anda tinggal melihat konfigurasi atasnya saja.
Coba anda perhatikan baris kata file "/etc/bind/wien.zone" dan file "/etc/bind/wien.rev" itu merupakan file konfigurasi untuk forward zone dan reverse zone yang sekarang akan kita buat.
2.2)Untuk mempermudah konfigurasi Forward zone di file /etc/bind/wien.zone, kita kopikan file /etc/bind/db.local ke /etc/bind/wien.zone.
# cp /etc/bind/db.local /etc/bind/wien.zone
Lalu Edit file /etc/bind/wien.zone seperti dibawah ini:
# vi /etc/bind/wien.zone
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA erwindebian.local. root.erwindebian.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS erwindebian.local.
@ IN A 192.168.1.25
server IN A 192.168.1.25
www IN CNAME server
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Note:
@ IN NS erwindebian.local adalah NS (name server) yang dibuat tadi di /etc/bind/named.conf
@ IN A 192.168.1.25 adalah alamat IP untuk erwindebian.local.
server IN A 192.168.1.25 adalah bahwa server.erwindebian.local nama lain dari 192.168.1.25.
www IN CNAME server adalah bahwa www.erwindebian.local sama dengan server.erwindebian.local yaitu memiliki alamat 192.168.1.25.
Sekarang kita buat untuk reverse zone :
#cp /etc/bind/db.255 /etc/bind/wien.rev
Lalu buat masukkan konfigurasi seperti dibawah ini:
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA erwindebian.local. root.erwindebian.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS erwindebian.local.
14.1.168 IN PTR server.erwindebian.local.
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Note:
@ IN NS erwindebian.local. adalah NS (name server) yang dibuat tadi di /etc/bind/named.conf
14.1.168 IN PTR server.erwindebian.local. adalah alamat dari server.depdiknux.local, coba anda perhatikan alamat IP nya harus terbalik dan tidak ada angka 192, angka 192 di inisialisasikan di named.conf.Untuk lebih jelas buka kembali file /etc/bind/named.conf.
2.3)Kita restart DNS nya:
#/etc/init.d/bind9 restart
Jangan lupa untuk merubah name server ke IP address computer anda karena DNS kita belum dihosting.
#vi /etc/resolv.conf
nameserver 192.168.1.25 (IP address computer anda)
Masukkan nameserver [IP address computer anda] di barisan paling atas.
Kita check apakah sudah jalan DNS nya
#host erwindebian.local (enter) //maka akan tampil seperti dibawah ini
Depdiknux.local has address 192.168.1.25
Selamat DNS server anda sudah jalan, jika tidak sesuai dengan hasil diatas maka anda bisa mengulanginya.
Labels:
linux
Konfigurasi Proxy Server dengan SQUID
1)Pengertian
Proxy Server berfungsi untuk:
a)Melakukan cache website yang di akses oleh klien.
b)Melakukan ACL (Access Control List) IP mana saja yang boleh melakukan akses internet.
c)Memblokir situs-situs tertentu supaya tidak dapat diakses klien.
d)Melakukan pembatasan download terhadap file berekstension tertentu
Software yang digunakan Squid.
2)Konfigurasi Proxy server.
Buka file /etc/squid/squid.conf
#vi /etc/squid/squid.conf
Lalu edit dan tambahkan:
http_port 192.168.1.25:8080
cache_dir ufs /var/spool/squi d 1000 16 256 #1000 tergantung #dari space hardisk anda sebaiknya dibuat besar,ukuran dalam Mb
acl net src 192.168.1.0/255.255.255.0 #cari deretan acl
http_access allow net #cari deretan http_access
visible_hostname lks #lks adalah nama hostname anda
#settingan dibawah ini adalah untuk konfigurasi transparent proxy.
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Setelah dikonfigurasi lalu restart squid anda
#/etc/init.d/squid restart
Lalu check apakah port squid proxy yaitu 8080 sudah berjalan dalam system.
#netstat –tapn | grep 8080 (enter)
tcp 0 192.168.1.14:8080 0.0.0.0:* LISTEN 3668/(squid)
maka proxy telah berjalan, sekarang tinggal melakukan Transparant Proxy yaitu apabila ada klien yang melakukan akses ke port 80 maka akan langsung menuju port 8080 yaitu port proxy server kita, sehingga aturan-aturan yang ada pada proxy kita dapat diikuti oleh klien kita.
Note: port adalah angka-angka yang menunjukkan service-service tertentu,setiap service memiliki nomor port tertentu.
Pengesetan Transparant Proxy berhubungan dengan IPTABLES
Transparant proxy hanya tinggal melakukan redirect port 80 ke port 8080
#iptables –t nat –A PREROUTING –i eth0 –p tcp –dport 80 –j REDIRECT –to-port 8080
Lalu check dengan menggunakan perintah
#iptables –L –t nat
Akan tampil
Chain PREROUTING (policy ACCEPT)
Target prot opt source destination
MASQUERADE tcp -- anywhere anywhere tcp:dpt www redir port 8080
Lalu save settingan iptables anda
#iptables-save
Untuk mengecheck apakah proxy anda sudah transparent lihat file /var/log/squid/access.log
#tail –f /var/log/squid/access.log
Jika anda melihat situs-situr yang klien anda telah akses tampil disana berarti setingan transparent proxy anda berhasil
3)Melakukan blokir situs tertentu menggunakan proxy server.
Buat suatu file seperti di /etc/porn.list.
#vi /etc/porn.list
Dengan berisikan:
.17tahun.com #semua yang memilki domain 17tahun.com akan diblok
.sex.com
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Isi file URL tersebut tergantung anda.
Lalu buka file squid.conf:
#vi /etc/squid/squid.conf
Lalu masukkan seperti dibawah ini:
acl blok url_regex -i “/etc/porn.list” #masukkan dideretan baris ACL
http_access deny blok #masukkan dideretan paling atas http_access
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Setelah itu restart squid anda
#/etc/init.d/squid restart
Coba anda buka di browser klien lalu buka situs www.17tahun.com atau situs yang tadi anda masukkan di didalam file /etc/porn.list.Jika ada tulisan Access Denied berarti anda telah berhasil!
Proxy Server berfungsi untuk:
a)Melakukan cache website yang di akses oleh klien.
b)Melakukan ACL (Access Control List) IP mana saja yang boleh melakukan akses internet.
c)Memblokir situs-situs tertentu supaya tidak dapat diakses klien.
d)Melakukan pembatasan download terhadap file berekstension tertentu
Software yang digunakan Squid.
2)Konfigurasi Proxy server.
Buka file /etc/squid/squid.conf
#vi /etc/squid/squid.conf
Lalu edit dan tambahkan:
http_port 192.168.1.25:8080
cache_dir ufs /var/spool/squi d 1000 16 256 #1000 tergantung #dari space hardisk anda sebaiknya dibuat besar,ukuran dalam Mb
acl net src 192.168.1.0/255.255.255.0 #cari deretan acl
http_access allow net #cari deretan http_access
visible_hostname lks #lks adalah nama hostname anda
#settingan dibawah ini adalah untuk konfigurasi transparent proxy.
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Setelah dikonfigurasi lalu restart squid anda
#/etc/init.d/squid restart
Lalu check apakah port squid proxy yaitu 8080 sudah berjalan dalam system.
#netstat –tapn | grep 8080 (enter)
tcp 0 192.168.1.14:8080 0.0.0.0:* LISTEN 3668/(squid)
maka proxy telah berjalan, sekarang tinggal melakukan Transparant Proxy yaitu apabila ada klien yang melakukan akses ke port 80 maka akan langsung menuju port 8080 yaitu port proxy server kita, sehingga aturan-aturan yang ada pada proxy kita dapat diikuti oleh klien kita.
Note: port adalah angka-angka yang menunjukkan service-service tertentu,setiap service memiliki nomor port tertentu.
Pengesetan Transparant Proxy berhubungan dengan IPTABLES
Transparant proxy hanya tinggal melakukan redirect port 80 ke port 8080
#iptables –t nat –A PREROUTING –i eth0 –p tcp –dport 80 –j REDIRECT –to-port 8080
Lalu check dengan menggunakan perintah
#iptables –L –t nat
Akan tampil
Chain PREROUTING (policy ACCEPT)
Target prot opt source destination
MASQUERADE tcp -- anywhere anywhere tcp:dpt www redir port 8080
Lalu save settingan iptables anda
#iptables-save
Untuk mengecheck apakah proxy anda sudah transparent lihat file /var/log/squid/access.log
#tail –f /var/log/squid/access.log
Jika anda melihat situs-situr yang klien anda telah akses tampil disana berarti setingan transparent proxy anda berhasil
3)Melakukan blokir situs tertentu menggunakan proxy server.
Buat suatu file seperti di /etc/porn.list.
#vi /etc/porn.list
Dengan berisikan:
.17tahun.com #semua yang memilki domain 17tahun.com akan diblok
.sex.com
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Isi file URL tersebut tergantung anda.
Lalu buka file squid.conf:
#vi /etc/squid/squid.conf
Lalu masukkan seperti dibawah ini:
acl blok url_regex -i “/etc/porn.list” #masukkan dideretan baris ACL
http_access deny blok #masukkan dideretan paling atas http_access
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Setelah itu restart squid anda
#/etc/init.d/squid restart
Coba anda buka di browser klien lalu buka situs www.17tahun.com atau situs yang tadi anda masukkan di didalam file /etc/porn.list.Jika ada tulisan Access Denied berarti anda telah berhasil!
Labels:
linux
Konfigurasi Gateway menggunakan IPTABLES
1)Pengertian
Gateway adalah suatu cara supaya client yang terhubung ke server dapat terhubung ke internet, ini merupakan salah satu cara yang sangat penting dan sangat perlu apabila kita ingin membuat client-client terhubung ke internet.
IPtables adalah nama software untuk membuat gateway sekaligus software firewall.
2)Konfigurasi
Pastikan bahwa server dapat melakukan ping ke alamat website luar.
#ping www.yahoo.com
Buat supaya server kita bisa melakukan forwarding paket-paket dengan cara:
#vi /etc/network/options
Lalu buat ip_forward=no menjadi ip_forward=yes
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart network :
#/etc/init.d/networking restart
Lalu Check :
#cat /proc/sys/net/ipv4/ip_forward (enter)
1
Angka di dalam file tersebut harus bernilai 1.
Setelah semua itu selesai sekarang tinggal konfigurasi iptables
#iptables –t nat –A POSTROUTING –s 0.0.0.0/0 –d 0.0.0.0/0 –j MASQUERADE (enter)
Check dengan perintah
#iptables –L –t nat
Perhatikan harus tampil seperti dibawah ini:
Chain POSTROUTING (policy ACCEPT)
Target prot opt source destination
MASQUERADE all -- anywhere anywhere
#iptables–save
Perintah diatas digunakan untuk menyimpan konfigurasi iptables supaya saat system melakukan reboot konfigurasi diatas tidak terhapus.
Sekarang anda test dari computer klien yang terhubung ke server dengan melakukan ping
ping www.yahoo.com
Jika berhasil maka anda telah berhasil membuat gateway.
Gateway adalah suatu cara supaya client yang terhubung ke server dapat terhubung ke internet, ini merupakan salah satu cara yang sangat penting dan sangat perlu apabila kita ingin membuat client-client terhubung ke internet.
IPtables adalah nama software untuk membuat gateway sekaligus software firewall.
2)Konfigurasi
Pastikan bahwa server dapat melakukan ping ke alamat website luar.
#ping www.yahoo.com
Buat supaya server kita bisa melakukan forwarding paket-paket dengan cara:
#vi /etc/network/options
Lalu buat ip_forward=no menjadi ip_forward=yes
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart network :
#/etc/init.d/networking restart
Lalu Check :
#cat /proc/sys/net/ipv4/ip_forward (enter)
1
Angka di dalam file tersebut harus bernilai 1.
Setelah semua itu selesai sekarang tinggal konfigurasi iptables
#iptables –t nat –A POSTROUTING –s 0.0.0.0/0 –d 0.0.0.0/0 –j MASQUERADE (enter)
Check dengan perintah
#iptables –L –t nat
Perhatikan harus tampil seperti dibawah ini:
Chain POSTROUTING (policy ACCEPT)
Target prot opt source destination
MASQUERADE all -- anywhere anywhere
#iptables–save
Perintah diatas digunakan untuk menyimpan konfigurasi iptables supaya saat system melakukan reboot konfigurasi diatas tidak terhapus.
Sekarang anda test dari computer klien yang terhubung ke server dengan melakukan ping
ping www.yahoo.com
Jika berhasil maka anda telah berhasil membuat gateway.
Labels:
linux
Konfigurasi Apache, PHP, MySQL
1)Pengertian
Apache adalah salah satu jenis WebServer yang cukup powerfull yang free dan OpenSource.
MySQL adalah salah satu jenis Database Server yang biasa digunakan di Linux
2)Konfigurasi server apache dan PHP
Buka dan edit file /etc/apache/httpd.conf
#vi /etc/apache/httpd.conf
Lalu rubah ServerName ke alamat IP address server anda:
Servername 192.168.1.14
DocumentRoot /var/www //file untuk menyimpan file dan Document webserver
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart apache
#/etc/init.d/apache restart
Check dengan menggunakan netstat
#netstat –tapn | grep 80
Tcp 0 0 0.0.0.0:80 0.0.0.0:* Listen 7496/apache
Itu menunjukkan webserver anda telah berjalan dengan baik
Coba anda browse di konsol dengan menggunakan lynx
#lynx 192.168.1.14
Maka akan tampil ucapan selamat datang dari Apache
Kita coba dengan menggunakan script PHP
Simpan file PHP di Document root webserver yaitu /var/www
#vi /var/www/index.php
Masukkan script PHP (Dibawah ini untuk memperlihatkan phpinfo):
phpinfo();
?>
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart Apache anda:
#/etc/init.d/apache restart
Browse dengan lynx:
#lynx 192.168.1.14/index.php
Jika muncul informasi tentang PHP berarti PHP sudah jalan.
3)Konfigurasi MySQL Database server.
Jalankan Mysql anda
#/etc/init.d/mysql restart
Lalu anda masuk ke mysql
#mysql –u root –p (enter)
Saat menanyakan password enter lagi.
Maka akan muncul
mysql>
Jika akan keluar dari mysql
mysql>quit (enter)
Konfigurasi Apache,PHP,Mysql telah selesai.
Apache adalah salah satu jenis WebServer yang cukup powerfull yang free dan OpenSource.
MySQL adalah salah satu jenis Database Server yang biasa digunakan di Linux
2)Konfigurasi server apache dan PHP
Buka dan edit file /etc/apache/httpd.conf
#vi /etc/apache/httpd.conf
Lalu rubah ServerName ke alamat IP address server anda:
Servername 192.168.1.14
DocumentRoot /var/www //file untuk menyimpan file dan Document webserver
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart apache
#/etc/init.d/apache restart
Check dengan menggunakan netstat
#netstat –tapn | grep 80
Tcp 0 0 0.0.0.0:80 0.0.0.0:* Listen 7496/apache
Itu menunjukkan webserver anda telah berjalan dengan baik
Coba anda browse di konsol dengan menggunakan lynx
#lynx 192.168.1.14
Maka akan tampil ucapan selamat datang dari Apache
Kita coba dengan menggunakan script PHP
Simpan file PHP di Document root webserver yaitu /var/www
#vi /var/www/index.php
Masukkan script PHP (Dibawah ini untuk memperlihatkan phpinfo):
phpinfo();
?>
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
Restart Apache anda:
#/etc/init.d/apache restart
Browse dengan lynx:
#lynx 192.168.1.14/index.php
Jika muncul informasi tentang PHP berarti PHP sudah jalan.
3)Konfigurasi MySQL Database server.
Jalankan Mysql anda
#/etc/init.d/mysql restart
Lalu anda masuk ke mysql
#mysql –u root –p (enter)
Saat menanyakan password enter lagi.
Maka akan muncul
mysql>
Jika akan keluar dari mysql
mysql>quit (enter)
Konfigurasi Apache,PHP,Mysql telah selesai.
Labels:
linux
Konfigurasi FTP Server pada Debian woody
1)Pengertian
FTP (File Transfer Protocol) server berfungsi untuk mentransfer file dari client ke server ataupun sebaliknya.
Software yang digunakan adalah proftpd.
2)Konfigurasi Server
2.1) Buka file /etc/proftpd.conf:
#vi /etc/proftpd.conf
Lalu rubah konfigurasi file ini menjadi seperti dibawah ini, gunakan tombol [insert] untuk mulai mengedit:
#
# /etc/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayFirstChdir .message
ListOptions "-l"
DenyFilter \*.*/
# Uncomment this if you are using NIS or LDAP to retrieve passwords:
#PersistentPasswd off
# Uncomment this if you would use TLS module:
#TLSEngine on
# Uncomment this if you would use quota module:
#Quotas on
# Uncomment this if you would use ratio module:
#Ratios on
# Port 21 is the standard FTP port.
Port 21
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
# Set the user and group that the server normally runs at.
User nobody
Group nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
#DelayEngine off
# A basic anonymous configuration, no upload directories.
User ftp
Group nogroup
# # We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
DirFakeUser on ftp
DirFakeGroup on ftp
#
RequireValidShell off
#
# # Limit the maximum number of anonymous logins
MaxClients 10
#
# # We want 'welcome.msg' displayed at login, and '.message' displayed
# # in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
DenyAll
#
# # Uncomment this if you're brave.
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
Umask 022 022
DenyAll
AllowAll
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
2.2) Restart ftp server anda:
#/etc/init.d/proftpd restart
2.2) Coba dari computer yang terhubung dengan klien dan jalankan:
Jika klien anda windows buka:
Start->run->ketikan “cmd”
Setelah terbuka command prompt ketikan ftp [alamat ip address komputer server anda]:
Contoh: ftp 192.168.1.1
2.3) Setelah itu jika computer menanyakan username coba masukkan”anonymous (enter)” lalu enter 2 kali tanpa memasukkan password.
2.5)Apabila ada tulisan “Anonymous login OK” berarti setting FTP untuk user anonymous telah berhasil.
2.5)Setelah anda masuk ke FTP server ketikan bye (enter).
2.6)Setelah tampil C:\ lagi, ketikan ftp [alamat ip server] seperti diatas, lalu saat menanyakan username masukkan nama user yang ada di server anda. Contohnya username admin(enter) dan password admin (enter), lalu jika ada tulisan “User admin logged in” maka FTP untuk user terauthentikasi telah berhasil
Setelah semua itu berjalan dan telah tertesting dengan baik berarti FTP server telah berjalan di system anda.
FTP (File Transfer Protocol) server berfungsi untuk mentransfer file dari client ke server ataupun sebaliknya.
Software yang digunakan adalah proftpd.
2)Konfigurasi Server
2.1) Buka file /etc/proftpd.conf:
#vi /etc/proftpd.conf
Lalu rubah konfigurasi file ini menjadi seperti dibawah ini, gunakan tombol [insert] untuk mulai mengedit:
#
# /etc/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#
ServerName "Debian"
ServerType standalone
DeferWelcome off
MultilineRFC2228 on
DefaultServer on
ShowSymlinks on
TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200
DisplayLogin welcome.msg
DisplayFirstChdir .message
ListOptions "-l"
DenyFilter \*.*/
# Uncomment this if you are using NIS or LDAP to retrieve passwords:
#PersistentPasswd off
# Uncomment this if you would use TLS module:
#TLSEngine on
# Uncomment this if you would use quota module:
#Quotas on
# Uncomment this if you would use ratio module:
#Ratios on
# Port 21 is the standard FTP port.
Port 21
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
# Set the user and group that the server normally runs at.
User nobody
Group nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
#DelayEngine off
# A basic anonymous configuration, no upload directories.
User ftp
Group nogroup
# # We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
DirFakeUser on ftp
DirFakeGroup on ftp
#
RequireValidShell off
#
# # Limit the maximum number of anonymous logins
MaxClients 10
#
# # We want 'welcome.msg' displayed at login, and '.message' displayed
# # in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
DenyAll
#
# # Uncomment this if you're brave.
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
Umask 022 022
DenyAll
AllowAll
Keluar dan save dari editor vi dengan [Esc] lalu :wq.
2.2) Restart ftp server anda:
#/etc/init.d/proftpd restart
2.2) Coba dari computer yang terhubung dengan klien dan jalankan:
Jika klien anda windows buka:
Start->run->ketikan “cmd”
Setelah terbuka command prompt ketikan ftp [alamat ip address komputer server anda]:
Contoh: ftp 192.168.1.1
2.3) Setelah itu jika computer menanyakan username coba masukkan”anonymous (enter)” lalu enter 2 kali tanpa memasukkan password.
2.5)Apabila ada tulisan “Anonymous login OK” berarti setting FTP untuk user anonymous telah berhasil.
2.5)Setelah anda masuk ke FTP server ketikan bye (enter).
2.6)Setelah tampil C:\ lagi, ketikan ftp [alamat ip server] seperti diatas, lalu saat menanyakan username masukkan nama user yang ada di server anda. Contohnya username admin(enter) dan password admin (enter), lalu jika ada tulisan “User admin logged in” maka FTP untuk user terauthentikasi telah berhasil
Setelah semua itu berjalan dan telah tertesting dengan baik berarti FTP server telah berjalan di system anda.
Labels:
linux
iptables di debian woody
debian woody bisa jadi server internet , gunakan aja iptables untuk ngedirect agar client juga bisa ikut terkoneksi ke internet. ketik perintah # iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128 ato buat per IP dengan perintah # iptables -t nat -A PREROUTING -s 192.168.1.xx -p tcp --dport 80 -j REDITECT --to-port 3128
Labels:
linux
Langganan:
Postingan (Atom)