Rabu, 25 Februari 2009

Membangun Mail Server Postfix bag 3

lanjutan dari bagian 2

Instalasi Courierpassd


Merupakan utility yang dapat mengijinkan user untuk mengubah password email secara remote, hal ini dapat dilakukan dengan cara mengaktifkan plugin dalam squirrelmail, courierpassd ini dapat mengubah email user menggunakan squirrelmail interface, sehingga memberi keleluasaan bagi user untuk mengubah sendiri kapanpun ingin mengubah password emailnya.

Courierpassd menggunakan port 106 untuk membuka trafik local(127.0.0.1) .

Proses instalasinya adalah sebagai berikut :

#rpm -ivh xinetd-2.3.14-8.i386
#tar zxvf courierpassd-1.1.0-RC1.tar.gz
#cd courierpassd-1.1.0-RC1
#./configure –with-couriersrc=/images/tools-postfix/courier-authlib-0.55
#make && make install
copykan authdaemon.passwd dari /images/tools-postfix/courier-authlib-0.55 ke /usr/local/libexec/authlib.

cp /images/tools-postfix/courier-authlib-0.55/authdaemon.passwd /usr/local/libexec/authlib

Jika authdaemon.passwd tidak ada, maka, masuk ke /usr/local/libexec/authlib, dan perhatikan apakah ada file authdaemon.passwd, jika sudah ada, maka tidak diperlukan pengcopyan.
Karena saya menggunakan Centos, maka couriedpassd dapat di integrasikan dengan xinetd.d

#cd /etc/xinetd.d

buatlah file service berikut ini.
#touch courierpassd
#vim courierpassd

service courierpassd
{
port = 106
socket_type = stream
protocol = tcp
user = root
server = /usr/local/sbin/courierpassd
server_args = -s imap
wait = no
only_from = 127.0.0.1
instances = 4
disable = no
}

Selanjutnya.

#vim /etc/services

tambahkan perintah berikut ini.
courierpassd 106/tcp #for /etc/xinetd.d/courierpassd

save dan exit

lakukan restart service xinetd
#/etc/rc.d/init.d/xinetd restart

lakukan nmap localhost dan perhatikan port 106 seharusnya sudah terbuka.
atau lakukan telnet localhost 106
root@rm2:/# telnet localhost 106
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
200 courierpassd v0.30 hello, who are you?
user test@server.co.id
200 Your password please.
pass test
200 Your new password please.
newpass test
200 Password changed, thank-you.
quit
200 Bye.
Connection closed by foreign host.

Kamis, 19 Februari 2009

Instalasi OTRS ( Open Ticket Request System ) on Centos 5

unduh dahulu file otrs nya di http://otrs.org

saya memilih file Tar.gz agar mudah mengetahui dimana directori instalasinya....

taruh file di dir # /tmp

1. extract file tar.gz  ke directori /opt, namakan folder extractnya menjadi otrs.

   # tar zxvf otrs-2.2.6.tar.gz -C /opt

   # mv otrs-2.2.6 otrs

   #

otrs tidak bisa di akses menggunakan user root, berarti kita harus membuat user untuk otrs 

selain itu user otrs harus dimasukkan kedalam group webserver user..

# useradd -d /opt/otrs/ -c 'OTRS user' otrs
# usermod -G nogroup otrs  <---- nogroup  adalah pilihan dari group webserver contoh apache
#

sekarang rubahlah file didalam directori /opt/otrs/Kernel/

# cd /opt/otrs/Kernel

# cp Config.pm.dist Config.pm

# cd Config/

# cp GenericAgent.pm.dist GenericAgent.pm

langkah selanjutnya membuat set permission untuk otrs, kita bisa memakai perintah SetPermissions.sh didalam directori bin dari otrs rubah seperti ini 

SetPermissions.sh [Home Directori otrs user] [otrs user] [web server user] [group web server]

# cd /opt/otrs/bin

# ./SetPermissions.sh /opt/otrs otrs otrs apache apache

