modul instalasi server ubuntu 10.04

34
MODUL INSTALASI SERVER UBUNTU 10.04 LTS [ISPCONFIG2]

Upload: satriaji-idam

Post on 25-Jun-2015

2.488 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Modul Instalasi Server Ubuntu 10.04

MODUL INSTALASI SERVER UBUNTU 10.04 LTS [ISPCONFIG2]

UII SYNAPTIC

OPEN SOURCE STUDY AND RESEARCH CENTER

Page 2: Modul Instalasi Server Ubuntu 10.04

Modul ini akan memandu kita untuk membangun perfect server dengan menggunakan Linux Ubuntu 10.04 LTS server edition mulai dari awal hingga akhir secara bertahap melalui langkah-langkah tutorial yang mudah untuk diikuti. Dikatakan perfect server karena sistem yang akan dibangun nanti akan mampu menyediakan semua service yang dibutuhkan oleh suatu ISP dan hoster, seperti: Apache Web Server (SSL-capable), Postfix mail server dengan SMTP-AUTH dan TLS, BIND DNS server, Proftpd FTP server, MySQL server, Courier POP3/IMAP, Quota, Firewall, dan lain-lain. Hasil dari tutorial ini adalah sebuah system yang dapat bekerja dengan lancar, dan apabila diinginkan dapat pula dinstalasikan webhosting control panel yaitu ISPConfig 2.

Daftar software/paket yang akan digunakan adalah:

Web Server: Apache 2.2.14 dengan PHP 5.3.2, Python, Ruby, dan WebDAV Database Server: MySQL 5.1.41 Mail Server: Postfix DNS Server: BIND9 FTP Server: proftpd POP3/IMAP: disini akan digunakan format Maidir dan kemudian akan diinstal

Courier-POP3/Courier-IMAP. Webalizer untuk monitoring statistic website

Versi dari software-software diatas tidaklah mutlak, dapat menggunakan versi yang lebih baru, tetapi tidak dianjurkan untuk menggunakan versi yang lebih rendah. Kecuali untuk bagian ISPConfig-nya, tutorial pada modul ini hanya bisa menggunakan ISPConfig versi 2 saja dan tidak kompatibel dengan ISPConfig versi 3.

1. Persiapan Tools

Untuk menginstal sistem ini kita akan membutuhkan:

CD/DVD Ubuntu 10.04 server edition (x86 maupun x86_64) Koneksi internet (sangat disarankan menggunakan koneksi berkecepatan tinggi) Komputer yang akan digunakna sebagai server (sesuaikan dengan spesifikasi yang

telah disebutkan sebelumnya).

2. Instalasi Dasar Sistem

Pada tutorial ini hostname yang digunakan adalah server1.example.com dan alamat IP 192.168.0.100 dan gateway 192.168.0.1. Settingan ini bisa diganti sesuai dengan keinginan masing-masing.

Masukkan dan boot dari cd instalasi Ubuntu. Pilih bahasa:

Page 3: Modul Instalasi Server Ubuntu 10.04

Kemudian pilih Install Ubuntu Server:

Pilih bahasa instalasi:

Page 4: Modul Instalasi Server Ubuntu 10.04

Pilih lokasi:

Pilih layout keyboard (ketikkan beberapa tombol dan installer akan secara otomatis mendetek layout keyboard yang digunakan):

Page 5: Modul Instalasi Server Ubuntu 10.04

Installer akan mengecek CD instalasi, hardware, dan konfigurasi jaringan dengan DHCP apabila terdapat DHCP server pada jaringan:

Page 6: Modul Instalasi Server Ubuntu 10.04

Masukkan hostname yang diinginkan. Pada tutorial ini yang digunakan adalah server1.example.com, jadi yang diinputkan adalah server1:

Installer akan mendeteksi time zone secara otomatis. Pilih yes untuk memilih opsi default atau no untuk mengatur time zone sendiri:

Page 7: Modul Instalasi Server Ubuntu 10.04

Sekarang kita harus mempartisi harddisk. Untuk lebih mudahnya pilih Guided – use entire disk and set up LVM – pilihan ini akan membuat satu volume group dengan dua volume logical, satu untuk / (root) filesystem dan satu lagi untuk swap. Partisi juga bisa diatur sendiri sesuai keinginan dengan memilih opsi Manual.

