1. Install and configure Directory Server 5.2
a. Install Directory Server on mail
# gunzip ds.5.2.P4.Solaris.x86.full.tar.gz
# tar xf ds.5.2.P4.Solaris.x86.full.tar
# ./setup
Enter the fully qualified name of the computer
Fully Qualified Computer Name [mail.domain.com] {"<" goes back, "!"
exits}: mail.sunviet.vn
Choose the type of installation from the following choices:
Sun Java(TM) System Servers - Installs the Sun Java(TM) System servers, Sun Java
(TM) System Server Console, and related components.
Sun Java(TM) System Server Console - Installs the Sun Java(TM) System Server
Console as a stand-alone Java application.
1. Sun Java(TM) System Servers
2. Sun Java(TM) System Server Console
What would you like to do [1] {"<" goes back, "!" exits}?
Choose the type of installation you prefer from the following choices:
Express - Installation option choices are made automatically. The easiest
installation and recommended for evaluating the product.
Typical - Software will be installed with the most common options. Recommended
for most deployments.
Custom - You may choose the options you want to install. Recommended for
advanced users.
1. Express
2. Typical
3. Custom
What would you like to do [2] {"<" goes back, "!" exits}?
The Directory Server components will be installed in the following directory.
Specify the directory location where you want to install the product.
Directory to install Directory Server components into [/var/Sun/mps] {"<"
goes back, "!" exits}:
The directory "/var/Sun/mps" does not exist.
Do you want to create it now or choose another directory?
1. Create Directory
2. Choose New
Enter the number corresponding to your choice [1] {"<" goes back, "!"
exits}
Please wait while components are loaded...
Directory Server components showing a checked box will be installed.
[X] 1 Sun Java(TM) System Directory Suite 0 bytes
[X] 2 Sun Java(TM) System Directory Server 28.02 MB
[X] 3 Sun Java(TM) System Directory Console Support 1.76 MB
[X] 4 Sun Java(TM) System Administration Services 0 bytes
[X] 5 Sun Java(TM) System Administration Server 12.26 MB
[X] 6 Sun Java(TM) System Administration Console 230.89 KB
[X] 7 Sun Java(TM) System Server Console 0 bytes
[X] 8 Sun Java(TM) System Server Console Core 5.85 MB
[X] 9 Java Runtime Environment 65.00 MB
[X] 10 Sun Java(TM) System Server Basic Libraries 27.60 MB
To check a particular component, enter its number, or 0 when you are
finished [0] {"<" goes back, "!" exits}:
Checking Disk Space
Choose the system user and group names under whose identity
the Sun Java(TM) System Directory server will run.
System User [root] {"<" goes back, "!" exits}:
System Group [root] {"<" goes back, "!" exits}:
You may store Sun Java(TM) System server configuration information in another
Sun Java(TM) System Directory Server. If you have already prepared a
configuration server, you may configure the new server to use it.
1. The new instance will be the configuration Directory Server
2. Use existing configuration Directory Server
What would you like to do [1] {"<" goes back, "!" exits}?
You may already have a Directory Server where you store user and group
information.
1. Store data in the new Directory Server
2. Store data in an existing Directory Server
What would you like to do [1] {"<" goes back, "!" exits}?
Settings the new server will use for basic operation
Server Identifier [mail] {"<" goes back, "!" exits}:
Server Port [389] {"<" goes back, "!" exits}:
Suffix [dc=sunviet, dc=vn] {"<" goes back, "!" exits}:
Configuration Directory Server Administrator
Administrator ID [admin] {"<" goes back, "!" exits}:
Password:
Password (again):
Administration Domain
Administration Domain [sunviet.vn] {"<" goes back, "!" exits}:
Enter a Distinguished Name (DN) for the Directory Manager and a password at
least 8 characters long.
Directory Manager DN [cn=Directory Manager] {"<" goes back, "!" exits}:
Password:
Password (again):
The Administration Server runs on a different network port from other servers.
Specify the number of the port.
Administration Port [390] {"<" goes back, "!" exits}:
b. Migrate data from old Directory Server on ldapsunviet to mail ( after installing Sun Messaging schema on Directory Server )
Export file suffix dc=sunviet,dc=vn to directory server from old ldapsunviet
/var/Sun/mps/slapd-mail/db2ldif -s dc=sunviet,dc=vn
[04/Jun/2010:10:55:59 +0700] - DEBUG - conn=-1 op=-1 msgId=-1 - Backend Instance: userRoot
ldiffile: /var/Sun/mps/slapd-mail/ldif/2010_06_04_105558.ldif
[04/Jun/2010:10:56:00 +0700] - export userRoot: Processed 1000 entries (75%).
[04/Jun/2010:10:56:00 +0700] - export userRoot: Processed 1322 entries (100%).
Import file suffix dc=sunviet,dc=vn vào directory server c?a mail
/usr/bin/ldapmodify -D "cn=directory manager" -w tainguyenmtvn -a -c -f 2010_06_04_105558.ldif
2. Install and configure Sun Messaging 7.2
a. Install Sun Messaging 7.2
# unzip SunJava_CommsInstaller_Suite6u2_solaris-x86.zip
./commpkg install
Item Description
---- -----------
1 Messaging Server 7u2 (7.2-7.02)
2 Messaging Server (64bit) 7u2 (7.2-7.02)
== Installed Version at /opt/sun/comms/messaging64 : 7.2-7.02
3 Comms DSsetup 6.4 (6.4-4.04)
4 Comms Delegated Administrator 7 (7.0-0.00)
5 Calendar Server 6.3 (6.3-15.01)
6 Instant Messaging 8u1 (8.1-01.03)
7 Communications Express 6.3 (6.3-13.01)
8 Messaging Server Sun Cluster HA agent 7.0 (7.0-0.03)
9 Calendar Server Sun Cluster HA agent 6.3 (6.3-1.01)
10 Instant Messaging Sun Cluster HA agent 7.3 (7.3-01.02)
11 Convergence 1u2 (1.0-7.01)
Select 2,3,11 to install Messaging Server, Convergence
#cd /opt/sun/comms/messaging64/install/
# cat Config.txt
Port Assignments:
Port Service
==== =======
25 SMTP
110 POP3
143 IMAP4
225 LMTP
465 SMTP SSL
587 SMTP SUBMIT
995 POP3 SSL
993 IMAP4 SSL
8990 Webmail
8991 mail SSL
b. Configure Sun Messaging server:
Setup schema Sun Messaging cho Directory Server
# /var/Sun/mps/bin/slapd/admin/bin/perl /opt/sun/comms/dssetup/sbin/comm_dssetup.pl
Disable sendmail service:
# svcadm disable sendmail
#/opt/sun/comms/messaging64/sbin/configure
Please enter the fully qualified host name for the Messaging Server.
Enter fully qualified host name [mail.sunviet.vn] {"<" goes back, "!" exits}
Please specify the directory into which the Messaging Server configuration and
data files will be installed.
Directory to install Messaging Server configuration and data files
[/var/opt/sun/comms/messaging64] {"<" goes back, "!" exits}:
Messaging Server components showing a checked box will be configured. Please
change selection accordingly.
[X] 1 Message Transfer Agent 0 bytes
[X] 2 Message Store 0 bytes
[X] 3 Webmail Server 0 bytes
[ ] 4 Messaging Multiplexor 0 bytes
To check a particular component, enter its number, or 0 when you are
finished [0] {"<" goes back, "!" exits}:
Please enter the user and group which will be used to adminster the Messaging
Server. The user and group will be created if they do not exist. If the user is
created, it will have a password that is locked out.
Enter Username [mailsrv]:
Enter Unix Group [mail]:
User/Group Server LdapURL [ldap://mail.sunviet.vn:389] {"<" goes back, "!"
exits}:
Bind As [cn=Directory Manager] {"<" goes back, "!" exits}:
Password {"<" goes back, "!" exits}:
Do not use an email address that begins with "Postmaster@". This email address
is already assigned to the Postmaster alias.
Enter Postmaster email address [] {"<" goes back, "!" exits} hostmaster@domain.com
Enter a password to be used for Messaging Server (several administration
accounts)
Enter password [] {"<" goes back, "!" exits}:
Re-enter password to verify [] {"<" goes back, "!" exits}:
Please enter the default email domain that this Messaging Server will be
responsible for. The default email domain is the domain of unqualified user-
id's that do not belong to any particular domain.
Enter Email Default Domain [sunviet.vn] {"<" goes back, "!" exits}
The Organization DN will be the LDAP subtree under which all email users and
groups that belong to the default email domain are located. Note that the DN
must be located under the user/group suffix.
Enter Organization DN [o=sunviet.vn,dc=sunviet,dc=vn] {"<" goes back, "!" exits}
Start messaging server:
#/opt/sun/comms/messaging64/sbin/start-msg
3. Setup Application Server 9.1
a. Cài d?t Application Server 9.1
# ./sjsas_ee-9_1_02-solaris-i586.bin -console
Installation Directory [/opt/SUNWappserver] {"<" goes back, "!" exits}:
Administrator User [admin] {"<" goes back, "!" exits}:
Administrator User's Password (8 chars minimum):
Re-enter Password:
Do you want to store administrator user name and password in user preference
file [yes] {"<" goes back, "!" exits}?
Administration Port [4848] {"<" goes back, "!" exits}:
HTTP Port [8080] {"<" goes back, "!" exits}:80
HTTPS Port [8181] {"<" goes back, "!" exits}:
1. Access the About Application Server PE 8 welcome page at:
file:///opt/SUNWappserver/docs/about.html
2. Start the Application Server by executing:
# /opt/SUNWappserver/bin/asadmin start-domain domain1
3. Start the Admin Console:
http://localhost:4848
# /opt/SUNWappserver/bin/asadmin stop-appserv
b. Start Sun Application Server
T?o file /etc/asadminpassword
vi /etc/asadminpasswd
AS_ADMIN_PASSWORD=tainguyenmtvn
AS_ADMIN_MASTERPASSWORD=tainguyenmtvn
Ch?y Application Server
/opt/SUNWappserver/bin/asadmin stop-domain
/opt/SUNWappserver/bin/asadmin start-domain --user admin --passwordfile /etc/asadminpasswd
4. Setup Sun Converenge 1.0
a. Configure Sun Converenge
# JAVA_HOME=/usr;export JAVA_HOME;
# /opt/sun/comms/iwc/sbin/init-config -nodisplay
Specify the directory in which the configuration and data files should be
installed [/var/opt/sun/comms/iwc] {"<" goes back, "!" exits}:
[X] 1 Mail Service 0 bytes
[ ] 2 Calendar Service 0 bytes
[ ] 3 Instant Messaging Service 0 bytes
To select a component, enter its number, or 0 when you are done [0] {"<"
goes back, "!" exits}: 0
Convergence is to be configured.
Virtual Server Identifier: Enter the Virtual Server Identifier for which the
Sun Convergence is to be configured.
Server Instance HTTP Port: Enter the Application Server port number where HTTP
service is available.
Enter Application Server Install Directory [/opt/SUNWappserver] {"<" goes
back, "!" exits}:
Enter Application Server Domain Directory
[/opt/SUNWappserver/domains/domain1] {"<" goes back, "!" exits}:
Enter Application Server Document Root Directory
[/opt/SUNWappserver/domains/domain1/docroot] {"<" goes back, "!" exits}:
Enter Application Server Instance Name [server] {"<" goes back, "!" exits}:
Enter Virtual Server Identifier [server] {"<" goes back, "!" exits}:
Enter Application Server Instance HTTP Port [80] {"<" goes back, "!" exits}:
Please Wait: Verifying whether the Application Server Instance connection is
Alive
Application Server: Administration Instance Details
Specify Application Server's Administration instance details used by the
configurator to configure Sun Convergence on Application Server.
Enter the Administration Server Port [4848] {"<" goes back, "!" exits}:
Enter the Administrator User ID [admin] {"<" goes back, "!" exits}:
Enter the Administrator Password [] {"<" goes back, "!" exits}:
Is the Administration Server instance running in the secure mode [yes] {"<"
goes back, "!" exits}?
Please Wait: Verifying whether the Administration Server instance connection is
alive
Information
You have specified that the Application Server's Administration Server instance
is running in the secure mode.
URI Path
Enter the URI Path for Sun Convergence.
URI Path: Enter the URI Path where the Sun Convergence is to be deployed.
Note: Ensure you have specified a new URI Path. If there exists a web
application already configured at the specified URI, it will be deleted before
Sun Convergence is deployed.
Enter URI Path for Sun Convergence [/iwc] {"<" goes back, "!" exits}:
Start Install Sun Convergence to Application Server
b. Configure redirect http://mail.sunviet.vn/iwc URL to http://mail.sunviet.vn
vi /opt/SUNWappserver/domains/domain1/docroot/index.html
<meta http-equiv="refresh" content="0;url=http://mail.sunviet.vn/iwc">
c. Patch for Sun Convergence
# JAVA_HOME=/usr
# export JAVA_HOME
# patchadd 137631-12
5. Script to auto-start Sun Messaging
ln -s /var/Sun/mps/start-admin /usr/sbin/start-admin
ln -s /var/Sun/mps/slapd-mail/start-slapd /usr/sbin/start-ldap
ln -s /opt/sun/comms/messaging64/sbin/start-msg /usr/sbin/start-msg
vi /usr/sbin/start-app
#!/bin/sh
/opt/SUNWappserver/bin/asadmin start-domain --user admin --passwordfile /etc/asadminpassword
chmod u+x /usr/sbin/start-app
vi /usr/sbin/run-ciren
#!/bin/sh
start-ldap
start-admin
start-msg
start-app
vi /etc/rc3.d/S98Ciren
run-ciren
chmod u+x /etc/rc3.d/S98Ciren
6. Setup a local DNS server for Testing
a. Create file /etc/named.conf
vi /etc/named.conf
"/etc/named.conf" 15 lines, 224 characters
options {
DIRECTORY "/var/named";
};
zone "." {
type hint;
file "db.root";
};
zone "sunviet.vn" in {
type master;
file "db.sunviet.vn";
};
b. Create file /var/named/db.root
vi /var/named/db.root
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 IN NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 IN NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
; housed in Japan, operated by WIDE
;
. 3600000 IN NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File
T?o file /var/named/db.sunviet.vn
more /var/named/db.sunviet.vn
$TTL 86400
;{name} {ttl} Class SOA Origin Postmaster
;----------------------------------------------------------------------------------
@ IN SOA mail.sunviet.vn. root.mail.sunviet.vn. (
2005010101 ; Serial
3600 ; Refresh (1 Hour)
1800 ; Retry (30 Minutes)
6048000 ; Expire (1 Week)
86400 ) ; Minimum (24 Hours)
;
;{name} {ttl} Class NS Nameserver Name
;------------------------------------------------------
IN NS mail.sunviet.vn.
IN MX 10 mail.sunviet.vn.
;
;{name} {ttl} Class A IP Address
;-------------------------------------------------
mail IN A 172.16.4.34
localhost IN A 127.0.0.1
;
;{name} {ttl} Class CNAME Canonical Name
;-------------------------------------------------------
mail IN CNAME mail
c. Configure dns client
vi /etc/resolv.conf
nameserver localhost
domain sunviet.vn
cp /etc/nsswitch.dns /etc/nsswitch.conf
ipnodes: files dns
svcadm enable dns/client
svcs |grep dns
online 15:08:29 svc:/network/dns/client:default
d. Run named process
named; dmesg |tail
Aug 30 15:11:55 mail named[2099]: [ID 873579 daemon.warning] checkhints: unable to find root NS 'j.root-servers.net' in hints
Aug 30 15:11:55 mail named[2099]: [ID 873579 daemon.warning] checkhints: unable to find root NS 'k.root-servers.net' in hints
Aug 30 15:11:55 mail named[2099]: [ID 873579 daemon.warning] checkhints: unable to find root NS 'l.root-servers.net' in hints
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.notice] starting BIND 9.6.1-P3
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.notice] built with --prefix=/usr --with-libtool --bindir=/usr/sbin --sbindir=/usr/sbin --libdir=/usr/lib/dns --sysconfdir=/etc --localstatedir=/var --with-openssl=/usr/sfw --enable-threads=yes --enable-devpoll=yes --enable-fixed-rrset --disable-openssl-version-check -DNS_RUN_PID_DIR=0
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.error] binding TCP socket: address in use
Aug 30 16:36:32 mail last message repeated 1 time
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.notice] couldn't add command channel 127.0.0.1#953: address in use
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.notice] couldn't add command channel ::1#953: address not available
Aug 30 16:36:32 mail named[2792]: [ID 873579 daemon.notice] running
e. Test named
nslookup
> set q=MX
> sunviet.vn
Server: 127.0.0.1
Address: 127.0.0.1#53
sunviet.vn mail exchanger = 10 mail.sunviet.vn.