SetPermissions.sh <$Revision: 1.31 $> - set OTRS file permissions
Copyright (C) 2001-2006 OTRS GmbH, http://otrs.org/
Setting file permissions... 
chown -R otrs:apache /opt/otrs
chmod -R og+rw /opt/otrs
chown otrs:apache /opt/otrs
chown -R otrs:apache /opt/otrs/var/
chown -R otrs:apache /opt/otrs/var/sessions/
touch && chown otrs:apache /opt/otrs/var/log/TicketCounter.log
chmod -R 775 /opt/otrs/bin/
(chown && chmod 700) otrs:0 /opt/otrs/bin/DeleteSessionIDs.pl
(chown && chmod 700) otrs:0 /opt/otrs/bin/UnlockTickets.pl
(chown && chmod 700) otrs:0 /opt/otrs/bin/otrs.getConfig



otrs sangat membutuhkan Modules PERL antara lain :

CGI                              This module is needed by the web interface of OTRS.
Date::Pcalc              This module is needed for date calculations. OTRS uses this module for              example in time specific calculations for tickets.
DBI                             OTRS needs this module to connect to the database backend.
DBD::mysql             Module with special functions to connect to the MySQL database backend.
Digest::MD5           This module makes it possible to use the md5 algorithm..
LWP::UserAgent   Module to process HTTP requests.
MIME::Base64       En- and decoding Base64 strings, e.g. for mail attachments.
MIME::Tools          This module provide some tools to process messages with MIME parts.
Mail::Internet        This module makes it possible to process emails based on the RFC 822 standard.
Net::DNS                 Perl interface to the domain name system.
Net::POP3              This module contains procedures to access and process messages on a POP3 server.
Net::LDAP              Perl interface to a LDAP directory. You only need to install this module, if you want to use a LDAP back-end.
Net::SMTP            Module that contains procedures to send emails.
Authen::SASL        SASL authentication framework, e.g. needed for the authentication against mailservers.
GD                           Interface to the GD graphics library. You only need to install this module, if you want to use the stats module in OTRS.
GD::Text, GD::Graph, GD::Graph::lines, GD::Text::Align Some more text- and graphic tools for the GD graphics library. You only need to install this modules, if you want to use the stats module of OTRS.
XML::Parser      This module is needed to read and write xml configuration files. The graphical configuration front-end of OTRS uses this module.
PDF::API2, Compress::Zlib   This module are needed to generate the PDF output for reports, search results or for the ticket print view.

untuk menginstall satu persatu modules gunakan perintah perl -e shell -MCPAN

bila sudah melakukan instalasi modules perl, lakukan cek modules menggunakan perintah otrs.checkModules yang dibutuhkan oleh perl modules...

# cd /opt/otrs/bin

# ./otrs.checkModules

  CGI ...                             ok
  Date::Pcalc ...                ok
  Date::Format ...            ok
  DBI ...                             ok
  DBD::mysql ...              ok
  Digest::MD5 ...             ok
  Crypt::PasswdMD5 ... ok
  LWP::UserAgent ...     ok
  IO::Scalar ...                 ok
  IO::Wrap ...                  ok
  MIME::Base64 ...        ok
  MIME::Tools ...           ok
  Mail::Internet ...         ok
  Net::DNS ...                 ok
  Net::POP3 ...               ok
  Net::LDAP ...               ok
  Net::SMTP ...              ok
  Authen::SASL ...         ok
  GD ...                            ok
  GD::Text ...                 ok
  GD::Graph ...              ok
  GD::Graph::lines ...   ok
  GD::Text::Align ...     ok
  XML::Parser ...          ok
  PDF::API2 ...             not installed! (for PDF output - not required)
  Compress::Zlib ...     ok

masuk ke dalam directori /opt/otrs lakukan pengecekan seperti berikut :

# cd /opt/otrs
# perl -cw bin/cgi-bin/installer.pl
cgi-bin/installer.pl syntax OK
# perl -cw bin/PostMaster.pl
PostMaster.pl syntax OK
#

 Konfigurasi file apachenya untuk otrs... 