Pilih disk yang ingin dipartisi:

Page 8: Modul Instalasi Server Ubuntu 10.04

Ketika ditanyakan Write the changes to disks and configure LVM? pilih yes:

Jika memilih Guided – use entire disk and set up LVM, partioner akan membuat satu volume group berukuran besar yang memakan seluruh space harddisk. Kita bisa menspesifikasikan seberapa banyak space harddisk yang harus digunakan oleh volume logical untuk / (root) dan swap.

Page 9: Modul Instalasi Server Ubuntu 10.04

Setelah selesai, ketika ditanyakan Write the changes to disks? Pilih yes:

Setelah itu, partisi akan mulai diformat dan dibuat:

Page 10: Modul Instalasi Server Ubuntu 10.04

Sekarang sistem akan mulai diinstal:

Buat account user, sebagai contoh Administrator dengan username administrator (jangan menggunakan username admin karena merupakan reserved word pada Ubuntu 10.04):

Page 11: Modul Instalasi Server Ubuntu 10.04
Page 12: Modul Instalasi Server Ubuntu 10.04

Jika butuh enkripsi untuk private directory pilih yes jika tidak pilih no:

Selanjutnya kita akan mengkonfigurasi apt package manager. Biarkan bagian HTTP proxy kosong kecuali memang ingin menggunakan proxy server untuk konek ke internet:

Page 13: Modul Instalasi Server Ubuntu 10.04

Pilih konfigurasi update untuk sistem. Jika ingin menggunakan update otomatis pilih Install security updates automatically dan jika ingin menagtur update secara manual pilih No automatic updates. Pada tutorial ini yang akan kita gunakan adalah update secara manual sehingga yang dipilih adalah No automatic updates:

Page 14: Modul Instalasi Server Ubuntu 10.04

Kita membutuhkan DNS, mail, dan LAMP server, tetapi kita tidak akan memilihnya sekarang. Kita akan menginstal paket-paket yang diperlukan satu-persatu nanti. Satu-satunya paket yang akan kita install sekarang adalah OpenSSH server agar kita dapat langsung melakukan koneksi ke sistem dengan SSH client seperti Putty setelah proses instalasi selesai:

Page 15: Modul Instalasi Server Ubuntu 10.04

Instalasi boot loader GRUB:

Pilih yes ketika ditanyakan Install the GRUB boot loader to the master boot record?:

Page 16: Modul Instalasi Server Ubuntu 10.04

Instalasi bagian dasar sistem sekarang telah selesai. Keluarkan CD instalasi dari CD drive dan pilih Continue untuk mereboot sistem:

Page 17: Modul Instalasi Server Ubuntu 10.04

3. Setting Hak Akses RootSetelah reboot login dengan username yang telah dibuat sebelumnya (dalam tutorial ini administrator). Karena langkah-langkah selanjutnya akan kita jalankan dengan hak akses root. Kita bisa menjalankan semua perintah dengan perintah sudo atau dengan langsung masuk sebagai root dengan perintah:$ sudo su

Kita juga bisa mengaktifkan login root dengan menjalankan perintha:$ sudo passwd root

Dan memberikan password root. Kita bisa langsung login sebagai root, tetapi ini sangat tidak dianjurkan oleh para pengembang Ubuntu maupun komunitas karena alas an security.

4. Instalasi SSH Server (Optional)Jika pada saat instalasi system tadi tidak menginstal OpenSSH server, kita bisa menginstalnya sekarang:# aptitude install ssh openssh-server

Sekarang kita bisa menggunakan SSH client seperti PuTTY dan konek secara remote dari workstation kita ke server Ubuntu 10.04.

5. Konfigurasi JaringanKarena installer Ubuntu telah melakukankonfigurasi jaringan sistem kita melalui DHCP, kita harus merubahnya karena suatu server harus memiliki alamat IP static. Edit /etc/network/interfaces dan konfigurasi sesuai kebutuhan (pada tutorial ini alamat IP yang digunakan adalah 192.168.0.100):# nano /etc/network/interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceauto eth0iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1

Kemudian restart network:# /etc/init.d/networking restart

Edit file /etc/hosts menggunakan editor:# nano /etc/hosts127.0.0.1 localhost.localdomain localhost192.168.0.100 server1.example.com server1

Page 18: Modul Instalasi Server Ubuntu 10.04

