Minggu, 05 Juni 2011

SETTING DEBIAN 4

Web Server
Apt-get install apache2 php5 lynx mc
mcedit  /etc/apache2/sites-available/default
Cari RedirectMatch
Kemudian beri tanda # didepannya
mcedit  /var/www/index.html
Buat file html anda
<html>
<head>
<title>::tkj::</title>
</head>
<body>
<center><h1>welcome</h1></center>
</body>
</html>
mcedit  /var/www/phpinfo.php
Buat file php anda
<?php
Php info();
?>
mcedit  /etc/apache2/sites-enabled/domain
Buat file berikut :
<VirtualHost  *>
ServerAdmin host@tkj.com
DocumentRoot  /var/www
ServerName tkj.com
</VirtualHost>
/etc/init.d/apache2 restart

DHCP
Apt-get install dhcp3-server
mcedit /etc/dhcp3/dhcpd.conf
Cari tulisan A slightly
# A slightly different configuration for an internal subnet.
subnet 192.168.1.0 netmask 255.255.255. 0 {
range 192.168.1.50 192.168.1.75;
option domain-name-servers 192.168.1.1;
option domain-name “server.net”;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
Kemudian hilangkan tanda pagar yang ada dibawahnya sampai tanda {
Isi setingan yang ada didalamnya sesuai dengan kebutuhan operator anda
/etc/init.d/dhcpd3 restart

Bind
Apt-get install bind9
mcedit /etc/bind/named.conf
Kemudian buat file berikut yang berisi file forward, reverse dan yang akan diblok
zone “tkj.com” {
type master;
file “/var/cache/bind/forward”;
};
zone “1.168.192.in-addr.arpa” {
type master;
file “/var/cache/bind/reverse”;
};
zone “facebook.com” {
type master;
file “/var/cache/bind/facebook”;
};
cp /etc/bind/db.local /var/cache/bind/forward
cp /etc/bind/db.127 /var/cache/bind/reverse
mcedit /var/cache/bind/forward
isikan localhost yang ada diatas dengan cara
host.domain.root.domain
isi bagian dibawah
@            IN    NS    host.domain
@            IN    A    ip
Host        IN    A    ip
www        IN    CNAME    host.domain
mail         IN    CNAME    host.domain
ftp           IN    CNAME    host.domain
sharing    IN    CNAME    host.domain
remote    IN    CNAME    host.domain
mcedit /var/cache/bind/reverse
isikan localhost yang ada diatas dengan cara
host.domain.root.domain
isi bagian bawah
@    IN    NS    host.domain
1    IN    PTR    host.domain
1    IN    PTR    www.domain
1    IN    PTR    mail.domain
1    IN    PTR    sharing.domain
1    IN    PTR    ftp.domain
1    IN    PTR    remote.domain
cp /var/cache/bind/forward /var/cache/bind/facebook
mcedit /var/cache/bind/facebook
edit file tersebut dengan mengganti nama domain yang diblok dan hapus yang tidak perlu
@        IN    NS    facebook.com
@        IN    A    ip
Host    IN    A    ip
www    IN    CNAME    facebook.com
/etc/init.d/bind9 restart

Squid
Apt-get install squid
Mcedit /etc/squid/squid.conf
Kemudian cari http 3128 dan tambahkan tulisan transparent dibelakangnya
Cari tulisan acl Connect Method Connect
Tambahkan
Acl lan src 192.168.1.0/24
Acl larang url_regex –i “/etc/larang”
http_access deny larang
http_access allow lan
http_access allow all
Mcedit /etc/larang
Ketikkan situs yang akan diblok
facebook
Iptables –t nat –A POSTROUTING –s 192.168.1.0/24 –j MASQUERADE
Iptables –t nat –A PREROUTING –s 192.168.1.0/24 –p tcp –dport 80 –j REDIRECT  –to-port 3128
Iptables-save >/etc/myiptables
Echo 1 > /proc/sys/net/ipv4/ip_forward
Mcedit /etc/init.d/rc.local
Cari tulisan path
Dan tambahkan file ini dibawahnya
Iptables-restore <-/etc/myiptables
Echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/squid restart

Mail
Apt-get remove exim4*
Apt-get install postfix courier-imap courier-pop courier-authdaemon squirrelmail
Mcedit /etc/postfix/main.cf
myhostname = mail.domain
mydestination = $mydomain, localhost
Cari tulisan mynetworks dan tambahkan dibelakangnya ip kita 192.168.1.0/24
Kemudian pas dibawahnya berikan tanda # pada script yang dibawahnya tersebut
Dibaris paling bawah tambahkan
home_mailbox= Maildir/
7. cd /etc/skel
Maildirmake Maildir
Adduser tkj
Masukkan password
Kemudian masuk ke mcedit /etc/apache2/sites-enabled/domain
Tambahkan virtualhost
<VirtualHost *>
ServerAdmin host@domain
DocumentRoot /usr/share/squirrelmail
ServerName mail.domain
</VirtualHost>
12. mcedit /etc/apache2/apache2.conf
cari serverroot
tambahkan scrip ini  dibawahnya
Include /etc/squirrelmail/apache.conf
13. mcedit /etc/squirrelmail/apache.conf
ganti scrip
alias /squeirrelmail /usr/shared/squireelmai
menjadi    alias /mail /usr/shared/squireelmail
14. squirrelmail-configure
pilih no 2 ganti menjadi nama domain anda (tkj.com)
15.  /etc/init.d/postfix restart
16. /etc/init.d/courier-imap restart
17. /etc/init.d/courier-pop restart
18. /etc/init.d/courier-authdaemon restart
Remote
Apt-get install ssh
Kemudian secara default anda bisa meremote server
ftp
Pastikan server dalam keadaan baik
Install paket ftp
#apt-get install vsftpd
3. Mengkonfigurasi FTP Server
#vim /etc/vsftpd.conf       # mcedit /etc/vsftpd.conf
#
anonymous_enable=NO (mendisable user anonymous)
#Uncomment this to enable any form of FTP write command.
local_enable=YES (mengaktifkan user lokal_
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd’s)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages – messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using “root” for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
4. Menjalankan vsftpd
#/etc/init.d/vsftpd restart
5. Menguji server ftp
#telnet localhost 21
kelau pesan yang muncul conected to localhost —> server sudah jalan
Kalau pesan conection refused ——> server tidak jalan
6. Mencoba upload/download file
#ftp localhost atau #ftp nomor_ip komputer
masukkan user
masukkan password
untuk upload —>put atau mput
untuk download —>get atau mget
untuk pindah direktori —-> cd
untuk melihat isi direktor —>ls
Kalau di windows pakai filezilla atau wsftp
Letak file
login user system maka letak file di /home/user
login anonymous maka letak file di /home/ftp

download setting debian 4 

Tidak ada komentar:

Posting Komentar