Monday, June 30, 2014

Install & Configure Zimbra Open Source Mail Server

                                Zimbra  is a Free Email Server and Calendar & collaboration solution, built for the both public and private cloud.It is also considered an Exchange replacement. Zimbra provides a web GUI from where mail server admin can manage zimbra server. Zimbra provides end users with a feature-rich browser-based experience that enables them to seamlessly and securely connect to their emails on any device or platform.


Working Scenario : The above configuration is based on the following assumptions:
Windows Server IP - 192.168.172.20
Windows Server FQDN -Computer Name  - aerl.mail.dc.it.com
DNS Server IP - 192.168.172.20 (Localhost)
Ubuntu Server IP - 192.168.172.22
Ubuntu Server FQDN - mail.dc.it.com
DNS Server IP - 192.168.172.20 (Internal Windows DNS Server) 

1. Installation Of AD And DNS In Windows 2008 Server :
1. Set Computer Name : AERL
2. Install AD And DNS On Windows Server :
       Execute dcpromo on Run Level and set domain name dc.it.com
3. After the Installation restarted the Server
4. Create An Internal Host (A) And MX Record for mail.dc.it.com in DNS
4.1. Take DNS Panel From Administrative Tools and Select DC-
4.2. In DC--->Forward Lookup Zones --->Select DC- dc.it.com
4.3. In this Zone Create New Host (A or AAA) :
            Set name as “ mail “  and IP Address : 192.168.172.22
             Automaticaly Display FQDN : mail.dc.it.com
4.4. Create New Mail Exchanger (MX) :
             Set Host Or Child Domain name as “ mail “
      Automatically Display FQDN : mail.dc.it.com
              FQDN Of Mail Server : Browse/Select DNS --->Forward Lookup Zone → Select Host               
                                                Record “mail”, Which is created in just above step

2. Setting Up the Ubuntu Server For Zimbra Installation
1. Install Ubuntu 12.04 With Open SSh Support
2. Update and Upgrade the Server
        apt-get update     and   apt-get upgrade
3. Set Host Name As “ mail
vi /etc/hostname
4. Check the IP Address and DNS Configuration.Add the nameserver 192.168.172.20
                       vi /etc/network/interfaces
        vi /etc/resolv.conf
5. Check the Hosts.Add mail.dc.it.com
                      vi /etc/hosts
                           127.0.0.1      localhost
                           127.0.0.1      mail.dc.it.com     mail
6. Test MX Record With DIG
      Syntax:  #dig mail.mydomain.com  mx
           Eg : # dig mail.dc.it.com mail
root@mail:~# dig mail.dc.it.com
; <<>> DiG 9.8.1-P1 <<>> mail.dc.it.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- 31925="" id:="" noerror="" opcode:="" query="" span="" status:="">
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.dc.it.com.             IN      A

;; ANSWER SECTION:
mail.dc.it.com.      3600    IN      A       192.168.172.22

;; Query time: 4 msec
;; SERVER: 192.168.172.20#53(192.168.172.20)
;; WHEN: Mon Jun 30 17:55:11 2014
;; MSG SIZE  rcvd: 51

3. Installation Of Zimbra
3.1.The Following Packages Need to Install before Installing Zimbra :
    1. apt-get install netcat-traditional
    2. apt-get install libgmp3c2
3. apt-get install libperl5.14
4. apt-get install sqlite3
5. apt-get install sysstat
6. apt-get install libidn11-dev
Single Line Execution :
                       apt-get install netcat-traditional libgmp3c2 libperl5.14 sqlite3 libidn11-dev sysstat
3.2. Disable AppArmor
                    AppArmor is a Mandatory Access Control (MAC) system which is a kernel (LSM) enhancement to confine programs to a limited set of resources. AppArmor's security model is to bind access control attributes to programs rather than to users.
    /etc/init.d/apparmor stop
/etc/init.d/apparmor teardown
update-rc.d -f apparmor remove
3.3. Download and Extract Zimbra Package
                         tar -xzvf zcs.tgz
                          cd zcs
3.4. Install Zimbra
    root@mail:/zcs# ./install.sh
License Agree = Y
Install zimbra-ldap = Y
Install zimbra-logger = Y
Install zimbra-mta = Y
Install zimbra-snmp = Y
Install zimbra-store = Y
Install zimbra-apache = Y
Install zimbra-spell = Y
Install zimbra-memcached = N
Install zimbra-proxy = N
System will be modified? = Y

    Change domain name = Y = mail.dc.it.com (Not Necessary )
Main Menu
    1) Common Configuration:
    2) zimbra-ldap: Enabled
    3) zimbra-store: Enabled
        +Create Admin User: yes
        +Admin user to create: admin@mail.dc.it.com
        ******* +Admin Password UNSET
        +Anti-virus quarantine user: virus-quarantine.rfi7ocq4@mail.dc.it.com
        +Enable automated spam training: yes
        +Spam training user: spam.fr5ekeowkp@mail.dc.it.com
        +Non-spam(Ham) training user: ham.ubskg1jvt@mail.dc.it.com
        +SMTP host: mail.dc.it.com
        +Web server HTTP port: 80
        +Web server HTTPS port: 443
        +Web server mode: https
        +IMAP server port: 7143
        +IMAP server SSL port: 7993
        +POP server port: 7110
        +POP server SSL port: 7995
        +Use spell check server: yes
        +Spell server URL: http://mail.dc.it.com:7780/aspell.php
        +Enable version update checks: TRUE
        +Enable version update notifications: TRUE
        +Version update notification email: admin@mail.dc.it.com
        +Version update source email: admin@mail.dc.it.com

    4) zimbra-mta: Enabled
    5) zimbra-snmp: Enabled
    6) zimbra-logger: Enabled
    7) zimbra-spell: Enabled
    8) zimbra-proxy: Enabled
    9) Default Class of Service Configuration:
    r) Start servers after configuration yes
    s) Save config to file
    x) Expand menu
    q) Quit

    Address unconfigured (**) items (? - help)
                         To change admin password enter number 3 then enter number 4,  r to return and put a to apply Zimbra configuration

    4 = Admin password set = ******
    r for previous menu
    a to apply
    Save config = Y and Enter
    System will be modified? = Y

                                       After done installing ZCS. Access web admin panel ZCS by opening your browser from computer and navigate to  https://192.168.172.22:7071 and Enter the user admin with password.