untuk mengakses web otrs kita memerlukan scripts tambahan, hampir semua apache mempunyai file conf.d didalam /etc/httpd/ atau /etc/apache atau /etc/apache2

masuk kedalam directori conf.d nya, buat dan buka file otrs.conf, masukkan scripts dibawah ini :

#
# Basic apache configuration file for OTRS
#
# agent, admin and customer frontend
#
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
#
# Directory settings
#

  AllowOverride None
  Options +ExecCGI -Includes
  Order allow,deny
  Allow from all


  AllowOverride None
  Order allow,deny
  Allow from all

 simpan dan restart service apachenya...

# /etc/init.d/httpd restart

#

langkah selanjutnya konfigurasi melalui web interfaces, buka browser dengan alamat http://localhost/otrs/installer.pl 
gunakan database mysql untuk mengelola via web :

contoh :

Selasa, 10 Februari 2009

Instalasi WordPress

Instalasi Worpress ini di coba dengan menggunakan Linux Centos 5.2

1.  yang diperlukan oleh Instalasi wordpress adalah :

     PHP (latest version) atau versi terbaru..

    MySql (latest version) atau yang terbaru..

    Apache (Latest version) atau yang terbaru...

2. Download Wordpress

          Download Paket Instalasi Wordpress di http://www.wordpress.org

          biar lebih mudahnya, taruh filenya didalam /usr/local/src

          Extract filenya kedalam /var/www/html or other linux ke dalam /var/www/htdocs

          [root@rm2 src]# tar zxvf wordpress-2.x.x.tar.gz -C /var/www/html

          masuk kedalam directori /var/www/html/wordpress

          [root@rm2 src]# cd /var/www/html/wordpress

          [root@rm2 wordpress]# 

3.  Edit File Configurasinya Wordpress

      [root@rm2 wordpress]# vi wp-config-sample.php

      edit beberapa variabel dibawah ini

          // ** MySQL settings ** //
         define('DB_NAME', 'wordpress');  
         define('DB_USER', 'username');  
         define('DB_PASSWORD', 'password'); 
         define('DB_HOST', 'localhost');  

      menjadi :

         define('DB_NAME', 'wordpress'); // nama database 
         define('DB_USER', 'penchot'); // nama user pada MySQL
         define('DB_PASSWORD', 'p3nch0t'); // password user pada MySQL
         define('DB_HOST', 'localhost'); // gak usah di rubah.

     bila sudah selesai menkonfigurasikannya simpan dengan nama wp-config.php


        Membuat atau menambahkan user dan database di dalam MySQL dengan cara berikut :

        [root@rm2 ~]# mysqladmin -p create wordpress

        enter password:

       [root@rm2 ~]# mysql -p
       Enter password: 
       

       Welcome to the MySQL monitor. Commands end with ; or \g.
       Your MySQL connection id is 2
       Server version: 5.0.45 Source distribution

       Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

       mysql>  use wordpress;

       mysql>  grant all privileges on `wordpress` to 'penchot'@'localhost' with grant option;

       Query OK, 0 rows affected (0.09 sec)

     
       mysql> flush privileges;
       Query OK, 0 rows affected (0.07 sec)

       mysql> quit

        bye

        [root@rm2 ~]#

   Jalankan Web Browser dan arahkan alamat URL wordpress nya

   contoh http://server-name(ip-address)/wordpress/wp-admin/install.php

    selanjutnya ikuti langkah yang ada di dalam URL wordpress

   Screenshoot





        

Selasa, 03 Februari 2009

Membangun Mail Server "Postfix" bag 2

Membangun Mail Server "Postfix" bag 1 sebelumnya

Instalasi Courier-authlib


1. Lakukan extract dan instalasi paket courier-authlib

#tar jxvf courier-authlib-0.55.tar.bz2
#cd courier-authlib-0.55
#vim authmysqlrc

