konfigurasi server linux ubuntu9

17

Click here to load reader

Transcript of konfigurasi server linux ubuntu9

Page 1: konfigurasi server linux ubuntu9

Konfigurasi Server Ubuntu 9.04Oleh : M. GuschoyyinSMK N 2 B. Lampung

1 Dapatkan Keistimewaan root

Setelah reboot, Anda dapat login dengan username Anda yang dibuat sebelumnya (misalnyaadministrator). Karena kita harus menjalankan semua langkah dari tut orial ini dengan hak aksesroot, kita dapat prepend semua perintah dalam tutorial ini dengan sudo, atau kita sekarangmenjadi root dengan mengetik :

sudo su

(Anda dapat juga mengaktifkan login root dengan menjalankan

sudo passwd root

dan memberikan password root. Anda kemudian dapat langsung log in sebagai root, tapi inidisukai oleh pengembang Ubuntu dan masyarakat karena berbagai alasan. Lihathttp://ubuntuforums.org/showthread.php?t=765 414.)

2 Installasi SSH Server (Opsional)

Jika Anda tidak menginstal OpenSSH server selama instalasi sistem, Anda bisa mel akukannyasekarang :

aptitude install ssh openssh-server

Mulai sekarang Anda dapat menggunakan klien SSH seperti Putty dan koneksi dari komputer Andake Ubuntu 9.04 server dan ikuti langkah -langkah dari tutorial ini.

3 Instal vim-nox (Opsional)

Saya akan menggunakan vi sebagai editor teks dalam tutorial ini. Program vi default memilikibeberapa perilaku aneh pada Ubuntu dan Debian ; untuk memperbaiki hal ini, kita akanmenginstal vim-nox :

aptitude install vim-nox

(Anda tidak perlu melakukan hal ini jika anda menggunakan editor teks yang berbeda seperti joeatau nano.)

4 Configure The Network

Karena installer Ubuntu telah mengkonfig urasi sistem kami untuk mendapatkan pengaturanjaringan melalui DHCP, kita harus mengubah yang sekarang karena server harus memiliki alamat IP

Page 2: konfigurasi server linux ubuntu9

statis. Edit /etc/network/interfaces dan menyesuaikan dengan kebutuhan anda (pada contoh inikonfigurasi saya akan menggunakan alamat IP 192.168.0.100) :

vi /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 jaringan anda :

/etc/init.d/networking restart

Kemudian edit /etc/hosts. Membuatnya terlihat, seperti ini :

vi /etc/hosts

127.0.0.1 localhost.localdomain localhost192.168.0.100 server1.example.com server1

# The following lines are desirable for IP v6 capable hosts::1 localhost ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allroutersff02::3 ip6-allhosts

Sekarang jalankan

echo server1.example.com > /etc/hostname/etc/init.d/hostname.sh start

Setelah itu, jalankan

hostnamehostname -f

Keduanya harus menunjukkan server1.example.com sekarang.

Page 3: konfigurasi server linux ubuntu9

5 Edit /etc/apt/sources.list dan Update Linux Installan Anda

Edit /etc/apt/sources.list. Komentar keluar atau mengeluarkan CD instalasi dari file dan pastikanbahwa universe dan repositori multiverse diaktifkan. Seharusnya terlihat seperti ini:

vi /etc/apt/sources.list

## deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release amd64 (20090421.1)]/ jaunty mainrestricted

#deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release amd64 (20090421.1)]/ jaunty mainrestricted# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.

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

## Major bug fix updates produced after the final release of the## distribution.deb http://de.archive.ubuntu.com/ubuntu/ jaunty -updates main restricteddeb-src http://de.archive.ubuntu .com/ubuntu/ jaunty-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/ jaunty universedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty universedeb http://de.archive.ubuntu.com/ubuntu/ jaunty -updates universedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty -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/ jaunty multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty multiversedeb http://de.archive.ubuntu.com/ubuntu/ jaunty -updates multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty -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/ubunt u/ jaunty-backports main restricted universe multiverse# deb-src http://de.archive.ubuntu.com/ubuntu/ jaunty -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 jaunty partner

Page 4: konfigurasi server linux ubuntu9

# deb-src http://archive.canonical.com/ubuntu jaunty partner

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

Kemudian jalankan

aptitude update

untuk update paket database apt, jalankan

aptitude safe-upgrade

untuk menginstal pembaruan terbaru (jika ada). Jika Anda melihat bahwa kernel baru akan diinstalsebagai bagian dari update, Anda harus reboot sistem setelahnya :

reboot

6 Ubah Default Shell

/bin/sh adalah sebuah symlink ke /bin/dash, Namun kita perlu /bin/bash, tidak /bin/dash. Olehkarena itu kita melakukan ini :

dpkg-reconfigure dash

Install dash sebagai /bin/sh? <-- No

Jika Anda tidak melakukan ini, instalasi ISPConfig akan gagal.

7 Disable AppArmor

AppArmor adalah ekstensi keamanan (mirip dengan SELinux) yang harus men yediakan keamanandiperluas. Menurut pendapat saya anda tidak memerlukannya untuk mengkonfigurasi sistem yangaman, dan biasanya menyebabkan lebih banyak masalah daripada keuntungan (memikirkan hal inisetelah Anda telah melakukan pemecahan masalah karena beberapa operator tidak bekerjaseperti yang diharapkan, dan kemudian Anda mencari tahu bahwa semuanya ok, hanya AppArmoryang menyebabkan masalah). Oleh karena itu saya menonaktifkan itu (ini adalah suatu keharusanjika Anda ingin menginstal ISPConfig di kemudian hari).

Kita dapat menonaktifkan seperti ini :

/etc/init.d/apparmor stopupdate-rc.d -f apparmor removeaptitude remove apparmor apparmor -utils

8 Install Beberapa Software

Page 5: konfigurasi server linux ubuntu9

Sekarang kita menginstal beberapa paket yang dibutuhkan nanti. Jalankan

aptitude install binutils cpp fetchmail flex gcc libarchive -zip-perl libc6-dev libcompress-zlib-perllibdb4.6-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap openssl perl perl -modules unzip zipzlib1g-dev autoconf automake1.9 libtool bison autotools -dev g++ build-essential

(Perintah ini harus ada ke dalam satu baris!)

9 Quota

(Jika Anda memilih skema partisi yang berbeda daripada Saya, Anda harus menyesuaikan bab inisehingga kuota berlaku pada partisi di mana Anda membutuhkannya.)

Untuk install quota, Jalankan

aptitude install quota

Edit /etc/fstab. tampak seperti ini (Saya menambahkan, usrquota, grpquota ke partisi denganmount point /):

vi /etc/fstab

# /etc/fstab: static file system information.## Use 'vol_id --uuid' to print the universally unique ide ntifier 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 defaults 0 0# / was on /dev/mapper/server1 -root during installationUUID=b8d265bc-5959-404d-a68e-8dc1c76f18d6 / ext3 relatime,errors=remount -ro,usrquota,grpquota 0 1# /boot was on /dev/sda5 during installatio nUUID=01e9c3c7-2ad0-4f52-a356-18290517b362 /boot ext2 relatime 0 2# swap was on /dev/mapper/server1 -swap_1 during installationUUID=c1e0bcbb-5c73-4bd2-a7b2-8beeb7526200 none swap sw 0 0/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

Untuk mengaktifkan kuota, jalankan perintah -perintah ini :

touch /quota.user /quota.groupchmod 600 /quota.*mount -o remount /

quotacheck -avugmquotaon -avug

10 DNS Server

Jalankan

Page 6: konfigurasi server linux ubuntu9

aptitude install bind9

Untuk alasan keamanan kita ingin menjalankan BIND chroot sehingga kita harus mel akukanlangkah-langkah berikut :

/etc/init.d/bind9 stop

Edit file /etc/default/bind9 sehingga daemon akan berjalan sebagai pengguna Unp rivilegedmengikat, chroot ke /var/lib/named. Ubah baris: OPTIONS = " -u bind" sehingga berbunyi OPTIONS= "-u bind-t /var/lib/named":

vi /etc/default/bind9

# run resolvconf?RESOLVCONF=yes

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

Buat direktori yang diperlukan dalam / var/lib:

mkdir -p /var/lib/named/etcmkdir /var/lib/named/devmkdir -p /var/lib/named/var/cache/bindmkdir -p /var/lib/named/var/run/bind/run

Kemudian memindahkan direktori konfigurasi dari /etc ke /var /lib/named/etc:

mv /etc/bind /var/lib/named/etc

Buat symlink ke direktori konfigurasi baru dari lokasi lama (untuk menghindari masalah ketika bindakan diperbarui di masa mendatang):

ln -s /var/lib/named/etc/bind /etc/bind

Membuat null dan random devices, dan memperbaiki akses dari direktori :

mknod /var/lib/named/dev/null c 1 3mknod /var/lib/named/dev/random c 1 8chmod 666 /var/lib/named/dev/null /var/lib/named/dev/randomchown -R bind:bind /var/lib/named/var/*chown -R bind:bind /var/lib/named/etc/bind

Kita perlu memodifikasi /etc/default/ syslogd sehingga kita masih bisa mendapatkan log pesan -pesan penting ke sistem log. Memodifikasi baris: syslogd = "" sehingga berbunyi: sy slogd = "-a/var/lib/named/dev/log":

vi /etc/default/syslogd

#

Page 7: konfigurasi server linux ubuntu9

# Top configuration file for syslogd#

## Full documentation of possible arguments are found in the manpage# syslogd(8).#

## For remote UDP logging use SYSLOGD=" -r"#SYSLOGD="-a /var/lib/named/dev/log"

Restart logging daemon :

/etc/init.d/sysklogd restart

Start up BIND, dan periksa /var/log/syslog dari errors :

/etc/init.d/bind9 start

11 MySQL

Untuk menginstal MySQL, kita jalankan

aptitude install mysql-server mysql-client libmysqlclient15-dev

Anda akan diminta untuk membe rikan password untuk MySQL user root - password ini berlakubagi pengguna root @ localhost maupun [email protected], jadi kita tidak perlumenentukan password root MySQL secara manual di kemudian hari :

New password for the MySQL "root" user: < -- yourrootsqlpasswordRepeat password for the MySQL "root" user: < -- yourrootsqlpassword

Kami ingin MySQL untuk semua interface, tidak hanya localhost, oleh karena itu kita edit/etc/mysql/my.cnf dan isikan baris bind-address = 127.0.0.1:

vi /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 kita restart MySQL :

/etc/init.d/mysql restart

Sekarang periksa jaringan yang aktif. Jalankan

netstat -tap | grep mysql

Page 8: konfigurasi server linux ubuntu9

Output akan terlihat seperti ini :

root@server1:~# netstat -tap | grep mysqltcp 0 0 *:mysql *:* LISTEN 4318/mysqldroot@server1:~#

12 Postfix Dengan SMTP-AUTH dan TLS

Untuk menginstal Postfix dengan SMTP -AUTH dan TLS lakukan langkah-langkah berikut :

aptitude install postfix libsasl2 -2 sasl2-bin libsasl2-modules procmail

Anda akan ditanyakan dua pertanyaan. Jawaban sebagai berikut :

General type of mail configuration: <-- Internet SiteSystem mail name: <-- server1.example.com

Kemudian Jalankan

dpkg-reconfigure postfix

Sekali lagi, Anda akan ditanya beberapa pertanyaan :

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

Selanjutnya, lakukan ini :

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.confecho ‘mech_list: plain login’ >> /etc/postfix/sasl/smtpd.conf

Setelah itu kami buat sertifikat untuk TLS :

Page 9: konfigurasi server linux ubuntu9

mkdir /etc/postfix/sslcd /etc/postfix/ssl/openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

chmod 600 smtpd.keyopenssl 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.keyopenssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

Selanjutnya kita mengkonfigurasi postfix untuk TLS (pastikan bahw a anda menggunakan namahost 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 /etc/postfix/main.cf akan terlihat seperti ini :

cat /etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commente d, 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

# Uncomment the next line to generate "delayed mail" warnings#delay_warning_time = 4h

Page 10: konfigurasi server linux ubuntu9

readme_directory = no

# TLS parameterssmtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crtsmtpd_tls_key_file = /etc/postfix/ssl/smtpd.keysmtpd_use_tls = yessmtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scachesmtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for# information on enabling SSL in the smtp client.

myhostname = server1.example.comalias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesmyorigin = /etc/mailnamemydestination = server1.example.com, localhost.example.co m, localhost.localdomain, localhostrelayhost =mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128mailbox_command = procmail -a "$EXTENSION"mailbox_size_limit = 0recipient_delimiter = +inet_interfaces = allinet_protocols = allsmtpd_sasl_local_domain =smtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_sasl_authenticated_header = yessmtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destinationsmtpd_tls_auth_only = nosmtp_use_tls = yessmtp_tls_note_starttls_offer = yessmtpd_tls_CAfile = /etc/postfix/ssl/cacert.pemsmtpd_tls_loglevel = 1smtpd_tls_received_header = yessmtpd_tls_session_cache_timeout = 3600stls_random_source = dev:/dev/urandom

Otentikasi akan dilakukan oleh saslauthd. Kita harus mengubah beberapa hal untuk membuatnyabekerja dengan baik. Karena untuk menjalankan Postfix chroot di /var/spool/postfix kita harusmelakukan hal berikut :

mkdir -p /var/spool/postfix/var/run/saslauthd

Sekarang kita harus mengedit /etc/default/saslauthd untuk mengaktifkan saslauthd. Set START keya dan mengubah baris OPTIONS = " -c-m /var/run/saslauthd" untuk OPTIONS = "-c-m/var/spool/postfix/var/run/saslauthd-r" :

vi /etc/default/saslauthd

# Settings for saslauthd daemon# Please read /usr/share/doc/sasl2 -bin/README.Debian for details.#

# Should saslauthd run automatically on startup? (default: no)

Page 11: konfigurasi server linux ubuntu9

START=yes

# Description of this saslauthd instance. Recommended.# (suggestion: SASL Authentication Daemon)DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.# (suggestion: saslauthd)NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)## Available options in this Debian packa ge:# getpwent -- use the getpwent() library function# kerberos5 -- use Kerberos 5# pam -- use PAM# rimap -- use a remote IMAP server# shadow -- use the local shadow password file# sasldb -- use the local sasldb database file# ldap -- use LDAP (configuration is in /etc/saslauthd.conf)## Only one option may be used at a time. See the saslauthd man page# for more information.## Example: MECHANISMS="pam"MECHANISMS="pam"

# 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 P ROPERLY. 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"

Selanjutnya postfix menambahkan user ke grup sasl (ini akan mema stikan bahwa Postfix memilikiizin untuk mengakses saslauthd) :

adduser postfix sasl

Sekarang restart Postfix dan mulai saslauthd :

Page 12: konfigurasi server linux ubuntu9

/etc/init.d/postfix restart/etc/init.d/saslauthd start

Untuk melihat apakah SMTP -AUTH dan TLS bekerja dengan baik sekarang jalankan perintahberikut :

telnet localhost 25

Setelah Anda telah menetapkan sambungan ke server mail Postfix Anda ketik

ehlo localhost

Jika Anda melihat :

250-STARTTLS

dan

250-AUTH LOGIN PLAIN

Berarti semuanya baik.

Output pada sistem saya terlihat se perti 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#

Type

quit

Page 13: konfigurasi server linux ubuntu9

untuk kembali ke sistem shell.

13 Courier-IMAP/Courier-POP3

Jalankan ini untuk menginstal Courier -IMAP/Courier-IMAP-SSL (untuk IMAPs pada port 993) danCourier-POP3/Courier-POP3-SSL (untuk POP3s pada port 995) :

aptitude install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-popcourier-pop-ssl courier-ssl gamin libgamin0 libglib2.0 -0

Anda akan diminta dua pertanyaan :

Create directories for web-based administration? <-- NoSSL certificate required <-- Ok

Selama instalasi, SSL sertifikat untuk IMAP -SSL dan POP3-SSL diciptakan dengan hostnamelocalhost. Untuk mengubahnya ke nama host yang benar (server1.example.com dalam tutorial ini),menghapus sertifikat ...

cd /etc/courierrm -f /etc/courier/imapd.pemrm -f /etc/courier/pop3d.pem

... dan memodifikasi dua file berikut, ga nti CN = localhost dengan CN = server1.example.com (Andajuga dapat memodifikasi nilai -nilai lain, jika perlu) :

vi /etc/courier/imapd.cnf

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

vi /etc/courier/pop3d.cnf

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

Kemudian Buat kembali sertifikat ...

mkimapdcertmkpop3dcert

... dan restart Courier-IMAP-SSL dan Courier-POP3-SSL :

/etc/init.d/courier-imap-ssl restart/etc/init.d/courier-pop-ssl restart

Jika Anda tidak ingin menggunakan ISPConfig, mengkonfigurasi Postfix untuk mengirim email kepengguna Maildir * :

Page 14: konfigurasi server linux ubuntu9

postconf -e 'home_mailbox = Maildir/'postconf -e 'mailbox_command ='/etc/init.d/postfix restart

* Harap diperhatikan : Anda tidak perlu melakukan hal ini jika Anda berniat untuk menggunakanISPConfig pada sistem anda sebaga i ISPConfig melakukan konfigurasi yang diperlukanmenggunakan resep procmail. Tapi silakan kunjungi Pastikan untuk mengaktifkan Maildir di bawahManajemen -> Server -> Settings -> EMail di ISPConfig web interface.

14 Apache/PHP5/Ruby/Python/WebDAV

Sekarang kita menginstal Apache :

aptitude install apache2 apache2 -doc apache2-mpm-prefork apache2-utils apache2-suexeclibexpat1 ssl-cert

Selanjutnya kita menginstal PHP5, Ruby, dan Python (semua tiga sebagai modul 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-mcryptphp5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Selanjutnya kita edit /etc/apache2/mods-available/dir.conf :

vi /etc/apache2/mods-available/dir.conf

dan ubah baris DirectoryIndex :

<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>

Sekarang kita harus mengaktifkan beberapa Apache modules (SSL, rewrite, suexec, include, danWebDAV):

a2enmod ssla2enmod rewritea2enmod suexeca2enmod includea2enmod dav_fsa2enmod dav

Restart Apache :

/etc/init.d/apache2 restart

Page 15: konfigurasi server linux ubuntu9

Kita harus memperbaiki masalah kecil dengan Ruby. Jika Anda menginstal Ruby ISPConfig danmemungkinkan untuk situs web,. Rbx file ini akan dijalankan baik -baik saja dan ditampilkan dalambrowser, namun ini tidak bekerja. Rb file - Anda akan diminta untuk men -download. Rb file - yangsama terjadi jika mengkonfigurasi Ruby secara manual untuk vhost (yakni, tidak ada hubungannyadengan ISPConfig). Untuk memper baiki hal ini, kita buka file /etc/mime.types ...

vi /etc/mime.types

... dan isikan rb pada baris aplikasi /x-ruby :

[...]#application/x-ruby rb[...]

Restart Apache:

/etc/init.d/apache2 restart

Sekarang. Rb file ini akan dieksek usi dan ditampilkan dalam browser, seperti. Rbx file.Dalam bab berikutnya (17.1) kita akan menonaktifkan PHP (ini hanya diperlukan jika anda inginmenginstall ISPConfig pada server ini). Tidak seperti PHP, Ruby dan Python yang dinonaktifkansecara default, oleh karena itu kita tidak harus mel akukannya.

14.1 Disable PHP Globally

(Jika anda tidak berencana untuk menginstal ISPConfig pada server ini, silakan melewati bagianini!)

Dalam ISPConfig Anda akan mengkonfigurasi PHP pada situs dari dasar, yaitu Anda dapatmenentukan situs web yang dapat menjalankan skrip PHP dan yang satu tidak bisa. Ini hanyadapat bekerja jika PHP ini dinonaktifkan secara global karena kalau tidak semua situs Web akandapat menjalankan skrip PHP, terserah apa yang Anda tetapkan dalam ISPConfig.Untuk menonaktifkan PHP secara global, kita edit file /etc/mime.types dan isikan phtml pht phppada baris aplikasi / x-httpd-php :

vi /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[...]

Edit /etc/apache2/mods-enabled/php5.conf dan isikan di baris berikut :

vi /etc/apache2/mods-enabled/php5.conf

<IfModule mod_php5.c># AddType application/x-httpd-php .php .phtml .php3

Page 16: konfigurasi server linux ubuntu9

# AddType application/x-httpd-php-source .phps</IfModule>

Kemudian restart Apache :

/etc/init.d/apache2 restart

15 Proftpd

Untuk menginstal proftpd, jalankan

aptitude install proftpd ucf

Anda akan ditanya pertanyaan :

Run proftpd: <-- standalone

Untuk alasan keamanan tambahkan baris berikut ke /etc/proftpd/proftpd.conf (terima kasihkepada Reinaldo Carvalho; informasi lebih lanjut dapat ditemukan di sini :http://proftpd.org/localsite/Userguide/linked/userguide.html ) :

vi /etc/proftpd/proftpd.conf

[...]DefaultRoot ~IdentLookups offServerIdent on "FTP Server ready."[...]

ISPConfig mengharapkan untuk konfigurasi di /etc/proftpd.conf bukan /etc/proftpd/proftpd.conf ,oleh karena itu kita buat sebuah symlink (Anda dapat melewati perintah ini jika anda tidak inginmenginstal ISPConfig) :

ln -s /etc/proftpd/proftpd.conf /etc/proftpd.conf

Kemudian restart Proftpd :

/etc/init.d/proftpd restart

16Webalizer

Untuk install webalizer, hanya menjalankan

aptitude install webalizer

17 Synchronize System Clock

Page 17: konfigurasi server linux ubuntu9

Ini adalah ide yang baik untuk menyinkronkan si stem jam dengan NTP (network time protocol)server melalui internet. Jalankan

aptitude install ntp ntpdate

dan waktu sistem anda akan selalu sinkron.

18 Instal Beberapa Perl Modul Needed Oleh SpamAssassin ( Datang dengan ISPConfig)

Jalankan

aptitude install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl

19 ISPConfig

Konfigurasi server sekarang sudah selesai, dan jika Anda ingin kini Anda dapat menginstalISPConfig di atasnya. Harap periksa instalasi ISPConfig manual :http://www.ispconfig.org/manual_installation.htm

19.1 Sebuah catatan On SuExecJika Anda ingin menjalankan script CGI dibawah suExec, anda harus menentukan /var/wwwsebagai direktori home untuk situs web yang diciptak an oleh ISPConfig sebagai suE xec Ubuntudikompilasi dengan /var/www sebagai Doc_Root. Jalankan

/usr/lib/apache2/suexec -V

dan output 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:~#

Jadi, jika Anda ingin menggunakan suExec dengan ISPconfig, jangan me ngubah default web root(yaitu /var/www) jika anda menggunakan mode ahli selama instalasi ISPConfig (dalam modusstandar Anda tidak dapat mengubah akar web sehingga Anda tetap online. dan akan dapatmenggunakan suExec dalam hal apapun).

20 Sumber / Links

Ubuntu: http://www.ubuntu.com ISPConfig: http://www.ispconfig.org Linux : http://www.howtoforge.com