Wednesday, June 25, 2014

MMC Could Not Create The Snap-In OR Snap-In Failed To Initialize

MMC Could Not Create The Snap-In OR “Snap-In Failed To Initialize"
              Starting gpedit from start>run>gpedit.msc, the Group Policy Window opens, but I get the following error in the right hand window:
Symptoms:
MMC could not create the snap-in
MMC could not create the snap-in.  The snap-in might not have been installed correctly
Name: Group Policy Object Editor
CLSID: {8FCOB734-A0E1-11D1-A7D3-0000F87571E3}
Cause :
           This behavior occurs because the PATH environment variable does not include the %SystemRoot%\System32\WBEM folder.
Solution :
                Adding: ;%SystemRoot%\System32\WBEM;  into your PATH environment variable is exactly the right thing to do for that message.

Monday, June 23, 2014

Extending a Linux LVM Partition By Increasing An Existing Virtual Disk Size In Vmware

1. A Ubuntu Machine With HDD Size = 50 GB
2. Check the HDD Size
3. root@ubuntu:~# df -h
4. Power Off And Expand the Size.Here i increased 20 GB Additional
5. root@ubuntu:~# fdisk -l
6. root@ubuntu:~# fdisk -l /dev/sda
7. root@ubuntu:~# fdisk /dev/sda
Command (m for help): p
Command (m for help): n
Partition type:
  p   primary (2 primary, 1 extended, 1 free)
  l   logical (numbered from 5)
Select (default p):
Using default response p
Selected partition 4
First sector (104855552-146800639, default 104855552):
Using default value 104855552
Last sector, +sectors or +size{K,M,G} (104855552-146800639, default 146800639): +10G

Command (m for help): p
Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): L
Hex code (type L to list codes): 8e
Command (m for help): p
Command (m for help): w
8. root@ubuntu:~# reboot
9. root@ubuntu:~# pvcreate ubuntu /dev/sda4
10. root@ubuntu:~# vgs
11. root@ubuntu:~# vgextend ubuntu /dev/sda4
12. root@ubuntu:~# vgs
13. root@ubuntu:~# lvextend -L+10.00G /dev/ubuntu/root
14. root@ubuntu:~# lvdisplay
15. root@ubuntu:~# df -h
16. root@ubuntu:~# resize2fs -p /dev/mapper/ubuntu-root
17. root@ubuntu:~# df -h

Wednesday, June 4, 2014

Set Up Master Slave Replication in MySQL

                                    MySQL replication is the process by which a single data set, stored in a MySQL database, will be live-copied to a second server,This configuration, called "master-slave" replication.             This will cover a very simple example of mysql replication—one master will send information to a single slave.This will use the following IP addresses:
                         10.3.3.95 - Master Database   and 10.3.3.96 - Slave Database
Configuration on the Master Database Server
1. Installation of MYSQL : sudo apt-get install mysql-server mysql-client
2. Configure the Master Database

                     vi /etc/mysql/my.cnf                                
                                 #bind-address = 127.0.0.1
                                  server-id = 1
                                  log_bin = /var/log/mysql/mysql-bin.log
                                  binlog_do_db = jagan
After you make all of the changes, save and exit out of the configuration file.

3. Restart MySQL : sudo service mysql restart
4. In MySQL shell : mysql -u root -p

                  We need to grant privileges to the slave. You can use this line to name your slave and set up their password. The command should be in this format:
          GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'password';

eg : GRANT REPLICATION SLAVE ON *.* TO 'root'@'10.3.3.96' IDENTIFIED BY jagan123!';
FLUSH PRIVILEGES;
5. Check Status : SHOW MASTER STATUS;
 
6. Dump the DB in to the Master Server : mysqldump -u root -p --opt newdatabase > jagan.sql
Configuration on the Slave Database Server
1. Same As Master :So Execute the Following
sudo apt-get install mysql-server mysql-client
vi /etc/mysql/my.cnf
bind-address            = 127.0.0.1
bind-address            = 10.3.3.95  (Not Needed)
server-id                  =  2                                       
log_bin                      = /var/log/mysql/mysql-bin.log            
binlog_do_db             = jagan
2. Enable the replication from within the MySQL shell.
CHANGE MASTER TO MASTER_HOST='MASTERIPADDRESS', MASTER_USER='replication', MASTER_PASSWORD='password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;

Eg:-
CHANGE MASTER TO MASTER_HOST='10.3.3.95',MASTER_USER='root', MASTER_PASSWORD='aview123!', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=  107;
3. Activate the slave server:START SLAVE;
4. Check the details of the slave replication.The \G rearranges the text to make it more readable.
SHOW SLAVE STATUS\G;
5. If there is an issue in connecting, you can try starting slave with a command to skip over it:
                         SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; SLAVE START;
bloggerwidgets