# The following lines are desirable for IPv6 capable hosts::1 localhost ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters

Sekarang jalankan:# echo server1.example.com > /etc/hostname# /etc/init,d/hostname restart

Kemudian jalankan:# hostname# hostname –f

Keduanya akan menunjukkan server1.example.com sekarang:

6. Konfigurasi Package SourcesEdit /etc/apt/sources.list. Uncomment atau hapus CD instalasi dari file dan pastikan repository universe dan multiverse diaktifkan. Seperti ini:# nano /etc/apt/sources.list# deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ - Release amd64 (20100427)]/ lucid main restricted

#deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ - Release amd64 (20100427)]/ lucid main restricted# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.

deb http://de.archive.ubuntu.com/ubuntu/ lucid main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the## distribution.deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb http://de.archive.ubuntu.com/ubuntu/ lucid universedeb-src http://de.archive.ubuntu.com/ubuntu/ lucid universedeb http://de.archive.ubuntu.com/ubuntu/ lucid-updates universedeb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in

Page 19: Modul Instalasi Server Ubuntu 10.04

## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://de.archive.ubuntu.com/ubuntu/ lucid multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ lucid multiversedeb http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse

## Uncomment the following two lines to add software from the 'backports'## repository.## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://de.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse# deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's## 'partner' repository.## This software is not part of Ubuntu, but is offered by Canonical and the## respective vendors as a service to Ubuntu users.# deb http://archive.canonical.com/ubuntu lucid partner# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://security.ubuntu.com/ubuntu lucid-security main restricteddeb-src http://security.ubuntu.com/ubuntu lucid-security main restricteddeb http://security.ubuntu.com/ubuntu lucid-security universedeb-src http://security.ubuntu.com/ubuntu lucid-security universedeb http://security.ubuntu.com/ubuntu lucid-security multiversedeb-src http://security.ubuntu.com/ubuntu lucid-security multiverse

Kemudian update apt package database dengan menjalankan:# aptitude update

Update sistem kita:# aptitude safe-upgrade

Apabila kernel ikut terupdate, reboot sistem:# reboot

7. Konfigurasi Shell defaultUntuk menginstal ISPConfig kita perlu mengubah settingan default shell pada sistem dari /bin/dash menjadi /bin/bash jalankan perintah:# dpkg-reconfigure dash

Ketika ditanyakan Install dash as /bin/sh? pilih no.

Page 20: Modul Instalasi Server Ubuntu 10.04

8. Konfigurasi AppArmorAppArmor merupakan security extension yang menyediakan extended security. Kita tidak akan membutuhkan AppArmor untuk membangun sebuah sistem yang aman, karena biasanya AppArmor justru akan lebih sering menyebabkan masalah daripada manfaat. AppArmor akan memblokir service-service dari aplikasi tertentu yang dapat menyebabkan sistem tidak dapat berjalan dengan lancar (terutama pada ISPConfig). Oleh sebab itu, AppArmor harus dinonaktifkan:# /etc/init.d/apparmor stop# update-rc.d -f apparmor remove# aptitude remove apparmor apparmor-utils

9. Instalasi Paket PendukungInstal beberapa paket pendukung yang dibutuhkan untuk membangun sistem ini dengan menjalankan perintah:# aptitude install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.6-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ build-essential

Perintah diatas harus diketikkan dalam satu baris.

10.Konfigurasi Journaled QuotaUntuk mengistal quota jalankan:# aptitude install quota

Kemudian edit /etc/fstab dan tambahkan ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 kedalam partisi dengan mount point / (root):# nano /etc/fstab# /etc/fstab: static file system information.## Use 'blkid -o value -s UUID' to print the universally unique identifier# for a device; this may be used with UUID= as a more robust way to name# devices that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass>proc /proc proc nodev,noexec,nosuid 0 0/dev/mapper/server1-root / ext4 errors=remount-ro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 1# /boot was on /dev/sda1 during installationUUID=9eef7b6b-5688-456c-8fe2-05ae739e3635 /boot ext2 defaults 0 2/dev/mapper/server1-swap_1 none swap sw 0 0/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

Sesuaikan konfigurasi diatas dengan skema partisi masing-masing, pastikan untuk meletakkan ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 satu baris dengan partisi root.

Page 21: Modul Instalasi Server Ubuntu 10.04