2. Lakukan perubahan di file authmysqlrc, sehingga hasilnya adalah sebagai berikut.
#DEFAULT_DOMAIN intra.net
MYSQL_CRYPT_PWFIELD password
MYSQL_DATABASE postfix
MYSQL_GID_FIELD ‘33333'
MYSQL_HOME_FIELD ‘/usr/local/virtual’
MYSQL_LOGIN_FIELD username
MYSQL_MAILDIR_FIELD maildir
MYSQL_NAME_FIELD name
MYSQL_OPT 0
MYSQL_PASSWORD postfix
#MYSQL_PORT 0
MYSQL_QUOTA_FIELD quota
MYSQL_SERVER localhost
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_UID_FIELD ‘33333'
MYSQL_USERNAME postfix
MYSQL_USER_TABLE mailbox
#MYSQL_WHERE_CLAUSE server=’mailhost.example.com’

Setelah itu, lakukan instalasi
#./configure -–prefix=/usr/local –exec-prefix=/usr/local –with-authmysql –disable-root-check –with-ssl

–with-authchangepwdir=/usr/local/libexec/authlib –with-redhat –with-mysql=yes

#make && make check
#make install-strip && make install-configure

Instalasi Courier-imap

Lakukan extract dan instalasi paket courier-imap
#tar jxvf Courier-imap-4.0.2

Non user root diperlukan untuk mengcompiled Courier-imap, dalam hal ini, non user root yang digunakan adalah

user test. sehingga paket harus diubah kepemilikannya.
#chown -R test:root courier-imap-4.0.2

#su test 

$./configure -–prefix=/usr/local –exec-prefix=/usr/local -without-authldap –disable-root-check –with-ssl

–with-authchangepwdir=/usr/local/libexec/authlib –with-mysql=yes –with-authmysql –with-redhat

$make && make check

Balik ke root lagih yah!!!

#make install-strip && make install-configure

Membuat ssl certificate untuk imap-ssl server.
#/usr/local/sbin/mkimapdcert

Lakukan perubahan di
#vim /usr/local/etc/imapd.cnf
ubah postmaser@example.com menjadi postmaster@server.co.id

#vim /usr/local/etc/imapd
pastikan konfigurasi berikut ini ada :
IMAPDSTART=YES

#vim /usr/local/etc/imapd-ssl
Pastikan konfigurasi berikut ini ada :
IMAPDSSLSTART=YES
TLS_CERTFILE=/usr/local/share/imapd.pem

#vim /usr/local/etc/authlib/authdaemonrc
Sesuaikan konfigurasi berikut ini ada :
authmodulelist=”authmysql”

#vim /usr/local/etc/pop3d
Pastikan konfigurasi berikut ini ada :
POP3DSTART=YES
POP3AUTH=”LOGIN”

Membuat script untuk startup

#cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap
#cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps
#cp /usr/local/libexec/pop3d.rc /etc/rc.d/init.d/pop3

lakukan start-stop untuk imap dan imaps dan simpan dalam /etc/rc.local
#/usr/local/sbin/authdaemond stop

#/usr/local/sbin/authdaemond start

#/etc/rc.d/init.d/imap stop

#/etc/rc.d/init.d/imaps stop

#/etc/rc.d/init.d/imap start

#/etc/rc.d/init.d/imaps start

#/etc/rc.d/init.d/pop3 start

#postfix start

Lakukan tes telnet ke port imap 143, smtp postfix 25 dan pop3 110

[root@rm2 authlib]# telnet localhost 143
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT

THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double

Precision, Inc. See COPYING for distribution information.

Untuk melihat port imap dan pop3 aktif.
#netstat -tapn
tcp 0 0 :::110 :::* LISTEN 3072/couriertcpd
tcp 0 0 :::143 :::* LISTEN 2385/couriertcpd

Untuk instalasi squirrelmail

1.extract paket squirelmail dan pindahkan ke document_root yg terdapat dalam configurasi httpd.conf.
#tar zxvf squirrelmail.x.x.tar.gz
#mv squirrelmail webmail
#mv webmail /var/www/html
#cd /var/www/html/webmail
#chown -R apache.apache data/

Sehingga tampilannya spt ini.

drwxrwxr-x 2 apache apache 4096 May 19 18:18 data

#cd /webmail/config
#./conf.pl
Di bagian server
1. Domain : server.co.id 

