Selasa, 08 Januari 2013

Konfigurasi Web Server Debian

Download alamat Repository debian
KONFIGURASI WEBSERVER DEBIAN LENNY  5

Informasi
Kata yang bertuliskan HITAM tebal adalah command /perintah
Kata yang bertuliskan MERAH   adalah kata yang harus dibuat /di edit
Setting ip address
Command :~#nano /etc/network/interfaces
allow-hotplug eth0
 iface eth0 inet static
address  192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1








Restart Network
Command :~#/etc/init.d/networking restart

Edit host
Command :~#nano /etc/hosts
127.0.0.1         localhost
127.0.0.1         azoema.net     tkj
Ubah menjadi seperti di bawah ini
127.0.0.1         localhost
192.168.1.2     azoema.net     tkj

Install Mysql Server ,Mysql Client, Bind9, Apache2, Php5 dan PhpMyadmin
Command :~#apt-get install mysql-server mysql-client apache2 bind9 php5 phpmyadmin
Please enter your password :*******
Retype your password: *******

Setting bind9
Copy file terlebih dahulu
Command :~#cp /etc/bind/db.127  /etc/bind/db.192
Command :~#cp /etc/bind/db.local  /etc/bind/db.azoema

Edit file db.192
Command:~#nano /etc/bind/db.192

;
;BIND   reverse data file for local loopback interface
;
$TTL                604800
@         IN         SOA     localhost. root.localhost.  (
                                                            1          ; Serial
604800            ; Refresh
86400              ; Retry
2419200          ; Expire
604800 )          ; Negative Cache

;
@         IN         NS        localhost.
1.0.0    IN         PTR      localhost.


Ubah seperti di bawah ini :
;
;BIND            reverse data file for local loopback interface
;
$TTL              604800
@      IN         SOA     azoema.net. root.azoema.net.  (
                                                         1          ; Serial
604800         ; Refresh
86400           ; Retry
2419200       ; Expire
604800 )       ; Negative Cache

;
@      IN         NS        azoema.net.
2.1.168         IN         PTR      azoema.net.
2.1.168         IN         PTR      www.azoema.net.
2.1.168         IN         PTR      webmail.azoema.net.
2.1.168         IN         PTR      ftp.azoema.net.



edit file db.azoema
Command:~#nano /etc/bind/db.azoema
;
;BIND             reverse data file for local loopback interface
;
$TTL              604800
@       IN         SOA     localhost. root.localhost.  (
                                                          1          ; Serial
604800          ; Refresh
86400            ; Retry
2419200        ; Expire
604800 )        ; Negative Cache

;
@       IN         NS        localhost.
@       IN         A          127.0.0.1
@       IN         AAA     ::1

Ubah seperti di bawah ini :
;
;BIND             reverse data file for local loopback interface
;
$TTL               604800
@       IN         SOA     azoema.net. root.azoema.net.  (
                                                           1          ; Serial
604800           ; Refresh
86400             ; Retry
2419200         ; Expire
604800 )         ; Negative Cache

;
@       IN         NS        azoema.net.
@       IN         A          192.168.1.2
@       IN         A          www.192.168.1.2
@       IN         A          webmail.192.168.1.2
@       IN         A          ftp.192.168.1.2


Edit file named.conf di dalam bind9
Command:~#nano /etc/bind/named.conf
Cari script berikut:
Zone “localhost” {
type master;
file “/etc/bind/db.local”;
};
Zone “127.in-addr.arpa” {
type master;
file “/etc/bind/db.127”;
};
Ubah menjadi :
Zone “azoema.net” {
type master;
file “/etc/bind/db.azoema.net”;
};
Zone “192.in-addr.arpa” {
type master;
file “/etc/bind/db.192”;
};

Restart Bind9
Command:~#/etc/init.d/bind9 restart
Coba buka melalui browser
Jika mau mengubah index.html masuk  ke folder var/www
Command:~#cd /var/www
Untuk melihat isi dari folder www ketikan ls
Command:~#ls
Index.html
Lalu edit file index.html tersebut
Command:~#nano index.html
<html><body><h1>It’s Work’s !</h1></body>
</html>


Install ftp
Command:~#apt-get install proftpd
Buat folder untuk FTP
Command:~#mkdir –p /ftpserver
Ubah akses foldernya
Command:~#chmod 775 –R /ftpserver
Buat user untuk ftp
Command:~#useradd –d /ftpserver ftp
 Buatlah file di dalam directory ftpserver Contoh:
 Command:~#nano /ftpserver/test.txt


Install Squirrelmail /webmail
Command:~#apt-get install postfix squirrelmail courier-imap courier-pop
Create directories for web-based administration        : NO
Local only                                                                   : OK
General type of mail configuration                              : Internet Site
System mail name                                                       : azoema.net

Konfigurasi squirrelmail

Command:~#nano /etc/apache2/apache2.conf
                  
            # Include the virtual host configurations:
                  Include /etc/apache2/sites-enabled/
                  Include /etc/squirrelmail/apache.conf





Command:~#nano /etc/squirrelmail/apache.conf

# users will prefer a simple URL like http://webmail.example.com
#<virtualhost 1.2.3.4>
# DocumentRoot /usr/share/squirrelmail
# ServerName webmail.example.com
#</virtualhost>
Ubah seperti di bawah ini :
<virtualhost *:80>
DocumentRoot /usr/share/squirrelmail
ServerName    webmail.azoema.net
</virtualhost>


Restart apache
Command:~#/etc/init.d/apache2 restart

Buka di browser http://webmail.azoema.net


Buat folder untuk webmail
Command:~#Maildirmake /etc/skel/Maildir
Buatlah user baru
Command:~#adduser indra
Command:~#adduser joko
Command:~#dpkg-reconfigure postfix
Local only                                                                       : OK
General type of mail configuration                                     : Internet Site
System mail name                                                            : azoema.net
Root and postmaster mail recipient                                   : (kosongkan)
Other destinations to accept mail for (blank for none)        : 192.168.1.2/24 (<tambahan baris terakhir )
Force synchronous updates on mail queue                        : No
Local networks                                                                : 192.168.1.2/24
Use procmail for local delivery                                         : NO
Mailbox size limit (bytes)                                                 : 0
Local address extension character                                    : +
Internet protocols to use                                                  : ipv4
Command:~#nano /etc/postfix/main.cf

inet_interfaces = all
inet_protocols = ipv4
home_mailbox = Maildir/

Edit config.php di squirrelmail

Command:~#nano /etc/squirrelmail/config.php
cari script
$useSendmail = false;
ubah menjadi :
$usesendmail = true ;


* Jangan ubah / hapus baris lainnya.

Command:~#/etc/init.d/postfix  restart
Stopping Postfix Mail Transport Agent : postfix.
Starting Postfix Mail Transport Agent   : postfix.

Command:~#/etc/init.d/courier-imap  restart
Stopping Courier IMAP server : imapd.
Starting Courier IMAP server   : imapd.

Command:~# /etc/init.d/courier-pop  restart
Stopping Courier POP3 server : pop3d.
Starting Courier POP3 server   : pop3d.

Buka Browser PC client anda. Masukkan url "http://webmail.azoema.net" Setelah itu silahkan email2an Jika berhasil maka konfigurasi WebMailserver anda sukses.