Jika sudah selesai melakukan editing, maka quota dapat kita nyalakan dengan menjalankan perintah:# touch /aquota.user /aquota.group# chmod 600 /aquota.*# mount -o remount /

Kemudian:# quotacheck -avugm# quotaon –avug

11.Konfigurasi DNS ServerInstall BIND9 dengan perintah:# aptitude install bind9

Untuk alasan keamanan BIND akan dijalankan dengan chrooted. Jalankan perintah ini:# /etc/init.d/bind9 stop

Edit file /etc/default/bind9 sehingga proses daemon dari BIND akan berjalan sebagai user bind, chrooted ke /var/lib/named. Modifikasi baris: OPTIONS=”-u bind” menjadi OPTIONS=”-u bind –t /var/lib/named”:# nano /etc/default/bind9# run resolvconf?RESOLVCONF=yes

# startup options for the serverOPTIONS="-u bind -t /var/lib/named"

Buat direktori yang bersangkutan didalam /var/lib:# mkdir -p /var/lib/named/etc# mkdir /var/lib/named/dev# mkdir -p /var/lib/named/var/cache/bind# mkdir -p /var/lib/named/var/run/bind/run

Pindahkan file config dari /etc ke /var/lib/named/etc:# mv /etc/bind /var/lib/named/etc

Buat link ke direktori config yang baru dari lokasi yang lama:# ln –s /var/lib/named/etc/bind /etc/bind

Buat null dan random devices, dan ganti kepemilikan direktori:# mknod /var/lib/named/dev/null c 1 3# mknod /var/lib/named/dev/random c 1 8# chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random# chown -R bind:bind /var/lib/named/var/*# chown -R bind:bind /var/lib/named/etc/bind

Buat file /etc/rsyslog.d/bind-chroot.conf :# nano /etc/rsyslog.d/bind-chroot.conf

Dan tambahkan baris berikut ini untuk mendapatkan pesan penting pada saat system logs:$AddUnixListenSocket /var/lib/named/dev/log

Restart logging daemon:# /etc/init.d/rsyslog restart

Start up BIND, dan cek /var/log/syslog untuk error:# /etc/init.d/bind9 start

12.Konfigurasi MySQL

Page 22: Modul Instalasi Server Ubuntu 10.04

Instal MySQL dengan perintah:# aptitude install mysql-server mysql-client libmysqlclient16-dev

Ketika ditanyakan untuk password root isikan:New password for the MySQL “root” user: <- passwordRepeat password for the MySQL “root” user: <- password

Password yang diisikan ini akan digunakan untuk user root@localhost dan juga [email protected].

Ubah konfigurasi MySQL pada /etc/mysql/my.cnf agar dapat melakukan listening ke semua interface dan bukan hanya localhost. Berikan tanda comment pada baris bind-address = 127.0.0.1:# nano /etc/mysql/my.cnf[...]## Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.#bind-address = 127.0.0.1[...]

Kemudian restart MySQL:# /etc/init.d/mysql restart

Sekarang cek apakah networking telah bekerja. Jalankan perintah:# netstat –tap | grep mysql

Output yang keluar akan terlihat seperti ini:root@server1:~# netstat -tap | grep mysqltcp 0 0 *:mysql *:* LISTEN 6525/mysqldroot@server1:~#

13.Konfigurasi Postfix dengan SMTP-AUTH dan TLSJalankan perintah berikut untuk menginstal Postfix dengan SMTP-AUTH dan TLS:# aptitude install postfix libsasl2-2 sasl2-bin libsasl2-modules procmail

Jawab dua pertanyaan yang keluar seperti berikut:General type of mail configuration: <-- Internet SiteSystem mail name: <-- server1.example.com

Kemudian jalankan:# dpkg-reconfigure postfix

Maka akan ditanyakan beberapa pertanyaan lagi. Jawab seperti berikut:General type of mail configuration: <-- Internet SiteSystem mail name: <-- server1.example.comRoot and postmaster mail recipient: <-- [blank]Other destinations to accept mail for (blank for none): <-- server1.example.com, localhost.example.com, localhost.localdomain, localhostForce synchronous updates on mail queue? <-- NoLocal networks: <-- 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128Use procmail for local delivery? <-- YesMailbox size limit (bytes): <-- 0Local address extension character: <-- +Internet protocols to use: <-- all