2. Invert Time : false
3. Sendmail or SMTP : SMTP

di bagiam imap
IMAP Settings
————–
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : courier
9. Delimiter : autodetect

dibagian smtp
SMTP Settings
————-
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : none
8. Secure SMTP (TLS) : false
9. Header encryption key :

Login ke webmail
http://[ip address postfix]/webmail/

Membangun Mail Server "Postfix" Bag 1

Membangun mail server dengan Postfix Bagian ke-1

(Building Postfix Part 1)


Postfix merupakan program opensource Mail Transfer Agent (MTA) atau program pengirim email dimana default MTA untuk operating system unix/linux, memiliki kemampuan untuk menjadi program pengirim email yang cepat, mudah dikelola dan aman.

Pada percobaan test server kali ini, mailserver yang akan dibangun menggunakan system operasi Centos 5.1, dan pada saat instalasi paket-paket yang digunakan adalah
1. Mysql-5.0.27.
2. Postfix-2.4.1.
3. Courier-authlib-0.55.
4. Courier-imap-4.0.2.
5. Postfixadmin-2.1.0.

Tindakan pertama yang harus dilakukan. lakukan penambahan di file
#vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.0.100 mailserver.server.co.id mailserver

Instalasi Mysql

# yum -y install MySQL-python libdbi-dbd-mysql mysql-connector-odbc mysql-devel mysql-server pam_mysql perl-DBD-MySQL php-mysql

Jika sudah selesai, lakukan testing dan aktifkan service mysql

#chkconfig mysqld on
#service mysqld start
#mysql -h localhost -u root -p [tanpa password]

*Instalasi Postfix*

1. Membuat user dan Group
# groupadd -r postfix
# useradd -r -g postfix -d /no/where -s /no/shell postfix
# groupadd -r postdrop

2. Untuk instalasi Postfix ini, saya lebih memilih untuk melakukan instalasi dari paket source tar.gz.

# tar -zxvf Postfix-2.4.1.tar.gz
# cd postfix-2.4.1
# make makefiles ‘CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -I/usr/include/sasl’ ‘AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib’

#make && make install

Letak direktori akan ditentukan, sebaiknya ikuti default saja, dan lakukan enter saja setiap kali ditanya mengenai lokasi folder.

Pastikan tidak ada error pada saat proses instalasi postfix ini, jika tidak ada error, maka akan terbentuk folder /etc/postfix dan file-file main.cf dan master.cf

3. Lakukan perubahan di main.cf hasilnya seperti berikut ini.
myhostname = mailserver.server.co.id
mydomain = server.co.id
inet_interfaces = all
mydestination = localhost, localhost.$mydomain
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases

Tambahkan perintah berikut ini.

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_virtual_quota_maps.cf
virtual_mailbox_base = /usr/local/virtual
virtual_transport = virtual
virtual_uid_maps = static:33333
virtual_gid_maps = static:33333
virtual_minimum_uid = 33333
virtual_create_maildirsize = yes

Untuk mengetahui uid dan gid, lakukan perintah berikut ini.
#id postfix
uid=33333(postfix) gid=33333(postfix) groups=33333(postfix)

Pastikan dalam file master.cf terdapat baris berikut ini.
virtual unix - n n - - virtual

Membuat Direktori Virtual

Lakukan perintah berikut ini.

#mkdir /usr/local/virtual
#chown -R postfix.postfix /usr/local/virtual
#chmod -R 751 /usr/local/virtual

Membuat file konfigurasi yang tersimpan dalam /etc/postfix/

#touch mysql_virtual_alias_maps.cf
#vim mysql_virtual_alias_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address

#touch mysql_virtual_domains_maps.cf
#vim mysql_virtual_domains_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain

#touch mysql_virtual_mailbox_maps.cf
#vim mysql_virtual_mailbox_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username

#touch mysql_virtual_quota_maps.cf
#vim mysql_virtual_quota_maps.cf
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox

select_field = maildir

where_field = quota

=====>>>> Go To---->>> menuju Bag 2 Mail Server Postfix