Академический Документы
Профессиональный Документы
Культура Документы
Downloadfileopenssl0.9.8.tar.gzdarihttp://openssl.org.
Bukapakettarbalnya.
#tarzxfopenssl0.9.8.tar.gz
KonfigurasidankompilasipaketOpenSSL
#cdopenssl0.9.8
#./configprefix=/usr/localopenssldir=/usr/local/opensslshared
#make
#maketest
InstalasipaketOpenSSL
#makeinstall
InstalasiBIND
Downloadfilebind9.3.0.tar.gzdariftp://ftp.isc.org/isc/bind9/9.3.0/bind
9.3.0.tar.gz
Bukapakettarbalbind9.3.0.tar.gz
#tarzxfbind9.3.0.tar.gz
#cdbind9.3.0
Konfigurasipaketbind9.3.0
#./configurewithopenssl=yeswithlibtool\
enablethreadssysconfdir=/etclocalstatedir=/var/named\
enablelibbindenableipv6enablegetifaddrsenablelargefile
Kompilasipaketbind9.3.0
#makedepend
#make
Instalasipaketbind9.3.0
#makeinstall
Editfile/etc/ld.so.conf
#vi/etc/ld.so.conf
Tambahkanbarisberikut
/usr/local/lib
Terapkanperubahanldconfig
#ldconfig
Generaterndckey
#rndcconfgen
#Startofrndc.conf
options{
defaultserverlocalhost;
defaultkey"mykey";
};
serverlocalhost{
key"mykey";
};
keymykey{
algorithmhmacmd5;
secret
"IriCelUSbPMypSjImBsiTHMauOumRPMkdBjoxVINAx0vxJZNRKGWzFCKibad";
};
#Endofrndc.conf
#Startofnamed.conf
keymykey{
algorithmhmacmd5;
secret
"IriCelUSbPMypSjImBsiTHMauOumRPMkdBjoxVINAx0vxJZNRKGWzFCKibad";
};
controls{
inet127.0.0.1port953
allow{127.0.0.1;}keys{mykey;};
};
options{
directory"/var/named/";
authnxdomainyes;
};
#Endofnamed.conf
Selanjutnyabuatlahfile/etc/rndc.conf,/etc/rndc.key,dan/etc/named.confdengan
mengacupadahasilgeneratediatas.Berikutiniberturutturutisidarimasinmasinfile:
File/etc/rndc.conf
options{
defaultserverlocalhost;
defaultkey"mykey";
};
serverlocalhost{
key"mykey";
};
keymykey{
algorithmhmacmd5;
secret
"IriCelUSbPMypSjImBsiTHMauOumRPMkdBjoxVINAx0vxJZNRKGWzFCKibad";
};
File/etc/rndc.key
keymykey{
algorithmhmacmd5;
secret
"IriCelUSbPMypSjImBsiTHMauOumRPMkdBjoxVINAx0vxJZNRKGWzFCKibad";
};
File/etc/named.conf
keymykey{
algorithmhmacmd5;
secret
"IriCelUSbPMypSjImBsiTHMauOumRPMkdBjoxVINAx0vxJZNRKGWzFCKibad";
};
controls{
inet127.0.0.1port953
allow{127.0.0.1;}keys{mykey;};
};
options{
directory"/var/named/";
authnxdomainyes;
};
Kemudianpadafile/etc/named.conf,tambahkankonfigurasiberikutini.
zone"."IN{
typehint;
file"named.ca";
};
zone"0.0.127.inaddr.arpa"IN{
typemaster;
file"named.local";
};
Buatlahfile/var/named/named.cadenganperintahdig.
#digrs.internic.net>/var/named/named.ca
Buatlahfile/var/named/named.local.
#vi/var/named/named.local
Tambahkankonfigurasisebagaiberikut.
$TTL86400
@INSOAlocalhost.root.localhost.(
200412300;Serial
28800;Refresh
14400;Retry
3600000;Expire
86400);Minimum
INNSlocalhost.
1INPTRlocalhost.
Buatlahdirektoriuntukmenyimpanprosesbinddi/var/named/run
#mkdir/var/named/run
Sekarangkitaakanmembuatdomainbarudengannamaexcellent.com,denganasumsi
bahwanamaserveradalahritek.excellent.comdanIP202.155.6.42.
Editfile/etc/named.conf,dantanbahkanzonebarusebagaiberikut.
zone"excellent.com"IN{
typemaster;
file"excellent.com";
allowupdate{none;};
};
Buatlahfiledatabaseuntukdomainexcellent.comdi/var/named/
#vi/var/named/excellent.com
Isikankonfigurasinyasebagaiberikut.
$TTL86400
$ORIGINexcellent.com.
@INSOAexcellent.com.root.excellent.com.(
200412301;Serial
28800;Refresh
14400;Retry
3600000;Expire
86400);Minimal
INNSritek.excellent.com.
INMX10mail.excellent.com.
INA202.155.6.42
wwwINCNAME@
ftpINCNAME@
mailINCNAME@
Saatnyamenjalankandaemonnya,ketikkanperintahberikut.
#/usr/local/sbin/named
PastikanbahwanamedsudahberjalandanLISTENpadaport53dan953
#psax|grepnamed
3670?Ssl0:00/usr/local/sbin/named
#netstattapn
tcp00202.155.6.42:530.0.0.0:*LISTEN3670/named
tcp00127.0.0.1:530.0.0.0:*LISTEN3670/named
tcp00127.0.0.1:9530.0.0.0:*LISTEN3670/named
Agardaemonbind(named)berjalansaatkomputersystemLinuxdihidupkan,editfile
/etc/rc.local,dantambahkanbarisberikut.
/usr/local/sbin/named
Editfile/etc/hosts.
#vi/etc/hosts
Tambahkanbarisberikut.
202.155.6.42
202.155.6.42
ritek.excellent.com
excellent.com
Selanjutnyabisaditesdenganpingnamadomain.
#pingexcellent.com
PINGexcellent.com(202.155.6.42)56(84)bytesofdata.
64bytesfrom202.155.6.42:icmp_seq=1ttl=64time=0.086ms
64bytesfrom202.155.6.42:icmp_seq=2ttl=64time=0.098ms
64bytesfrom202.155.6.42:icmp_seq=3ttl=64time=0.083ms
64bytesfrom202.155.6.42:icmp_seq=4ttl=64time=0.089ms
64bytesfrom202.155.6.42:icmp_seq=5ttl=64time=0.084ms
64bytesfrom202.155.6.42:icmp_seq=6ttl=64time=0.088ms
InstalasiApache2
Downloadpakethttpd2.0.54.tar.gzdarihttp://apache.org.
Downloadpatchzlibdarihttp://smithii.com/files/httpd2.0.54_zlib1.2.2.patch
Downloadpatchopenssldarihttp://smithii.com/files/httpd2.0.54_openssl0.9.8.patch
Bukapakettarbalnya.
#tarzxvfhttpd2.0.54.tar.gz
#patchp0<httpd2.0.54_zlib1.2.2.patch
#patchp0<files/httpd2.0.54_openssl0.9.8.patch
#useraddd/usr/local/httpdapache
#cdhttpd2.0.54
#./configureprefix=/usr/local/httpd\
enableaccess=sharedenableauth=sharedenableauthdbm=shared\
enableauthdigest=sharedenablefilecache=shared\
enableecho=sharedenablecache=sharedenablediskcache=shared\
enablememcache=sharedenablecasefilter=sharedenablecasefilterin=shared\
enableextfilter=sharedenabledeflate=shared\
enablelogconfig=sharedenablelogforensic=sharedenablelogio=shared\
enablemimemagic=sharedenablecernmeta=sharedenableexpires=shared\
enableheaders=sharedenableusertrack=sharedenableuniqueid=shared\
enableproxy=sharedenableproxyconnect=sharedenableproxyftp=shared\
enableproxyhttp=sharedenablessl=sharedenableoptionalhookexport=shared\
enableoptionalhookimport=sharedenableoptionalfnimport=shared\
enableoptionalfnexport=sharedenablebucketeer=sharedenablestaticsupport=shared\
enablestatichtpasswd=sharedenablestatichtdigest=shared\
enablestaticrotatelogs=sharedenablestaticlogresolve=shared\
enablestatichtdbm=sharedenablestaticab=sharedenablestaticcheckgid=shared\
enabledav=sharedenableinfo=sharedenablesuexec=shared\
enablecgi=sharedenablecgid=sharedenabledavfs=sharedenablevhostalias=shared\
enabledir=sharedenableimap=sharedenableactions=shared\
enableuserdir=sharedenablespeling=sharedenablealias=shared\
enablerewrite=sharedenableso
#make
#makeinstall
Editfile/usr/local/httpd/conf/httpd.conf
#vi/usr/local/httpd/conf/httpd.conf
Caribaris
User#1
Group#1
ServerAdminroot@localhost
Ubahmenjadi
Userapache
Groupapache
ServerAdminjoko@excellent.com
Buatfileinitscriptuntuservicehttpd
# vi /etc/rc.d/init.d/httpd
#!/bin/bash
#
# httpd
Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
#
HTML files and CGI.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi
# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""
# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/httpd/bin/apachectl
httpd=${HTTPD-/usr/local/httpd/bin/httpd}
prog=httpd
OPTIONS=
pidfile=${PIDFILE-/var/run/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0
# check for 1.3 configuration
check13 () {
CONFFILE=/usr/local/httpd/conf/httpd.conf
GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
GONE="${GONE}AccessConfig|ResourceConfig)"
if LANG=C grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
echo
echo 1>&2 " Apache 1.3 configuration directives found"
echo 1>&2 " please read /usr/share/doc/httpd2.0.54/migration.html"
failure "Apache 1.3 config directives test"
echo
exit 1
fi
}
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure. So we just do it the way init
scripts
# are expected to behave here.
start() {
echo -n $"Starting $prog: "
check13 || exit 1
LANG=$HTTPD_LANG daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
echo -n $"Reloading $prog: "
if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
RETVAL=$?
echo $"not reloading due to configuration syntax error"
failure $"not reloading $httpd due to configuration syntax error"
else
killproc $httpd -HUP
RETVAL=$?
fi
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|
fullstatus|graceful|help|configtest}"
exit 1
esac
exit $RETVAL
Ubahinitscritphttpdmenjadiexecutable
# chmod 755 /etc/rc.d/init.d/httpd
Buatrunlevelhttpdsebagaiservice
#chkconfig --add httpd
AgarservicehttpddijalankansaatsystemLinuxbooting,hidupkanrunlevelnya
#chkconfig httpd on
Jalakanservicehttpd/apache.
#servicehttpdstart
Pastikanhttpdsudahberkerjadenganbaik.
#psax|grephttpd
30138?Ss0:00/usr/local/httpd/bin/httpd
30139?S0:00/usr/local/httpd/bin/httpd
30140?S0:00/usr/local/httpd/bin/httpd
30141?S0:00/usr/local/httpd/bin/httpd
30142?S0:00/usr/local/httpd/bin/httpd
#netstattapn
tcp000.0.0.0:800.0.0.0:*LISTEN30205/httpd
Gunakanwebbrowseruntukmembukahttp://excellent.com
JikainginmenjalankandaemonApacheyangmendukungSSL,buatlahfilesertifikatSSL
nya.
#servicehttpdstop
#opensslgenrsaout/usr/local/httpd/conf/excellent.com.key1024
#opensslreqnewkey\
/usr/local/httpd/conf/excellent.com.key\
out/usr/local/httpd/conf/excellent.com.csr
CountryName(2lettercode)[AU]:ID
StateorProvinceName(fullname)[SomeState]:DKIJakarta
LocalityName(eg,city)[]:Jakarta
OrganizationName(eg,company)[InternetWidgitsPtyLtd]:Internet
Provider
OrganizationalUnitName(eg,section)[]:TechnicalSupport
CommonName(eg,YOURname)[]:ritek.excellent.com
EmailAddress[]:joko@cakraweb.com
Achallengepassword[]:jokobodho
Anoptionalcompanyname[]:
#opensslx509reqin/usr/local/httpd/conf/excellent.com.csr\
out/usr/local/httpd/conf/excellent.com.crt\
signkey/usr/local/httpd/conf/excellent.com.key
Editfile/usr/local/httpd/conf/ssl.conf
#vi/usr/local/httpd/conf/ssl.conf
Caribarisberikut.
SSLCertificateFile/usr/local/httpd/conf/
SSLCertificateKeyFile/usr/local/httpd/conf/
Ubahmenjadi
SSLCertificateFile/usr/local/httpd/conf/excellent.com.crt
SSLCertificateKeyFile/usr/local/httpd/conf/excellent.com.key
Editfile/etc/rc.d/init.d/httpd
# vi / etc/rc.d/init.d/httpd
Caribarisberikut.
OPTIONS=
Ubahmenjadi.
OPTIONS=-DSSL
Jalankanservicehttpd/apachedengandukunganSSL.
#servicehttpdstart
#psax|grephttpd
30270?Ss0:00/usr/local/httpd/bin/httpdDSSL
30271?S0:00/usr/local/httpd/bin/httpdDSSL
30272?S0:00/usr/local/httpd/bin/httpdDSSL
30273?S0:00/usr/local/httpd/bin/httpdDSSL
30274?S0:00/usr/local/httpd/bin/httpdDSSL
#netstattapn
tcp000.0.0.0:800.0.0.0:*LISTEN30288/httpd
tcp000.0.0.0:4430.0.0.0:*LISTEN30288/httpd
Gunakanwebbrowseruntukmembukahttps://excellent.com
MembuatVirtualHost
VirtualHostyangakankitabuatyaitu:
jokowardono.netdenganDocumentRoot/home/joko/public_html
idawiyanti.web.iddenganDocumentRoot/home/ida/public_html
athenatiffany.comdenganDocumentRoot/home/athena/public_html
ridwannurcholis.or.iddenganDocumentRoot/home/rio/public_html
Pastikanbahwauserjoko,ida,athena,danriosudahadadidalamsistemLinux.
ContohmemastikanbahwauserjokosudahadadalamsistemLinux,
#grepjoko/etc/passwd
joko:x:501:501:JokoWardono:/home/joko:/bin/bash
DariperintahdiatasterlihatbahwauserjokosudahadadalamsistemLinux,denganuid
501danhomedir/home/joko.
Agardisetiaphomedirektoridariuseryangdibuatterdapatdirektoripublic_htmlsecara
otomatis,tambahkandirektoritersebutkedalamdirektori/etc/skel
# mkdir /etc/skel/public_html
Tambahkanjugadirektoricgi-bin, logs,danstat.
# mkdir /etc/skel/cgi-bin
# mkdir /etc/skel/logs
# mkdir /etc/skel/stat
Contohmenambahuserida,
#useraddcIdaWiyantiida
#passwdida
Changingpasswordforuserida.
NewUNIXpassword:<isikanpassowrdnya>
RetypenewUNIXpassword:<isikanpasswordnya>
passwd:allauthenticationtokensupdatedsuccessfully.
TambahkankeempatdomainvirtualhostdiataskedalamkonfigurasiBIND.Editfile
/etc/named.conf.
#vi/etc/named.conf
Diakhirbaris,tambahkankonfigurasiberikutini.
zone"jokowardono.net"IN{
typemaster;
file"jokowardono.net";
allowupdate{none;};
};
zone"idawiyanti.web.id"IN{
typemaster;
file"idawiyanti.web.id";
allowupdate{none;};
};
zone"athenatiffany.com"IN{
typemaster;
file"athenatiffany.com";
allowupdate{none;};
};
zone"ridwannurcholis.or.id"IN{
typemaster;
file"ridwannurcholis.or.id";
allowupdate{none;};
};
Buatfiledatabasebinduntukmasingmasingdomain.
#vi/var/named/jokowardono.net
Berikutinikonfigurasiuntukjokowardono.net.
$TTL86400
$ORIGINjokowardono.net.
@INSOAjokowardono.net.joko.jokowardono.net.
(
200412302;Serial
28800;Refresh
14400;Retry
3600000;Expire
86400);Minimal
INNSritek.excellent.com.
INMX10mail.jokowardono.net.
INA202.155.6.42
wwwINCNAME@
ftpINCNAME@
mailINCNAME@
Berikutini,contohkonfigurasiuntukidawiyanti.web.id
#vi/var/named/idawiyanti.web.id
$TTL86400
$ORIGINidawiyanti.web.id.
@INSOAidawiyanti.web.id.ida.ida
wiyanti.web.id.(
200412303;Serial
28800;Refresh
14400;Retry
3600000;Expire
86400);Minimal
INNSritek.excellent.com.
INMX10mail.idawiyanti.web.id.
INA202.155.6.42
wwwINCNAME@
ftpINCNAME@
mailINCNAME@
Untukkonfigurasiathenatiffany.comdanridwannurcholis.or.idhampirsama
dengankonfigurasidiatas.KhususuntukSerial,bedakandeganmenggantiangka
belakangnya.
RestartdaemonBIND.
#rndcreload
serverreloadsuccessful
Ujidomainyangsudahdibuat.
#pingidawiyanti.web.id
PINGidawiyanti.web.id(202.155.6.42)56(84)bytesofdata.
64bytesfrom202.155.6.42:icmp_seq=1ttl=64time=0.116ms
64bytesfrom202.155.6.42:icmp_seq=2ttl=64time=0.091ms
64bytesfrom202.155.6.42:icmp_seq=3ttl=64time=0.119ms
64bytesfrom202.155.6.42:icmp_seq=4ttl=64time=0.084ms
#pingathenatiffany.com
PINGathenatiffany.com(202.155.6.42)56(84)bytesofdata.
64bytesfrom202.155.6.42:icmp_seq=1ttl=64time=0.090ms
64bytesfrom202.155.6.42:icmp_seq=2ttl=64time=0.090ms
64bytesfrom202.155.6.42:icmp_seq=3ttl=64time=0.091ms
#pingridwannurcholis.or.id
PINGridwannurcholis.or.id(202.155.6.42)56(84)bytesofdata.
64bytesfrom202.155.6.42:icmp_seq=1ttl=64time=0.117ms
64bytesfrom202.155.6.42:icmp_seq=2ttl=64time=0.078ms
64bytesfrom202.155.6.42:icmp_seq=3ttl=64time=0.080ms
Editfile/usr/local/httpd/conf/httpd.conf,dantambahkandirektifberikutdiakhir
baris.
NameVirtualHost 202.155.6.42:80
Buatfilekonfigurasivirtualhostuntukkeempatdomaindiatas.
#vi/usr/local/httpd/conf/joko.conf
<VirtualHostjokowardono.net>
ServerNamejokowardono.net
ServerAliasjokowardono.netwww.jokowardono.net
DocumentRoot/home/joko/public_html
ServerAdminjoko@jokowardono.net
ErrorLog/home/joko/logs/error.log
CustomLog/home/joko/logs/access.logcommon
</VirtualHost>
Buatdirektoridirektoriyangdibutuhkanolehvirtualhostjokowardono.netdihomedir
joko.
#mkdir~joko/public_html
#mkdir~joko/logs
#mkdir~joko/cgibin
#chownjoko.joko~joko/public_html
#chownjoko.joko~joko/logs
#chownjoko.joko~joko/cgibin
#vi/usr/local/httpd/conf/ida.conf
<VirtualHostidawiyanti.web.id>
ServerNameidawiyanti.web.id
ServerAliasidawiyanti.web.idwww.idawiyanti.web.id
DocumentRoot/home/ida/public_html
ServerAdminida@idawiyanti.web.id
ErrorLog/home/ida/logs/error.log
CustomLog/home/ida/logs/access.logcommon
</VirtualHost>
Buatdirektoridirektoriyangdibutuhkanolehvirtualhostidawiyanti.web.iddihomedir
ida.
#mkdir~ida/public_html
#mkdir~ida/logs
#mkdir~ida/cgibin
#chownida.ida~joko/public_html
#chownida.ida~joko/logs
#chownida.ida~joko/cgibin
Dengancarayangsama,buatlahfile/usr/local/httpd/conf/athena.confdan
/usr/local/httpd/conf/rio.confuntukvirtualhostathenatiffany.comdanridwan
nurcholis.or.id
Editfile/usr/local/httpd/conf/httpd.conf,danincludekankonfigurasidiatasdiakhir
baris.
include
include
include
include
conf/joko.conf
conf/ida.conf
conf/athena.conf
conf/rio.conf
Buatfileindex.htmldimasingmasinghomedir.
#echo<center><h1><fontcolor=\#0000FF\>\
jokowardono.net</font></h1></center>>~joko/public_html/index.html
#echo<center><h1><fontcolor=\#0000FF\>\
idawiyanti.web.id</font></h1></center>>~ida/public_html/index.html
#echo<center><h1><fontcolor=\#0000FF\>\
athenatiffany.com</font></h1></center>>~athena/public_html/index.html
#echo<center><h1><fontcolor=\#0000FF\>\
ridwannurcholis.or.id</font></h1></center>>~rio/public_html/index.html
#chownjoko.joko~joko/*
#chownida.ida~ida/*
#chownathena.athena~athena/*
#chownrio.rio~rio/*
Berikanpermisianexecutableuntukketigahomedirektoridiatas.
#chmod711/home/{joko,ida,athena,rio}
Restartservicehttpd/apache.
#servicehttpdrestart
Bukawebbrowseruntukmencobamasingmasingdomain.
InstalasiMySQL
#useraddd/usr/local/mysqls/bin/falsemysql
#tarzxvfmysqlstandard5.0.2alphapclinuxi686.tar.gz
#cdmysqlstandard5.0.2alphapclinuxi686/
#cpR*/usr/local/mysql/
#useraddd/usr/local/mysqls/sbin/nologinmysql
#cd/usr/local/mysql
#chownRroot.
#chownRmysqldata
#chgrpRmysql.
#scripts/mysql_install_dbuser=mysql
#cpsupportfiles/mylarge.cnf/etc/my.cnf
Editfile/etc/my.cnf
#vi/etc/my.cnf
Caribarisberikut:
#skipnetworking
Hapustanda#sehinggaberisdiatasmenjadi:
skipnetworking
#cpsupportfiles/mysql.server/etc/rc.d/init.d/mysql
#chkconfigaddmysql
#chkconfigmysqlon
#servicemysqlstart
Pastikanbahwamysqlsudahberjalandenganbaik.
#psax|grepmysql
3574?S0:00/bin/sh./bin/mysqld_safedatadir=/usr/local/mysql/datapid
file=/usr/local/mysql/data/ritek.excellent.com.pid
3619?S0:00/usr/local/mysql/bin/mysqlddefaultsextra
file=/usr/local/mysql/data/my.cnfbasedir=/usr/local/mysqldatadir=/usr/local/mysql/data
user=mysqlpidfile=/usr/local/mysql/data/ritek.excellent.com.pidskiplocking
port=3306socket=/tmp/mysql.sock
TambahkanenvironmentpathuntukpaketMySQL.
#PATH=$PATH:/usr/local/mysql/bin
AgarenvironmentpathMySQLdijalankansaatuserlogin,editfile/etc/profile
#vi/etc/profile
Tambahkanbarisberikutdiakhirbarisdarifile/etc/profile
PATH=$PATH:/usr/local/mysql/bin
Berikanpassworduntukuserrootloginmysqlserver.
#mysqladminurootpassword'passwordnya'
Loginkeservermysqldenganuserroot.
#mysqlurootp
password:
WelcometotheMySQLmonitor.Commandsendwith;or\g.
YourMySQLconnectionidis3toserverversion:5.0.2alphastandardlog
Type'help;'or'\h'forhelp.Type'\c'toclearthebuffer.
mysql>
Setelahberhasilloginkeservermysql,hapususeruserdanpasswordpasswordyangkosong
padatabeluser.
mysql>usemysql;
mysql>deletefromuserwhereuser=''orpassword='';
mysql>flushprivileges;
Pastikanbahwahanyaadasatuuser,yaituroot,dengankontrolaksesdarilocalhost.
mysql>selecthost,user,passwordfromuser;
++++
|host|user|password|
++++
|localhost|root|*9455182373A91C5FFDD76D4D59A51F171EF710D2|
++++
1rowinset(0.09sec)
mysql>quit;
InstalasiPostgreSQL
DownloadpakettarbalPostgreSQLdarihttp://developer.postgres.org.
Bukapakettarbalnya.
#tarzxvfpostgresql8.0.0rc4.tar.gz
#useraddd/usr/local/pgsqlpostgres
#cdpostgresql8.0.0rc4
#./configurewithperlwithpythonwithctlwithopensslwith
pam
#gmake
#gmakecheck
#gmakeinstall
#mkdir/usr/local/pgsql/data
#chownpostgres.postgres/usr/local/pgsql/data
Editfile/etc/ld.so.conf,dantambahkanbarisberikut.
/usr/local/pgsql/lib
Terapkankonfigurasildconfig.
#ldconfig
Editfile/etc/profile,dantambahkanbarisberikut.
PATH=$PATH:/usr/local/pgsql/bin
#supostgres
$/usr/local/pgsql/bin/initdbD/usr/local/pgsql/data
$exit
#cpcontrib/startscripts/linux/etc/rc.d/init.d/postgresql
#chkconfigaddpostgresql
#chkconfigpostgresqlon
#servicepostgresqlstart
#psax|greppostgres
16229?S0:00postgres:writerprocess
16230?S0:00postgres:statsbufferprocess
16231?S0:00postgres:statscollectorprocess
Memberipasswordloginpostgres.
#supostgres
$psqldtemplate1
Welcometopsql8.0.0rc4,thePostgreSQLinteractiveterminal.
Type:\copyrightfordistributionterms
\hforhelpwithSQLcommands
\?forhelpwithpsqlcommands
\gorterminatewithsemicolontoexecutequery
\qtoquit
template1=#ALTERUSERpostgresWITHpassword'passwordnya';
ALTERUSER
template1=#\q
$exit
Editfile/usr/local/pgsql/data/pg_hba.conf,sehinggamenjadiserpertiberikut.
localallallpassword
#IPv4localconnections:
hostallall127.0.0.1/32password
#IPv6localconnections:
hostallall::1/128password
#psqlUpostgresdtemplate1
password:<isikanpassword>
Welcometopsql8.0.0rc4,thePostgreSQLinteractiveterminal.
Type:\copyrightfordistributionterms
\hforhelpwithSQLcommands
\?forhelpwithpsqlcommands
\gorterminatewithsemicolontoexecutequery
\qtoquit
template1=#\q
SampaidisiniberartiserverdatabasePostgresSQLsudahbekerjadenganbaik.
InstalasiInterbase
DownloadpaketInterbaseSuperServer(InterBaseSS_LIV6.01.i386.rpm)dari
http://rpmseek.com.
# rpm ivh InterBaseSS_LI-V6.0-1.i386.rpm
Preparing...
########################################### [100%]
1:InterBaseSS_LI
########################################### [100%]
HasilinstalasiInterbaseadadi/opt/interbase
# ls al /opt
total 12
drwxr-xr-x
3 root
drwxr-xr-x
21 root
drwxr-xr-x
10 root
root
root
root
Buatsymboliclinkdi/usr
#
#
#
#
cd
ln
cd
ln
/usr
s /opt/interbase interbase
/usr/include
s /opt/interbase/include/ib_util.h ib_util.h
Createuserinterbaseuntukmenjalankanservicedatabaseinterbase.
# useradd d /opt/interbase m k /dev/null interbase
Jalankanserverinterbase
# /opt/interbase/bin/ibmgr start forever &
LoginkeserverdatabasedenganuserSYSDBApasswordmasterkey
# cd /opt/interbase
# bin/gsec user SYSDBA password masterkey
GantipassworduserSYSDBA
gsec> modify SYSDBA pw passwordnya
gsec> quit
Buatinitscriptnya
# vi /etc/rc.d/init.d/interbase
#!/bin/sh
#
#
#
#
#
#
chkconfig: 345 20 80
description: Start/Stop interbase database server
This file belongs in /etc/init.d where it will be run
on system startup and shutdown to start the background
Firebird/interbase database server daemon
stop)
killproc ibserver
RETVAL=$?
#
echo
#
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/identd
;;
status)
status ibserver
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: interbase {start|stop|status|restart|reload}"
exit 1
esac
exit $RETVAL
Simpanscriptdiatasdengan:wq
# chmod 755 /etc/rc.d/init.d/interbase
# chkconfig add interbase
# chkconfig interbase on
Matikanserverinterbasedanjalaninitscriptnya
# killall -9 ibguard
# killall -9 ibserver
# service interbase start
InstalasiPHP
KompilasiImap
#gunzipimap2004g.tar.Z
#tarxfimap200g.tar
#cpRimap2004g/usr/local/.
#chownRroot.root/usr/local/imap2004g
#cd/usr/local/imap2004g
#makeslxSSLTYPE=nopwd
#lnscclientinclude
#mkdirlib
#cdlib
#lns../cclient/cclient.alibcclient.a
#cdsource/PHP/path
#tarxjfphp5.0.3.tar.bz2
#cdphp5.0.3
#./configureprefix=/usr/localsysconfdir=/etcwithmod_charset\
withapxs2=/usr/local/httpd/bin/apxs\
withapxs2filter=/usr/local/httpd/bin/apxs\
enableforcecgiredirectenablediscardpath\
enablefastcgienablelibgcc\
withxmlwithlibxml=/usr/include/libxml2/libxml/withopenssl\
withzlibwithbz2enablecalendarwithjpegdir=/usr/lib\
withtiffwithgdbm=/usr/includewithcurl=/usr/include\
withdb4=/usr/include/db4withinifilewithflatfile\
enabledbaenabledbaseenabledbxenabledio\
enableexifenablebcmathenablefileproenableftp\
withgddir=/usr/libwithpngdir=/usr/libwithxpmdir=/usr/lib\
withfreetypedir=/usr/include/freetype2/freetype\
enablegdnativettfenablegdjisconvwithgettext\
withimap=/usr/local/imap2004gwithkerberos\
withimapssl=/usr/local/imap2004g\
withinterbase=/usr/includeenabletrackvars\
withmysql=/usr/include/mysqlwithmysqlsock\
withncurses=/usr/include/ncursesenablepcntl\
withpgsql=/usr/include/pgsqlwithreadline=/usr/include/readline\
enablesoapenablesocketswithpearenablemaintainerzts\
enablememorylimitenablezendmultibytewithmimemagic
#make
#makeinstall
#cpphp.inirecommended/usr/local/lib/php.ini
#vi/usr/local/lib/php.ini
Cariparamater
register_globals,ubahnilaiOffmenjadiOn.
magic_quotes_gpc,ubahnilaiOffmenjadiOn.
Editfilehttpd.conf
#vi/usr/local/httpd/conf/httpd.conf
Tambahkandirektifberikutini.
LoadModulephp5_modulemodules/libphp5.so
DirectoryIndexindex.htmlindex.html.varindex.php
AddTypeapplication/xhttpdphp.php.php3.phtml
AddTypeapplication/xhttpdphpsource.phps
Restartapache
#servicehttpdrestart
Buatfileinfo.phpdipublic_htmldarijokowardono.net
#cd~joko/public_html
#echo<?phpinfo();?>>info.php
#chownjoko.joko~joko/public_html/info.php
Jalankanbrowserdanbrowsingkehttp://jokowardono.net/info.php
Instalasimod_perlApache
Downloadpaketmod_perl-2.0-current.tar.gz
#
#
#
#
#
tar zxfmod_perl-2.0-current.tar.gz
cd mod_perl-2.0.0-RC4/
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make && make test
make install
Pastikanmod_perl.sosudahadadi/usr/local/httpd/modules
# ls /usr/local/httpd/modules/mod_perl.so
Editfilekonfigurasiapache.
# vi /usr/local/httpd/conf/httpd.conf
Tambahkanbarisberikutuntukmengaktifkanmodulperl.
LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
Jalankanulangserverapache.
# service httpd restart
InstalasiPostfix
Paketpostfixdalambentuktarbal,sudahbisakitainstalldisistemLinux.Hanyasaja
kompilasidasaryangadapadapaketPostfixtersebutadalahstandard.AgarPostfixyangakan
kitagunakan,nantinyasupportdenganmysql,makakitaperlumengkompilasiulangpaket
Postfixdaripakettarbalnya.Olehkarenaitu,kitasiapkanpaketkompilasidatabaseyaitu:
db11.8510mdk.i586.rpm
db1devel1.8510mdk.i586.rpm
KeduapaketdiatasdisesuaikandengandistroLinuxyangkitagunakan.Sebagaicontoh,
disinikitamenggunakanpaketMandrake10.1.
JikakitamenggunakandistroLinuxselainMandrake10.1,kitabisamendapatkankeduapaket
tersebutpadaCDdistribusi,ataudownloaddihttp://rpmseek.com.
#rpmivhdb11.8510mdk.i586.rpm
#rpmivhdb1devel1.8510mdk.i586.rpm
Jikakitakitatidakmenyiapkanpaketdiatas,padasaatkompilasiPostfixakantampilerror
sepertiberikut.
No<db.h>includefilefound.
Installtheappropriatedb*develpackagefirst.
SeetheRELEASE_NOTESfileformoreinformation.
make:***[Makefile]Error1
make:***[Makefiles]Error1
make:***[makefiles]Error2
Setelahpaketkompilasidatabasesudahsiap,kitabisalanjutkankompilasiPostfix.
#tarzxvfpostfix2.1.5.tar.gz
#cdpostfix2.1
#groupaddpostdrop
#useraddcUserSystemPostfix\
d/dev/nullGpostdroppostfix
#mkdir/etc/postfix
#lns/usr/local/mysql/include/usr/include/mysql
#lns/usr/local/mysql/lib/usr/lib/mysql
#lns/usr/include/db1/db.h/usr/include/db.h(jikabelumada)
#lns/usr/lib/libdbso.2/usr/lib/libdb.so(jikabelumada)
#makefMakefile.initmakefiles\
'CCARGS=DHAS_LDAPI/usr/include\
DHAS_MYSQLI/usr/include/mysql\
DHAS_PCREI/usr/include/pcre\
DHAS_PGSQLI/usr/include/pgsql\
DUSE_SASL_AUTHI/usr/include/sasl'\
'AUXLIBS=L/usr/liblldapL/usr/libllber\
L/usr/lib/mysqllmysqlclientlzlm\
L/usr/liblpcre\
L/usr/lib/pgsqllpq\
L/usr/lib/sasl2lsasl2'
#make
#makeinstall
Editfile/etc/postfix/main.cf
#vi/etc/postfix/main.cf
Berikutcontohkonfigurasi/etc/postfix/main.cf
daemon_directory=/usr/libexec/postfix
command_directory=/usr/sbin
mail_owner=postfix
myhostname=ritek.excellent.com
myorigin=$myhostname
inet_interfaces=$myhostname,localhost
mydestination=$myhostname,localhost
unknown_local_recipient_reject_code=550
mynetworks_style=host
mynetworks=202.155.6.42/24,127.0.0.0/8
relay_domains=$mydestination
alias_maps=hash:/etc/postfix/aliases
alias_database=hash:/etc/postfix/aliases
recipient_delimiter=+
home_mailbox=Maildir/
mail_spool_directory=/var/spool/mail
smtpd_banner=$myhostnameESMTP$mail_name($mail_version)
debug_peer_level=2
debugger_command=
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb$daemon_directory/$process_name$process_id&sleep5
sendmail_path=/usr/sbin/sendmail
newaliases_path=/usr/bin/newaliases
mailq_path=/usr/bin/mailq
setgid_group=postdrop
html_directory=no
manpage_directory=/usr/local/man
sample_directory=/etc/postfix
readme_directory=no
maps_rbl_domains=relays.ordb.org
smtpd_helo_restrictions=reject_maps_rbl,permit_mynetworks
smtpd_sender_restrictions=reject_unknown_sender_domain
Editfile/etc/postfix/aliases
#vi/etc/postfix/aliases
Isikanbarisberikut.
MAILERDAEMON:postmaster
postmaster:root
Buatdatabasealiases
#postmasp/etc/postfix/aliases
JalankanPostfix.
#postfixstart
postfix/postfixscript:startingthePostfixmailsystem
Untukmelihatloggingdaripostfix,bukafile/var/log/mail/errors,
/var/log/mail/info,/var/log/mail/warnings.
/var/log/mail/errorsmenyimpaninformasikesalahandarikinerjaPostfix.
/var/log/mail/infomenyimpaninformasiproseskinerjaPostfix
/var/log/mail/warningsmenyimpaninformasiperingatandarikinerjaPostfix.
#tailf/var/log/mail/errors
#tailf/var/log/mail/info
#tailf/var/log/mail/warnings
Usahakantidakadapesanerrordanwarningpadafile/var/log/mail/errorsdan
/var/log/mail/warnings.Biasanyajikaadapesanerror,Postfixtidakbekerjasecarabaik.
Danjikaadapesanwarning,Postfixmasihbisabekerja,tetapitidakmaksimal.
Jikaadapesanerroratauwarning,segeratelitipenyebabkesalahannyaatauperingatan
yangadapadakeduafilediatas.
JikaPostfixsudahbekerjadengannbaik,tibasaatnyauntukmencobanya.
Pastikanport25listen.
#netstattapn
tcp00127.0.0.1:250.0.0.0:*LISTEN14313/master
Pengujianpengirimanemail.
#telnetlocalhost25
Trying127.0.0.1...
Connectedtoritek.excellent.com(127.0.0.1).
Escapecharacteris'^]'.
220ritek.excellent.comESMTPPostfix(2.1.5)
heloritek
250ritek.excellent.com
mailfrom:joko@ritek.excellent.com
250Ok
rcptto:joko@ritek.excellent.com
250Ok
data
354Enddatawith<CR><LF>.<CR><LF>
Subject:testaja
Inipesanpercobaan
.
250Ok:queuedas4EDEC1F198
quit
221Bye
Connectionclosedbyforeignhost.
Perintahdiatasartinyakitamengirimemaildarijoko@ritek.excellent.comkedirinya
sendiri,denganSubjecttestsajadanpesannyaInipesanpercobaan.
Jikaprosespengrimanberhasil,makadihomedirdariuserjoko,akanterdapatdirektori
Maildir.DandidalamdirektoriMaildirtersebutterdapattigasubdirektoriyaitucur,new,
dantmp.
Subdirektorinewmenyimpanemailyangbarumasuk.
Subdirektoricurmenyimpanemailyangsudahpernahdibuka.
Subdirektoritmpmenyimpanemaildraft,trashdanyangsudahterkirim.
Olehkarenakitasudahmelakukanpengirimanemailkejoko@ritek.excellent.com,untuk
memastikanbahwaemailtersebutsampai,lihatisisubdirektori~joko/Maildir/new.
#ls~joko/Maildir/new
1104951536.V307I580f.ritek.excellent.com
#cat~joko/Maildir/new/1104951536.V307I580f.ritek.excellent.com
ReturnPath:<joko@ritek.excellent.com>
XOriginalTo:joko@ritek.excellent.com
DeliveredTo:joko@ritek.excellent.com
Received:fromritek(ritek.excellent.com[127.0.0.1])
byritek.excellent.com(Postfix)withSMTPid4EDEC1F198
for<joko@ritek.excellent.com>;Wed,5Jan200513:58:110500
(EST)
Subject:testaja
MessageId:<20050105185811.4EDEC1F198@ritek.excellent.com>
Date:Wed,5Jan200513:58:110500(EST)
From:joko@ritek.excellent.com
To:undisclosedrecipients:;
Inipesanpercobaan
DarihasilpengujiandiatasmenyatakanSMTPserver(Postfix)sudahbekerjadanganbaik.
AgarPostfixdijalankansaatsistemLinuxbooting,editfile/etc/rc.local
#vi/etc/rc.local
Tambahkanberisberikut.
/usr/sbin/postfixstart
Selanjutnyakitaakanmembuatkonfigurasiuservirtualuntuksetiapdomain.
Buatlahdirektori/home/virtual.Semuaemailsetiapdomainakandisimpandalamdirektori
ini.Olehkarenaitu,Andabisamenggunakanruangharddiskyangsekiranyamencukupi
untukmenyimpanemailemailtersebut(tidakharusdi/home/virtual).
#mkdir/home/virtual
Berikanhakaksesread/writeuntukuserdangroupPostfix.
#chownRpostfix.postfix/home/virtual
#chmodR664/home/virtual
KonfigurasivirtualuserdenganMySQL
Konfigurasidatabase:
#mysqlurootp
password:<isikanpasswordnya>
Membuatuserpostfixdanpostfixadmin
mysql>USEmysql;
mysql>INSERTINTOuser(Host,User,Password)VALUES
('localhost','postfix',password('postfix'));
mysql>INSERTINTOdb(Host,Db,User,Select_priv)VALUES
('localhost','postfix','postfix','Y');
mysql>INSERTINTOuser(Host,User,Password)VALUES
('localhost','postfixadmin',password('postfixadmin'));
mysql>INSERTINTOdb(Host,Db,User,Select_priv,Insert_priv,
Update_priv,Delete_priv)VALUES('localhost','postfix','postfixadmin',
'Y','Y','Y','Y');
mysql>FLUSHPRIVILEGES;
Memberikanhakaksesuserpostfixdanpostfixadminkedatabasepostfix.
mysql>GRANTUSAGEONpostfix.*TOpostfix@localhost;
mysql>GRANTSELECT,INSERT,DELETE,UPDATEONpostfix.*TO
postfix@localhost;
mysql>GRANTUSAGEONpostfix.*TOpostfixadmin@localhost;
mysql>GRANTSELECT,INSERT,DELETE,UPDATEONpostfix.*TO
postfixadmin@localhost;
Membuatdatabasepostfix.
mysql>CREATEDATABASEpostfix;
mysql>USEpostfix;
Membuattabeladmin.
mysql>CREATETABLEadmin(
usernamevarchar(255)NOTNULLdefault'',
passwordvarchar(255)NOTNULLdefault'',
createddatetimeNOTNULLdefault'0000000000:00:00',
modifieddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
PRIMARYKEY(username),
KEYusername(username)
)TYPE=MyISAMCOMMENT='PostfixAdminVirtualAdmins';
Membuattabelalias.
mysql>CREATETABLEalias(
addressvarchar(255)NOTNULLdefault'',
forwardtotextNOTNULL,
domainvarchar(255)NOTNULLdefault'',
createddatetimeNOTNULLdefault'0000000000:00:00',
modifieddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
PRIMARYKEY(address),
KEYaddress(address)
)TYPE=MyISAMCOMMENT='PostfixAdminVirtualAliases';
Membuattabeldomain.
mysql>CREATETABLEdomain(
domainvarchar(255)NOTNULLdefault'',
descriptionvarchar(255)NOTNULLdefault'',
aliasesint(10)NOTNULLdefault'0',
mailboxesint(10)NOTNULLdefault'0',
maxquotaint(10)NOTNULLdefault'0',
transportvarchar(255)defaultNULL,
backupmxtinyint(1)NOTNULLdefault'0',
createddatetimeNOTNULLdefault'0000000000:00:00',
modifieddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
PRIMARYKEY(domain),
KEYdomain(domain)
)TYPE=MyISAMCOMMENT='PostfixAdminVirtualDomains';
Membuattabeldomain_admins
mysql>CREATETABLEdomain_admins(
usernamevarchar(255)NOTNULLdefault'',
domainvarchar(255)NOTNULLdefault'',
createddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
KEYusername(username)
)TYPE=MyISAMCOMMENT='PostfixAdminDomainAdmins';
Membuattabellog.
mysql>CREATETABLElog(
timestampdatetimeNOTNULLdefault'0000000000:00:00',
usernamevarchar(255)NOTNULLdefault'',
domainvarchar(255)NOTNULLdefault'',
actionvarchar(255)NOTNULLdefault'',
datavarchar(255)NOTNULLdefault'',
KEYtimestamp(timestamp)
)TYPE=MyISAMCOMMENT='PostfixAdminLog';
Membuattabelmailbox
mysql>CREATETABLEmailbox(
usernamevarchar(255)NOTNULLdefault'',
passwordvarchar(255)NOTNULLdefault'',
namevarchar(255)NOTNULLdefault'',
maildirvarchar(255)NOTNULLdefault'',
quotaint(10)NOTNULLdefault'0',
domainvarchar(255)NOTNULLdefault'',
createddatetimeNOTNULLdefault'0000000000:00:00',
modifieddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
PRIMARYKEY(username),
KEYusername(username)
)TYPE=MyISAMCOMMENT='PostfixAdminVirtualMailboxes';
Membuattabelvacation
mysql>CREATETABLEvacation(
emailvarchar(255)NOTNULLdefault'',
subjectvarchar(255)NOTNULLdefault'',
bodytextNOTNULL,
cachetextNOTNULL,
domainvarchar(255)NOTNULLdefault'',
createddatetimeNOTNULLdefault'0000000000:00:00',
activetinyint(1)NOTNULLdefault'1',
PRIMARYKEY(email),
KEYemail(email)
)TYPE=MyISAMCOMMENT='PostfixAdminVirtualVacation';
Konfigurasimain.cf
#vi/etc/postfix/main.cf
Tambahkanparameterberikutini.
relay_domains=proxy:mysql:/etc/postfix/mysql_relay_domains_maps.cf
virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql_mailbox_limit_maps.cf
virtual_mailbox_base=/home/virtual
virtul_create_maildirsize=yes
virtual_mailbox_extended=yes
virtual_mailbox_limit_override=yes
virtual_maildir_limit_messages=Sorry,theusermaildiroverdrawnhis
diskspacequota,pleasetryagainlater.
virtual_overquota_bounce=yes
virtual_transport=virtual
virtual_uid_maps=static:82
virtual_gid_maps=static:82
virtual_minimum_uid=82
82adalahiddariuserpostfix.Untukmengetahuiidpostfix,gunakanperintahberikut:
# id postfix
uid=82(postfix)gid=82(postfix)groups=85(postdrop)
Membuatfilefilekonfigurasivirtual.
#vi/etc/postfix/mysql_relay_domains_maps.cf
user=postfix
password=postfix
hosts=localhost
dbname=postfix
table=domain
select_field=domain
where_field=domain
additional_conditions=andbackupmx='1'
#vi/etc/postfix/mysql_virtual_alias_maps.cf
user=postfix
password=postfix
hosts=localhost
dbname=postfix
table=alias
select_field=forwardto
where_field=address
#vi/etc/postfix/mysql_virtual_domains_maps.cf
user=postfix
password=postfix
hosts=localhost
dbname=postfix
table=domain
select_field=description
where_field=domain
additional_conditions=andbackupmx='0'andactive='1'
#vi/etc/postfix/mysql_virtual_mailbox_maps.cf
user=postfix
password=postfix
hosts=localhost
dbname=postfix
table=mailbox
select_field=maildir
where_field=username
additional_conditions=andactive='1'
#vi/etc/postfix/mysql_mailbox_limit_maps.cf
user=postfix
password=postfix
hosts=localhost
dbname=postfix
table=mailbox
select_field=quota
where_field=username
additional_conditions=andactive='1'
InstalasiPostfixAdmin
DownloadpakettarbalPostfixAdmindarihttp://high5.net
Bukapakettarbalnya.
#tarxfpostfixadmin2.1.0.tgz
Copykanposfixadminke/usr/local/httpdmenjadmailadmin.
#cpRfpostfixadmin2.1.0/usr/local/httpd/mailadmin
#chownRroot.root/usr/local/httpd/mailadmin
Buatfilefile.htaccessdan.htpasswddi/usr/local/httpd/mailadmin/admin
#vi/usr/local/httpd/mailadmin/admin/.htaccess
Buatkonfigurasi.htaccesssepertidibawahini.
AuthUserFile/usr/local/httpd/mailadmin/admin/.htpasswd
AuthGroupFile/dev/null
AuthName"PostfixAdmin"
AuthTypeBasic
<limitGETPOST>
requirevaliduser
</limit>
MenambahAdmin
#/usr/local/httpd/bin/htpasswdc
/usr/local/httpd/mailadmin/admin/.htpasswdadmin
password:<misaldiisidenganpostfixadmin>
Editfile/usr/local/httpd/conf/httpd.conf
Buataliassepertidibawahini.
Alias/postfixadmin"/usr/local/httpd/mailadmin/"
<Directory"/usr/local/httpd/mailadmin">
AllowOverrideAuthConfig
OptionsMultiViewsIndexesFollowSymLinks
Orderallow,deny
Allowfromall
</Directory>
Membuatkonfigurasipostfixadmin.
#cp/usr/local/httpd/mailadmin/config.inc.php.sample
/usr/local/httpd/mailadmin/config.inc.php
#vi/usr/local/httpd/mailadmin/config.inc.php
Dibawahinicontohkonfigurasiuntukpostfixadmin.
<?php
if(ereg("config.inc.php",$_SERVER['PHP_SELF']))
{
header("Location:login.php");
exit;
}
$CONF['postfix_admin_url']=$_SERVER['SERVER_NAME'].'/postfixadmin';
$CONF['postfix_admin_path']='/usr/local/httpd/mailadmin';
$CONF['default_language']='en';
$CONF['database_type']='mysql';
$CONF['database_host']='localhost';
$CONF['database_user']='postfixadmin';
$CONF['database_password']='postfixadmin';
$CONF['database_name']='postfix';
$CONF['database_prefix']='';
$CONF['admin_email']='postmaster@'.$_SERVER['SERVER_NAME'];
$CONF['smtp_server']='localhost';
$CONF['smtp_port']='25';
$CONF['encrypt']='md5crypt';
$CONF['generate_password']='NO';
$CONF['page_size']='10';
$CONF['default_aliases']=array(
'abuse'=>'abuse@'.$_SERVER['SERVER_NAME'],
'hostmaster'=>'hostmaster@'.$_SERVER['SERVER_NAME'],
'postmaster'=>'postmaster@'.$_SERVER['SERVER_NAME'],
'webmaster'=>'webmaster@'.$_SERVER['SERVER_NAME']
);
$CONF['domain_path']='YES';
$CONF['domain_in_mailbox']='YES';
$CONF['aliases']='10';
$CONF['mailboxes']='10';
$CONF['maxquota']='10';
$CONF['quota']='YES';
$CONF['quota_multiplier']='1024000';
$CONF['transport']='NO';
$CONF['vacation']='NO';
$CONF['vacation_domain']=$_SERVER[SERVER_NAME];
$CONF['special_alias_control']='YES';
$CONF['logging']='YES';
$CONF['show_header_text']='YES';
$CONF['header_text']='::'.$_SERVER['SERVER_NAME'].'PostfixAdmin::';
$CONF['show_footer_text']='YES';
$CONF['footer_text']='Returnto'.$_SERVER['SERVER_NAME'];
$CONF['footer_link']='http://'.$_SERVER['SERVER_NAME'];
$CONF['welcome_text']=<<<EOM
Hi,
Welcometoyournewaccount.
EOM;
?>
RestartApache.
#servicehttpdrestart
Jalankanbrowserdanbukahttp://jokowardono.net/postfixadmin
Jikasudahtampilsepertigambardibawahini,berartipostfixadminsudahberjalandengan
baik.
Agarsetiapmembukahttp://jokowardono.net/postfixadmin,tidakmenampilkanhalaman
sepertigambardiatas,tetapimenampilkanhalamanlogin,hapusfilesetup.phpataudengan
menggantimenjadinamalain.
Selainitu,hapusjikafilemod_admin.txtdanmod_users.txtatauubahmenjadinamalain,
agartidakmenampilkaninformasitentangPostfixAdminyangtidakdiperlukan.
#mvsetup.phpsetup.php.orig
#mvmod_admin.txtmod_admin.txt.orig
#mvmod_users.txtmod_users.txt.orig
Untukmengaturvirtualdomaindanadmindomain,bukahttp://joko
wardono.net/postfixadmin/admin.Kemudianisikanuserdanpasswordyangsudahdibuat
padafile.htpasswddiatas.
Untukmengaturmailboxsuatuvirtualdomain,bukahttp://jokowardono.net/postfixadmin.
JikaAndasudahmenambahkandomainbarumaka,didalamdirektori/home/virtual
terdapatsubdirektorinamadomain.DanjikaAndasudahmenambahkanmailboxbaru,makadi
dalamsubdirektorinamadomainakanterdapatsubdirektorilagisesuaidengannamaaccount
emailnya.
#lsal/home/virtual
total48
drwxrwxrx6postfixpostfix4096Jan2414:08.
drwxrxrx9rootroot4096Jan2016:24..
drwx3postfixpostfix4096Jan2414:08athenatiffany.com
drwx3postfixpostfix4096Jan2414:07idawiyanti.web.id
drwx5postfixpostfix4096Jan2517:48jokowardono.net
drwx3postfixpostfix4096Jan2414:08ridwannurcholis.or.id
#lsal/home/virtual/jokowardono.net
total40
drwx5postfixpostfix4096Jan2517:48.
drwxrwxrx6postfixpostfix4096Jan2414:08..
drwx5postfixpostfix4096Jan2516:59joko@jokowardono.net
drwx5postfixpostfix4096Jan2517:48postmaster@jokowardono.net
drwx5postfixpostfix4096Jan2413:59wiwik@jokowardono.net
Kemudianlakukanpengirimanemailmelaluitelnet.
#telnetlocalhost25
Trying127.0.0.1...
Connectedtolocalhost.localdomain(127.0.0.1).
Escapecharacteris'^]'.
220ritek.excellent.comESMTPPostfix(2.1.5)
heloritek
250ritek.excellent.com
mailfrom:joko@jokowardono.net
250Ok
rcptto:wiwik@jokowardono.net
250Ok
data
354Enddatawith<CR><LF>.<CR><LF>
Subject:Apakabar
HaloBu...
Apakabarnya?
.
250Ok:queuedas0932212976E
quit
221Bye
Connectionclosedbyforeignhost.
Kemudianlihatvaillognya.
#tailf/var/log/maillog
Jan2517:58:05ritekpostfix/smtpd[16756]:connectfrom
ritek.excellent.com[127.0.0.1]
Jan2517:58:36ritekpostfix/smtpd[16756]:0932212976E:
client=ritek.excellent.com[127.0.0.1]
Jan2517:59:17ritekpostfix/cleanup[16759]:0932212976E:message
id=<20050125105822.0932212976E@ritek.excellent.com>
Jan2517:59:17ritekpostfix/qmgr[2825]:0932212976E:from=<joko@joko
wardono.net>,size=401,nrcpt=1(queueactive)
Jan2517:59:17ritekpostfix/virtual[16761]:0932212976E:to=<wiwik@joko
wardono.net>,relay=virtual,delay=55,status=sent(deliveredtomaildir)
Jan2517:59:17ritekpostfix/qmgr[2825]:0932212976E:removed
Jan2517:59:19ritekpostfix/smtpd[16756]:disconnectfrom
ritek.excellent.com[127.0.0.1]
Dariinformasilogdiatas,menyatakanbahwaemaildarijoko@jokowardono.netsudah
dikirimsecarabaikkewiwik@jokowardono.net.
Lihatisidirektorinewdariaccountwiwik@jokowardono.net
#lsal/home/virtual/jokowardono.net/wiwik\@jokowardono.net/new
total32
drwx2postfixpostfix4096Jan2517:59.
drwx5postfixpostfix4096Jan2413:59..
rw1postfixpostfix512Jan2413:59
1106549983.V307I19c00b.ritek.excellent.com
rw1postfixpostfix502Jan2517:59
1106650757.V307I19c02b.ritek.excellent.com
Dariinformasidiatasbahwafileyangbarudibentuktertulistanggal25Januari.Filetersebut
adalahhasilpengirimanfiledaritelnetdiatas.Untukmelihatfiletersebut,lakukanperintah
berikutini.
#cat/home/virtual/jokowardono.net/wiwik\@joko
wardono.net/new/1106650757.V307I19c02b.ritek.excellent.com
ReturnPath:<joko@jokowardono.net>
XOriginalTo:wiwik@jokowardono.net
DeliveredTo:wiwik@jokowardono.net
Received:fromritek(ritek.excellent.com[127.0.0.1])
byritek.excellent.com(Postfix)withSMTPid0932212976E
for<wiwik@jokowardono.net>;Tue,25Jan200517:58:22+0700(WIT)
Subject:Apakabar
MessageId:<20050125105822.0932212976E@ritek.excellent.com>
Date:Tue,25Jan200517:58:22+0700(WIT)
From:joko@jokowardono.net
To:undisclosedrecipients:;
HaloBu...
Apakabarnya?
INSTALASICOURIERIMAP
DownloadpakettarbalCourierImapdarihttp://www.couriermta.org/?download.php.
Bukapakettarbalnya.
#tarxjfcourierimap3.0.8.tar.bz2
KonfigurasisourceCourierImap
#cdcourierimap3.0.8
./configuredisablerootcheck\
withoutauthdaemonwithauthmysqlwithmysql=yes\
withauthpgsqlwithpgsql=yes\
enableworkaroundsforimapclientbugs
KompilasisourceCourierImap
#make
InstalasiCourierImap
#makeinstallstrip
#makeinstallconfigure
Konfigurariauthmysqlrc
# vi /usr/lib/courier-imap/etc/authmysql.rc
MYSQL_SERVERlocalhost
MYSQL_USERNAMEpostfix
MYSQL_PASSWORDpostfix
MYSQL_OPT0
MYSQL_DATABASEpostfix
MYSQL_USER_TABLEmailbox
MYSQL_CRYPT_PWFIELDpassword
MYSQL_UID_FIELD'82'
MYSQL_GID_FIELD'82'
MYSQL_LOGIN_FIELDusername
MYSQL_HOME_FIELD'/home/virtual'
MYSQL_NAME_FIELDname
MYSQL_MAILDIR_FIELDmaildir
MYSQL_QUOTA_FIELDquota
Editfile/usr/lib/courierimap/etc/imapd,ubahparameterdibawahini
ADDRESS=0
AUTHMODULES="authmysqlauthpgsqlauthldap";
AUTHMODULES_ORIG="authmysqlauthpgsqlauthldap"
IMAPDSTART=YES
Editfile/usr/lib/courierimap/etc/imapdssl,ubahparameterdibawahini
SSLADDRESS=0
IMAPDSSLSTART=YES
Editfile/usr/lib/courierimap/etc/pop3d,ubahparameterdibawahini
POP3AUTH="LOGINCRAMMD5CRAMSHA1"
POP3AUTH_ORIG="LOGINCRAMMD5CRAMSHA1"
POP3AUTH_TLS="LOGINPLAIN"
POP3AUTH_TLS_ORIG="LOGINPLAIN"
ADDRESS=0
POP3DSTART=YES
Editfile/usr/lib/courierimap/etc/pop3dssl,ubahparameterdibawahini
SSLADDRESS=0
POP3DSSLSTART=YES
Menjadikancourierimapberjalansebagaiservicepadasistem.
#cpcourierimap.sysvinit/etc/rc.d/init.d/courierimap
#chownroot.root/etc/rc.d/init.d/courierimap
#chmod+x/etc/rc.d/init.d/courierimap
#chkconfigaddcourierimap
#chkconfigcourierimapon
Jalankanservicecourierimap
#servicecourierimapstart
Periksadenganperintah
#psax|grepcourierimap
16569?S0:00/usr/lib/courierimap/libexec/couriertcpd
address=127.0.0.1stderrlogger=/usr/lib/courierimap/sbin/courierlogger
stderrloggername=imapdmaxprocs=40maxperip=4pid=/var/run/imapd.pid
nodnslookupnoidentlookup143/usr/lib/courierimap/sbin/imaplogin
/usr/lib/courierimap/libexec/authlib/authmysql/usr/lib/courier
imap/libexec/authlib/authpgsql/usr/lib/courier
imap/libexec/authlib/authldap/usr/lib/courierimap/bin/imapdMaildir
16571?S0:00/usr/lib/courierimap/sbin/courierloggerimapd
16578?S0:00/usr/lib/courierimap/libexec/couriertcpd
address=127.0.0.1stderrlogger=/usr/lib/courierimap/sbin/courierlogger
stderrloggername=imapdsslmaxprocs=40maxperip=4pid=/var/run/imapd
ssl.pidnodnslookupnoidentlookup993/usr/lib/courier
imap/bin/couriertlsservertcpd/usr/lib/courierimap/sbin/imaplogin
/usr/lib/courierimap/libexec/authlib/authmysql/usr/lib/courier
imap/libexec/authlib/authpgsql/usr/lib/courier
imap/libexec/authlib/authldap/usr/lib/courierimap/bin/imapdMaildir
16580?S0:00/usr/lib/courierimap/sbin/courierloggerimapd
ssl
16585?S0:00/usr/lib/courierimap/libexec/couriertcpd
address=127.0.0.1stderrlogger=/usr/lib/courierimap/sbin/courierlogger
stderrloggername=pop3dmaxprocs=40maxperip=4pid=/var/run/pop3d.pid
nodnslookupnoidentlookup110/usr/lib/courierimap/sbin/pop3login
/usr/lib/courierimap/libexec/authlib/authmysql/usr/lib/courier
imap/libexec/authlib/authpgsql/usr/lib/courier
imap/libexec/authlib/authldap/usr/lib/courierimap/bin/pop3dMaildir
16587?S0:00/usr/lib/courierimap/sbin/courierloggerpop3d
16593?S0:00/usr/lib/courierimap/libexec/couriertcpd
address=127.0.0.1stderrlogger=/usr/lib/courierimap/sbin/courierlogger
stderrloggername=pop3dsslmaxprocs=40maxperip=4pid=/var/run/pop3d
ssl.pidnodnslookupnoidentlookup995/usr/lib/courier
imap/bin/couriertlsservertcpd/usr/lib/courierimap/sbin/pop3login
/usr/lib/courierimap/libexec/authlib/authmysql/usr/lib/courier
imap/libexec/authlib/authpgsql/usr/lib/courier
imap/libexec/authlib/authldap/usr/lib/courierimap/bin/pop3dMaildir
16595?S0:00/usr/lib/courierimap/sbin/courierloggerpop3d
ssl
#netstattapn
tcp00127.0.0.1:9930.0.0.0:*LISTEN16578/couriertcpd
tcp00127.0.0.1:9950.0.0.0:*LISTEN16593/couriertcpd
tcp00127.0.0.1:1100.0.0.0:*LISTEN16585/couriertcpd
tcp00127.0.0.1:1430.0.0.0:*LISTEN16569/couriertcpd
Memeriksaservercourierimapdenganloginmelaluitelnet.
#telnetlocalhost143
Trying127.0.0.1...
Connectedtolocalhost.localdomain(127.0.0.1).
Escapecharacteris'^]'.
*OK[CAPABILITYIMAP4rev1UIDPLUSCHILDRENNAMESPACETHREAD=ORDEREDSUBJECT
THREAD=REFERENCESSORTQUOTAIDLEACLACL2=UNIONSTARTTLS]CourierIMAP
ready.Copyright19982004DoublePrecision,Inc.SeeCOPYINGfor
distributioninformation.
a001loginjoko@jokowardono.netjoko2004
a001OKLOGINOk.
a001list
a001NOErrorinIMAPcommandreceivedbyserver.
a001logout
*BYECourierIMAPservershuttingdown
a001OKLOGOUTcompleted
Connectionclosedbyforeignhost.
#telnetlocalhost110
Trying127.0.0.1...
Connectedtolocalhost.localdomain(127.0.0.1).
Escapecharacteris'^]'.
+OKHellothere.
userjoko@jokowardono.net
+OKPasswordrequired.
passjoko2004
+OKloggedin.
list
+OKPOP3clientsthatbreakhere,theyviolateSTD53.
1523
2523
314342
.
quit
+OKByebye.
Connectionclosedbyforeignhost.
Sampaidisini,CourierImapsudahbekerjadenganbaik.
INSTALASISQUIRRELMAIL
DownloadpakettarbalSquirrelMaildarihttp://squirrelmail.org.
Bukapakettarbalnya.
#tarxjfsquirrelmail1.4.4.tar.bz2
Copykanke/usr/local/httpdmenjadisquirrelmail
#cpRsquirrelmail1.4.4/usr/local/httpd/squirrelmail
KonfigurasiSquirrelMail
#cd/usr/local/httpd/squirrelmail
#mkdirattachment
#chownRapache.apachedata/
#chownRapache.apacheattachment/
#chmod733attachment/
#vi.htaccess,dantambahkanbarisbarisberikutini.
AddTypeapplication/php4script.php
Actionapplication/php4script/cgibin/php
#./configure
SquirrelMailConfiguration:Read:config.php(1.4.0)
MainMenu
1.OrganizationPreferences
2.ServerSettings
3.FolderDefaults
4.GeneralOptions
5.Themes
6.AddressBooks
7.MessageoftheDay(MOTD)
8.Plugins
9.Database
10.
Languages
Pilihmenunomor4.
SquirrelMailConfiguration:Read:config.php(1.4.0)
GeneralOptions
1.DataDirectory:../data/
2.AttachmentDirectory:$data_dir
3.DirectoryHashLevel:0
4.DefaultLeftSize:150
5.UsernamesinLowercase:false
6.Allowuseofpriority:true
7.HideSMattributions:false
Pilihmenunomor2.
Pathtodirectoryusedforstoringattachmentswhileamailis
beingsent.Thepathnamecanbeabsoluteorrelative(totheconfig
directory).
Itdoesn'tmatter.Herearetwoexamples:
Absolute:/var/spool/attach/
Relative:../attach/
[$data_dir]:../attachment/
PilihmenuSuntukmenyimpan,danpilihmenuRuntukkembalikemenuutama.
SquirrelMailConfiguration:Read:config.php(1.4.0)
MainMenu
D. SetpredefinedsettingsforspecificIMAPservers
PilihmenuD
PleaseselectyourIMAPserver:
cyrus=CyrusIMAPserver
uw=UniversityofWashington'sIMAPserver
exchange=MicrosoftExchangeIMAPserver
courier=CourierIMAPserver
macosx=MacOSXMailserver
hmailserver=hMailServer
quit=Donotchangeanything
Command>>courier
Pilihcourier
PilihmenuSuntukmenyimpan,danmenuQuntukkeluar.
Editfilekonfigurasiapache.
#vi/usr/local/httpd/conf/httpd.conf
Buatlahaliassebagaiberikut.
Alias/webmail"/usr/local/httpd/squirrelmail/"
<Directory"/usr/local/httpd/squirrelmail">
AllowOverrideNone
Orderallow,deny
Allowfromall
</Directory>
Restartapache.
#Servicehttpdrestart
Jalankanbrowsedanbukahttp://jokowardono.net/webmail
SampaidisiniwebmaildenganSquirrelMailtelahbekerjadenganbaik.
Instalasicourier(baru)
Instalasicourierauthlib
#
#
#
#
#
#
#
#
#
#
#
Instalasicourierimap
# tar xjf courier-imap-4.0.6.tar.bz2
# cd courier-imap
# ./configure --disable-root-check \
--without-authdaemon --with-authmysql --with-mysql=yes \
--with-authpgsql --with-pgsql=yes \
--enable-workarounds-for-imap-client-bugs --with-redhat
# make
# make install-strip
# make install-configure
# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap
# chmod 755 /etc/rc.d/init.d/courier-imap
# chkconfig --add courier-imap
# chkconfig courier-imap on
Editfile/usr/local/etc/authlib/authmysqlrc
# vi /usr/local/etc/authlib/authpgsqlrc
PGSQL_HOST
PGSQL_USERNAME
PGSQL_PASSWORD
localhost
postfix_user
passwduser
PGSQL_DATABASE
PGSQL_USER_TABLE
PGSQL_CRYPT_PWFIELD
PGSQL_UID_FIELD
PGSQL_GID_FIELD
postfixdb
mailbox
password
'89'
'89'
PGSQL_LOGIN_FIELD
PGSQL_HOME_FIELD
PGSQL_NAME_FIELD
PGSQL_MAILDIR_FIELD
PGSQL_QUOTA_FIELD
username
'/home/virtual'
name
maildir
quota
Editfile/usr/lib/courier-imap/etc/imapd,caridirektifdangantimenjadi
sepertidibawahini:
IMAPDSTART=YES
Editfile/usr/lib/courier-imap/etc/imapd-ssl,caridirektifdangantimenjadi
sepertidibawahini
IMAPDSSLSTART=YES
Editfile/usr/lib/courier-imap/etc/pop3d,caridirektifdangantimenjadi
sepertidibawahini
POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"
POP3AUTH_TLS_ORIG="LOGIN PLAIN"
POP3DSTART=YES
Editfile/usr/lib/courier-imap/etc/pop3d-ssl,caridirektifdangantimenjadi
sepertidibawahini
POP3DSSLSTART=YES
POP3_STARTTLS=YES
Jalankanserviceauthdaemondancourier-imap
# service courier-authlib start
# service courier-imap start