Kemudian jalankan:

Page 23: Modul Instalasi Server Ubuntu 10.04

# postconf -e 'smtpd_sasl_local_domain ='# postconf -e 'smtpd_sasl_auth_enable = yes'# postconf -e 'smtpd_sasl_security_options = noanonymous'# postconf -e 'broken_sasl_auth_clients = yes'# postconf -e 'smtpd_sasl_authenticated_header = yes'# postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'# postconf -e 'inet_interfaces = all'# echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf# echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf

Selanjutnya buat sertifikat untuk TLS:# mkdir /etc/postfix/ssl# cd /etc/postfix/ssl/# openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024# chmod 600 smtpd.key# openssl req -new -key smtpd.key -out smtpd.csr# openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt# openssl rsa -in smtpd.key -out smtpd.key.unencrypted# mv -f smtpd.key.unencrypted smtpd.key# openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

Kemudian lakukan konfigurasi Postfix untuk TLS (pastikan untuk menggunakan hostname yang benar untuk myhostname):# postconf -e 'myhostname = server1.example.com'# postconf -e 'smtpd_tls_auth_only = no'# postconf -e 'smtp_use_tls = yes'# postconf -e 'smtpd_use_tls = yes'# postconf -e 'smtp_tls_note_starttls_offer = yes'# postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'# postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'# postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'# postconf -e 'smtpd_tls_loglevel = 1'# postconf -e 'smtpd_tls_received_header = yes'# postconf -e 'smtpd_tls_session_cache_timeout = 3600s'# postconf -e 'tls_random_source = dev:/dev/urandom'

File yang berada di /etc/postfix/main.cf akan terlihat seperti ini:# cat /etc/postfix/main.cf# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first# line of that file to be used as the name. The Debian default# is /etc/mailname.#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)biff = no

# appending .domain is the MUA's job.append_dot_mydomain = no

Page 24: Modul Instalasi Server Ubuntu 10.04

Autentikasi akan dilakukan oleh saslauthd. Maka perlu dilakukan beberapa perubahan untuk membuatnya mampu bekerja dengan baik. Karena Postfix berjalan chrooted di /var/spool/postfix lakukan:# mkdir -p /var/spool/postfix/var/run/saslauthd

Sekarang edit /etc/default/saslauthd untuk mengaktifkan saslauthd. Set START to yes dan ubah baris OPTIONS=”-c –m /var/run/saslauthd” menjadi OPTIONS=”-c –m /var/spool/postfix/var/run/saslauthd –r”:# nano /etc/default/saslauthd# Additional options for this mechanism. (default: none)# See the saslauthd man page for information about mech-specific options.MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)# A value of 0 will fork a new process for each connection.THREADS=5

# Other options (default: -c -m /var/run/saslauthd)# Note: You MUST specify the -m option or saslauthd won't run!## WARNING: DO NOT SPECIFY THE -d OPTION.# The -d option will cause saslauthd to run in the foreground instead of as# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish# to run saslauthd in debug mode, please run it by hand to be safe.## See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.# See the saslauthd man page and the output of 'saslauthd -h' for general# information about these options.## Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"#OPTIONS="-c -m /var/run/saslauthd"OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

Kemudian tambahkan user postfix kedalam group sasl untuk memastikan postfix memiliki akses ke saslauthd:# adduser postfix sasl

Sekarang restart Postfix dan start saslauthd:# /etc/init.d/postfix restart# /etc/init.d/saslauthd start

Untuk melihat apakah SMTP-AUTH dan TLS telah bekerja dengan baik jalankan perintah:# telnet localhost 25

Setelah koneksi tercipta ke Postfix mail server ketikkan:# ehlo localhost

Jika melihat baris:250-STARTTLS

Page 25: Modul Instalasi Server Ubuntu 10.04

Dan250-AUTH LOGIN PLAINBerarti semuanya telah bekerja dengan baik.Output dari sistem akan terlihat seperti ini:root@server1:/etc/postfix/ssl# telnet localhost 25Trying ::1...Connected to localhost.localdomain.Escape character is '^]'.220 server1.example.com ESMTP Postfix (Ubuntu)ehlo localhost250-server1.example.com250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-STARTTLS250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSNquit221 2.0.0 ByeConnection closed by foreign host.root@server1:/etc/postfix/ssl#

