MODUL INSTALASI SERVER UBUNTU
10.04 LTS [ISPCONFIG2]
UII SYNAPTIC
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).
Pada tutorial ini hostname yang digunakan adalah
server1.example.comdan 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:
Pilih bahasa instalasi:
Pilih layout keyboard (ketikkan beberapa tombol dan installer akan secara otomatis mendetek
layout keyboard yang digunakan):
Installer akan mengecek CD instalasi, hardware, dan konfigurasi jaringan dengan DHCP
apabila terdapat DHCP server pada jaringan:
Masukkan hostname yang diinginkan. Pada tutorial ini yang digunakan adalah
Installer akan mendeteksi time zone secara otomatis. Pilih
yesuntuk memilih opsi default
atau
nountuk mengatur time zone sendiri:
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) filesystemdan satu lagi untuk swap. Partisi juga
Pilih disk yang ingin dipartisi:
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.
Setelah itu, partisi akan mulai diformat dan dibuat:
Buat account user, sebagai contoh
Administratordengan username
administrator(jangan
Selanjutnya kita akan mengkonfigurasi apt package manager. Biarkan bagian HTTP proxy
kosong kecuali memang ingin menggunakan proxy server untuk konek ke internet:
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:
Kita membutuhkan DNS, mail, dan LAMP server, tetapi kita tidak akan memilihnya
paket yang akan kita install sekarang adalah
OpenSSH serveragar kita dapat langsung
melakukan koneksi ke sistem dengan SSH client seperti Putty setelah proses instalasi selesai:
Pilih
yesketika ditanyakan
Install the GRUB boot loader to the master boot record?:Instalasi bagian dasar sistem sekarang telah selesai. Keluarkan CD instalasi dari CD drive dan
pilih
Continueuntuk mereboot sistem:
3. Setting Hak Akses Root
Setelah 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
sudoatau 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:
Sekarang kita bisa menggunakan SSH client seperti PuTTY dan konek secara remote dari
workstation kita ke server Ubuntu 10.04.
5. Konfigurasi Jaringan
Karena 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 interface auto lo
iface lo inet loopback
# The primary network interface auto eth0
iface 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/hostsmenggunakan editor:
# nano /etc/hosts127.0.0.1 localhost.localdomain localhost 192.168.0.100 server1.example.com server1
# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::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.comsekarang:
6.
Konfigurasi Package Sources
Edit
/etc/apt/sources.list. Uncomment atau hapus CD instalasi dari file dan
pastikan repository
universedan
multiversediaktifkan. 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 restricted deb-src http://de.archive.ubuntu.com/ubuntu/ lucid main restricted
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted deb-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 universe deb-src http://de.archive.ubuntu.com/ubuntu/ lucid universe deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe deb-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 ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team.
deb http://de.archive.ubuntu.com/ubuntu/ lucid multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ lucid multiverse deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse deb-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 restricted deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe deb http://security.ubuntu.com/ubuntu lucid-security multiverse deb-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
Untuk menginstal ISPConfig kita perlu mengubah settingan default shell pada sistem dari
/bin/dash
menjadi
/bin/bashjalankan perintah:
# dpkg-reconfigure dashKetika ditanyakan
Install dash as /bin/sh?pilih
no.
8. Konfigurasi AppArmor
AppArmor 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 Pendukung
Instal 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 Quota
Untuk mengistal quota jalankan:
# aptitude install quota
Kemudian edit
/etc/fstabdan 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 installation
UUID=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=vfsv0satu
baris dengan partisi root.
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 –avug11.Konfigurasi DNS Server
# aptitude install bind9
Untuk alasan keamanan BIND akan dijalankan dengan chrooted. Jalankan perintah ini:
# /etc/init.d/bind9 stop
Edit file
/etc/default/bind9sehingga 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 server OPTIONS="-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/etcBuat 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$AddUnixListenSocket /var/lib/named/dev/log
Restart logging daemon:
# /etc/init.d/rsyslog restart
Start up BIND, dan cek
/var/log/sysloguntuk error:
# /etc/init.d/bind9 start12.Konfigurasi MySQL
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: <- password Repeat password for the MySQL “root” user: <- password
Password yang diisikan ini akan digunakan untuk user
root@localhostdan juga
root@server1.example.com.
Ubah konfigurasi MySQL pada
/etc/mysql/my.cnfagar 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:
tcp 0 0 *:mysql *:* LISTEN 6525/mysqld
root@server1:~#
13.Konfigurasi Postfix dengan SMTP-AUTH dan TLS
Jalankan 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 Site System 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 Site System mail name: <-- server1.example.com
Root and postmaster mail recipient: <-- [blank]
Other destinations to accept mail for (blank for none): <--
server1.example.com, localhost.example.com, localhost.localdomain, localhost
Force synchronous updates on mail queue? <-- No
Local networks: <-- 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 Use procmail for local delivery? <-- Yes
Mailbox size limit (bytes): <-- 0
Local address extension character: <-- + Internet protocols to use: <-- all
Kemudian jalankan:
# 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 'tls_random_source = dev:/dev/urandom'
File yang berada di
/etc/postfix/main.cfakan 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
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/saslauthduntuk mengaktifkan
saslauthd. Set
STARTto yesdan 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.
# 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
postfixkedalam group
sasluntuk memastikan postfix
memiliki akses ke
saslauthd:
# adduser postfix saslSekarang restart Postfix dan start
saslauthd: # /etc/init.d/postfix restartUntuk 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
Dan
250-AUTH LOGIN PLAIN
Berarti semuanya telah bekerja dengan baik.
Output dari sistem akan terlihat seperti ini:
root@server1:/etc/postfix/ssl# telnet localhost 25 Trying ::1...
Connected to localhost.localdomain. Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu) ehlo localhost 250-server1.example.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS
250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME
250 DSN quit
221 2.0.0 Bye
Connection closed by foreign host. root@server1:/etc/postfix/ssl#
Ketikkan
# quit
Untuk kembali ke system’s shell.
14.Konfigurasi Courier-IMAP/Courier-POP3
Untuk menginstal IMAP/IMAP-SSL (pada port 993) dan
Courier-POP3/Courier-POP3-SSL (pada port 995) jalankan perintah:
# aptitude install authdaemon base imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0
libglib2.0-0
Akan ditanyakan dua pertanyaan. Jawab
nountuk yang pertama dan
yesuntuk yang
kedua:
Create directories for web-based administration? <-- No SSL 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.compada 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=localhostmenjadi
CN=server1.example.com):
# nano /etc/courier/imapd.cnf [...]
[...]
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/WebDAV
Instal 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 mod-php5 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 mysql pspell recode snmp sqlite tidy php5-xmlrpc php5-xsl
Selanjtnya edit
/etc/apache2/mods-available/dir.conf:
# nano /etc/apache2/mods-available/dir.confDan 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 # a2enmod davRestart Apache:
# /etc/init.d/apache2 restartEdit file
/etc/mime.typesagar ISPConfig dapat membaca file ruby dengan format .rb:
# nano /etc/mime.typesComment baris
application/x-ruby:
[...]#application/x-ruby rb [...]
# /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 PHP
Pada 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.typesdan 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.confdan 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> </IfModule> </IfModule>
Restart Apache:
# /etc/init.d/apache2 restart17.Konfigurasi Proftpd
Instal Proftpd dengan menjalankan:
# aptitude install proftpd ucf
Kerika ditanyakan
Run proftpdjawab
standalone:
Run proftpd: <-- standaloneUntuk 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.confdan 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 Webalizer
Untuk menginstal webalizer jalankan perintah:
# aptitude install webalizer
19.Sinkronisasi System Clock
Untuk melakukan sinkronisasi system clock dengan internet gunakan NTP (Network
Time Protocol) server. Instal dengan perintah:
# aptitude install ntp ntpdate
20.Instalasi Modul Perl untuk SpamAssassin
Jalankan perintah:
# aptitude install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl libnetaddr-ip-libnet-dns-perl libarchive-tar-libnet-dns-perl
21.Konfigurasi ISPConfig
Konfigurasi untuk server sekarang sudah selesai, tahap selanjutnya adalah menginstal
ISPConfig pada server. Panduan instalasi ISPConfig dapat dilihat di
http://www.ispconfig.org/manual_installation.htm
Sebelum menginstal ISPConfig, edit file
/usr/include/stdio.hdan ganti bagian
getlinemenjadi
parselinepada baris ke-651:
[...]
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 here
make[2]: *** [htpasswd.o] Error 1
make[2]: Leaving directory
`/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41/src/support' make[1]: *** [build-support] Error 1
make[1]: Leaving directory
`/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41' make: *** [build] Error 2
ERROR: Could not make Apache
Setelah instalasi selesai kita dapat merubahnya kembali menjadi
getline. Tetapi jangan
lupa untuk mengganti menjadi
parselinelagi 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
# /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 Belajar
Jika ingin mengetahui lebih jauh tentang materi yang disajikan dimodul ini silahkan
kunjungi:
•
Tutorial:
http://www.howtoforge.com
<- referensi yang digunakan untuk
membuat modul ini.
•