Ketikkan# quit

Untuk kembali ke system’s shell.

14.Konfigurasi Courier-IMAP/Courier-POP3Untuk menginstal Courier-IMAP/Courier-IMAP-SSL (pada port 993) dan Courier-POP3/Courier-POP3-SSL (pada port 995) jalankan perintah:# aptitude install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-0

Akan ditanyakan dua pertanyaan. Jawab no untuk yang pertama dan yes untuk yang kedua:Create directories for web-based administration? <-- NoSSL certificate required <-- Ok

Pada saat instalasi sertifikat SSL untuk IMAP-SSL dan POP3-SSL akan dibuat dengan hostname localhost. Untuk mengubahnya menjadi hostname yang benar (server1.example.com pada tutorial ini), delete sertifikat tersebut:# cd /etc/courier# rm -f /etc/courier/imapd.pem# rm -f /etc/courier/pop3d.pem

Kemudian modifikasi dua file berikut (Ganti CN=localhost menjadi CN=server1.example.com): # nano /etc/courier/imapd.cnf[...]

Page 26: Modul Instalasi Server Ubuntu 10.04

CN=server1.example.com[...]

Selanjutnya:# nano /etc/courier/pop3d.cnf[...]CN=server1.example.com[...]

Jalankan perintah ini untuk membuat ulang sertifikat:# mkimapdcert# mkpop3dcert

Restart Courier-IMAP-SSL dan Courier-POP3-SSL:# /etc/init.d/courier-imap-ssl restart# /etc/init.d/courier-pop-ssl restart

Jika tidak ingin menggunakan ISPConfig, konfigurasi Postfix agar mengirimkan email ke Maildir* user:# postconf -e 'home_mailbox = Maildir/'# postconf -e 'mailbox_command ='# /etc/init.d/postfix restart

Langkah diatas tidak perlu dilakukan jika inginmenggunakna ISPConfig pada sistem. Karena ISPConfig akan menangani konfigurasi tersebut menggunakan procmail recipes.

15.Konfigurasi Apache/PHP5/Ruby/Python/WebDAVInstal Apache:# aptitude install apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2-suexec libexpat1 ssl-cert

Kemudian install PHP5, Ruby, dan Python (ketiganya merupakan modul untuk Apache):# aptitude install libapache2-mod-php5 libapache2-mod-ruby libapache2-mod-python php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Selanjtnya edit /etc/apache2/mods-available/dir.conf:# nano /etc/apache2/mods-available/dir.conf

Dan ubah baris Directory Index:<IfModule mod_dir.c>

#DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

</IfModule>

Aktifkan modul-modul Apache yang dibutuhkan (SSL, rewrite, suexec, include, dan WebDAV):# a2enmod ssl# a2enmod rewrite# a2enmod suexec# a2enmod include# a2enmod dav_fs

Page 27: Modul Instalasi Server Ubuntu 10.04

# a2enmod dav

Restart Apache:# /etc/init.d/apache2 restart

Edit file /etc/mime.types agar ISPConfig dapat membaca file ruby dengan format .rb:# nano /etc/mime.types

Comment baris application/x-ruby:[...]#application/x-ruby rb[...]

Restart Apache:# /etc/init.d/apache2 restart

Sekarang file .rb akan dapat dieksekusi dan ditampilkan dilayar bersama dengan file .rbx.Pada tahap selanjutnya kita akan menonaktifkan PHP (hal ini perlu dilakukan apabila ingin menginstal ISPConfig pada server). Tidak seperti PHP, Ruby dan Python telah dinonaktifkan secara default.

16.Menonaktifkan PHPPada ISPConfig kita akan mengkonfigurasi PHP untuk setiap website satu-persatu. Kita dapat mengatur website mana yang dapat menjalankan script PHP dan mana yang tidak. Hal ini hanya dapat dilakukan apabila PHP dinonaktifkan secara global (untuk setiap konfigurasi) karena jika tidak demikian semua website akan dapat menjalankan script PHP, tidak peduli seperti apa settingan kita pada ISPConfig.Untuk menonaktifkan PHP secara global, edit file /etc/mime.types dan uncomment bagian application/x-httpd-php:# nano /etc/mime.types[...]#application/x-httpd-php phtml pht php#application/x-httpd-php-source phps#application/x-httpd-php3 php3#application/x-httpd-php3-preprocessed php3p#application/x-httpd-php4 php4#application/x-httpd-php5 php5[...]

Edit /etc/apache2/mods-enabled/php5.conf dan comment bagian SetHandler:# nano /etc/apache2/mods-enabled/php5.conf<IfModule mod_php5.c> <FilesMatch "\.ph(p3?|tml)$"> #SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> #SetHandler application/x-httpd-php-source </FilesMatch> # To re-enable php in user directories comment the following lines # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. <IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine Off </Directory>

Page 28: Modul Instalasi Server Ubuntu 10.04

</IfModule></IfModule>

Restart Apache:# /etc/init.d/apache2 restart

17.Konfigurasi ProftpdInstal Proftpd dengan menjalankan:# aptitude install proftpd ucf

Kerika ditanyakan Run proftpd jawab standalone:Run proftpd: <-- standalone

Untuk alas an keamanan tambahkan baris berikut ini kedalam /etc/proftpd/proftpd.conf:# nano /etc/proftpd/proftpd.conf[...]DefaultRoot ~ServerIdent on "FTP Server ready."[...]

ISPConfig menginginkan konfigurasi untuk berada pada /etc/proftpd.conf dan bukan pada /etc/proftpd/proftpd.conf , oleh sebab itu kita akan membuat link ke path yang bersangkutan:# ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf

Kemudian restart Proftpd:# /etc/init.d/proftpd restart

18.Instalasi WebalizerUntuk menginstal webalizer jalankan perintah:# aptitude install webalizer

19.Sinkronisasi System ClockUntuk melakukan sinkronisasi system clock dengan internet gunakan NTP (Network Time Protocol) server. Instal dengan perintah:# aptitude install ntp ntpdate

20.Instalasi Modul Perl untuk SpamAssassinJalankan perintah:# aptitude install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl libnetaddr-ip-perl libarchive-tar-perl

21.Konfigurasi ISPConfigKonfigurasi untuk server sekarang sudah selesai, tahap selanjutnya adalah menginstal ISPConfig pada server. Panduan instalasi ISPConfig dapat dilihat di http://www.ispconfig.org/manual_installation.htmSebelum menginstal ISPConfig, edit file /usr/include/stdio.h dan ganti bagian getline menjadi parseline pada baris ke-651:# nano /usr/include/stdio.h[...]

Page 29: Modul Instalasi Server Ubuntu 10.04

This function is not part of POSIX and therefore no official cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */extern _IO_ssize_t parseline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __wur;#endif[...]

Bila tidak diedit, proses instalasi akan gagal dengan error dibawah ini:htpasswd.c:101: error: conflicting types for 'getline'/usr/include/stdio.h:651: note: previous declaration of 'getline' was heremake[2]: *** [htpasswd.o] Error 1make[2]: Leaving directory `/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41/src/support'make[1]: *** [build-support] Error 1make[1]: Leaving directory `/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41'make: *** [build] Error 2ERROR: Could not make Apache

Setelah instalasi selesai kita dapat merubahnya kembali menjadi getline. Tetapi jangan lupa untuk mengganti menjadi parseline lagi apabila ingin melakukan update ISPConfig.

22.SuExec (Optional)Jika ingin menjalankan CGI scripts dengan SuExec, maka kita harus menspesifikasikan /var/www sebagai direktori home untuk website yang dibuat dengan ISPConfig karena Ubuntu’s SuExec dikompil dengan /var/www sebagai Doc_Root. Jalankan:# /usr/lib/apache2/suexec –V

Dan outputnya akan terlihat seperti ini:root@server1:~# /usr/lib/apache2/suexec -V -D AP_DOC_ROOT="/var/www" -D AP_GID_MIN=100 -D AP_HTTPD_USER="www-data" -D AP_LOG_EXEC="/var/log/apache2/suexec.log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=100 -D AP_USERDIR_SUFFIX="public_html"root@server1:~#

23. Link BelajarJika ingin mengetahui lebih jauh tentang materi yang disajikan dimodul ini silahkan kunjungi:

Tutorial: http://www.howtoforge.com <- referensi yang digunakan untuk membuat modul ini.

Tutorial: http://www.ubuntugeek.com ISPConfig: http://www.ispconfig.org

Page 30: Modul Instalasi Server Ubuntu 10.04