NETWORKSTIP Networking CCNA,Centos,Ubuntu,Sql,

Made By Muhammad Nafees

Breaking

Tuesday 14 June 2016

June 14, 2016

Installing Zimbra 8.0.4 on CentOS linux

Installing & Configuration Zimbra Mail Server
Steps
1. Update your system
yum update -y
  1. install prerequisite package for zimbra
    yum install sudo sysstat libidn gmp litool-ltdl compat-glib vixie-cron nc perl libstdc++.i686
    yum -y install nc wget nano make nc sudo sysstat libtool-ltdl glibc perl ntp
  2. modify /etc/hosts file
    nano /etc/hosts
    ip address mail.nextzone.com mail
4.disable start-up services
4a.chkconfig postfix off
4b.service postfix stop
4c.chkconfig sendmail off
4d.service sendmail stop
  1. modify /etc/sudoers file
    nano /etc/sudoers
    comment out # Defaults requiretty *line
6.Disable or adjust your firewall
6a.chkconfig iptables off
6b.service iptables stop
6c.chkconfig ip6tables off
6d.service ip6tables stop
7. Disable selinux
nano /etc/sysconfig/selinux
SELINUX=disabled
Reboot is required at this step
9.Now extract Zimbra tar file using below command
tar -zxpvf zcs-8.0.4_GA_5737.RHEL6_64.20130524120036.tgz
10.Now Change the directory & run below command to install zimbra
cd zcs-8.0.4_GA_5737.RHEL6_64.20130524120036
./install.sh
When we execute the above command we will get below output and follow the instructions :
Operations logged to /tmp/install.log.2570
Checking for existing installation…
zimbra-ldap…NOT FOUND
zimbra-logger…NOT FOUND
zimbra-mta…NOT FOUND
zimbra-snmp…NOT FOUND
zimbra-store…NOT FOUND
zimbra-apache…NOT FOUND
zimbra-spell…NOT FOUND
zimbra-convertd…NOT FOUND
zimbra-memcached…NOT FOUND
zimbra-proxy…NOT FOUND
zimbra-archiving…NOT FOUND
zimbra-cluster…NOT FOUND
zimbra-core…NOT FOUND
PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE. ZIMBRA, INC..
License Terms for the Zimbra Collaboration Suite:
http://www.zimbra.com/license/zimbra_public_eula_2.1.html
Do you agree with the terms of the software license agreement? [N] Y
Do you agree with the terms of the software license agreement? [N] Y
License Terms for the Zimbra Collaboration Suite:
http://www.zimbra.com/license/zimbra_public_eula_2.1.html
Do you agree with the terms of the software license agreement? [N] Y
Do you agree with the terms of the software license agreement? [N] Y
Checking for prerequisites…
FOUND: NPTL
FOUND: nc-1.84-22
FOUND: sudo-1.8.6p3-12
FOUND: libidn-1.18-2
FOUND: gmp-4.3.1-7
FOUND: /usr/lib64/libstdc++.so.6
Checking for suggested prerequisites…
FOUND: perl-5.10.1
FOUND: sysstat
FOUND: sqlite
Prerequisite check complete.
Checking for installable packages
Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy
Select the packages to install
Install zimbra-ldap [Y] Y
Install zimbra-logger [Y] Y
Install zimbra-mta [Y] Y
Install zimbra-snmp [Y] n
Install zimbra-store [Y] Y
Install zimbra-apache [Y] Y
Install zimbra-spell [Y] y
Install zimbra-memcached [N] n
Install zimbra-proxy [N] n
Checking required space for zimbra-core
Checking space for zimbra-store
Installing:
zimbra-core
zimbra-ldap
zimbra-logger
zimbra-mta
zimbra-snmp
zimbra-store
zimbra-apache
zimbra-spell
zimbra-memcached
zimbra-proxy
The system will be modified. Continue? [N] Y
Removing /opt/zimbra
Removing zimbra crontab entry…done.
Cleaning up zimbra init scripts…done.
Cleaning up /etc/ld.so.conf…done.
Cleaning up /etc/security/limits.conf…done.
Finished removing Zimbra Collaboration Server.
Installing packages
zimbra-core……zimbra-core-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-ldap……zimbra-ldap-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-logger……zimbra-logger-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-mta……zimbra-mta-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-snmp……zimbra-snmp-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-store……zimbra-store-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-apache……zimbra-apache-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-spell……zimbra-spell-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-memcached……zimbra-memcached-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
zimbra-proxy……zimbra-proxy-8.0.4_GA_5737.RHEL6_64-20130524120036.x86_64.rpm…done
Operations logged to /tmp/zmsetup.12152013-081656.log
Installing LDAP configuration database…done.
Setting defaults…No results returned for A lookup of zimbra.kesariinfotech.com
Checked nameservers:
ip address
ip address
No results returned for AAAA lookup of zimbra.kesariinfotech.com
Checked nameservers:
ip address
ip address
DNS ERROR resolving Domain Name
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] no
DNS ERROR resolving MX for Mail Sever Name
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
Create domain: [Domain NameDomain Name
DNS ERROR resolving MX for Domain Name
It is suggested that the domain name have an MX record configured in DNS
Re-Enter domain name? [Yes] no
done.
Checking for port conflicts
Note port 80 should not be in use if Apache is already running please stop Apache service.
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
+Create Admin User: yes
+Admin user to create: admin@Domain Name
******* +Admin Password UNSET
+Anti-virus quarantine user: virus-quarantine.q1nij5qjun@Domain Name
+Enable automated spam training: yes
+Spam training user: spam.a4bqznpxlq@Domain Name
+Non-spam(Ham) training user: ham.n8ucqdfyt@Domain Name
+SMTP host: Mail Server Name
+Web server HTTP port: 80
+Web server HTTPS port: 443
+Web server mode: https
+IMAP server port: 143
+IMAP server SSL port: 993
+POP server port: 110
+POP server SSL port: 995
+Use spell check server: yes
+Spell server URL: http://Domain Name:7780/aspell.php
+Configure for use with mail proxy: FALSE
+Configure for use with web proxy: FALSE
+Enable version update checks: TRUE
+Enable version update notifications: TRUE
+Version update notification email: admin@Domain Name
+Version update source email: admin@Domain Name
4) zimbra-mta: Enabled
5) zimbra-logger: Enabled
6) zimbra-spell: Enabled
7) 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) 3
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@Domain Name
** 4) Admin Password UNSET
5) Anti-virus quarantine user: virus-quarantine.q1nij5qjun@Domain Name
6) Enable automated spam training: yes
7) Spam training user: spam.a4bqznpxlq@Domain Name
8) Non-spam(Ham) training user: ham.n8ucqdfyt@Domain Name
9) SMTP host: Mail Server Name
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://Domain Name:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@Domain Name
24) Version update source email: admin@Domain Name
NOte : – Set Admin Password
Select, or ‘r’ for previous menu [r] 4
Note :- Set Admin Password
Password for admin@Domain Name (min 6 characters): [BCoe0K5um] password
Store configuration
1) Status: Enabled
2) Create Admin User: yes
3) Admin user to create: admin@Domain Name
4) Admin Password set
5) Anti-virus quarantine user: virus-quarantine.q1nij5qjun@Domain Name
6) Enable automated spam training: yes
7) Spam training user: spam.a4bqznpxlq@Domain Name
8) Non-spam(Ham) training user: ham.n8ucqdfyt@Domain Name
9) SMTP host: Mail Server Name
10) Web server HTTP port: 80
11) Web server HTTPS port: 443
12) Web server mode: https
13) IMAP server port: 143
14) IMAP server SSL port: 993
15) POP server port: 110
16) POP server SSL port: 995
17) Use spell check server: yes
18) Spell server URL: http://Domain Name:7780/aspell.php
19) Configure for use with mail proxy: FALSE
20) Configure for use with web proxy: FALSE
21) Enable version update checks: TRUE
22) Enable version update notifications: TRUE
23) Version update notification email: admin@Domain Name
24) Version update source email: admin@Domain Name
Select, or ‘r’ for previous menu [r] r
Main menu
1) Common Configuration:
2) zimbra-ldap: Enabled
3) zimbra-store: Enabled
4) zimbra-mta: Enabled
5) zimbra-logger: Enabled
6) zimbra-spell: Enabled
7) Default Class of Service Configuration:
r) Start servers after configuration yes
s) Save config to file
x) Expand menu
q) Quit
*** CONFIGURATION COMPLETE – press ‘a’ to apply
Select from menu, or press ‘a’ to apply config (? – help) a
Save configuration data to a file? [Yes] yes
Save config in file: [/opt/zimbra/config.14392]
Saving config in /opt/zimbra/config.14392…done.
The system will be modified – continue? [No] yes
Operations logged to /tmp/zmsetup.07202015-184420.log
Setting local config values…done.
Initializing core config…Setting up CA…done.
Deploying CA to /opt/zimbra/conf/ca …done.
Creating SSL zimbra-store certificate…done.
Creating new zimbra-ldap SSL certificate…done.
Creating new zimbra-mta SSL certificate…done.
Installing mailboxd SSL certificates…done.
Installing MTA SSL certificates…done.
Installing LDAP SSL certificate…done.
Initializing ldap…done.
Setting replication password…done.
Setting Postfix password…done.
Setting amavis password…done.
Setting nginx password…done.
Creating server entry for Domain Name…done.
Setting Zimbra IP Mode…done.
Saving CA in ldap …done.
Saving SSL Certificate in ldap …done.
Setting spell check URL…done.
Setting service ports on Mail Server Name…done.
Adding Mail Server Name to zimbraMailHostPool in default COS…done.
Setting zimbraFeatureTasksEnabled=TRUE…done.
Setting zimbraFeatureBriefcasesEnabled=FALSE…done.
Setting MTA auth host…done.
Setting TimeZone Preference…done.
Initializing mta config…done.
Setting services on Mail Server Name…done.
Creating domain Domain Name…done.
Setting default domain name…done.
Creating domain Domain Name…already exists.
Creating admin account admin@Domain Name…done.
Creating root alias…done.
Creating postmaster alias…done.
Creating user spam.a4bqznpxlq@Domain Name…done.
Creating user ham.n8ucqdfyt@Domain Name…done.
Creating user virus-quarantine.q1nij5qjun@Domain Name…done.
Setting spam training and Anti-virus quarantine accounts…done.
Initializing store sql database…done.
Setting zimbraSmtpHostname for Mail Server Name…done.
Setting up syslog.conf…done.
Starting servers…done.
Installing common zimlets…
com_zimbra_ymemoticons…done.
com_zimbra_attachmail…done.
com_zimbra_email…done.
com_zimbra_bulkprovision…done.
com_zimbra_attachcontacts…done.
com_zimbra_date…done.
com_zimbra_cert_manager…done.
com_zimbra_phone…done.
com_zimbra_url…done.
com_zimbra_tooltip…done.
com_zimbra_adminversioncheck…done.
com_zimbra_webex…done.
com_zimbra_clientuploader…done.
com_zimbra_proxy_config…done.
com_zimbra_srchhighlighter…done.
com_zimbra_viewmail…done.
Finished installing common zimlets.
Restarting mailboxd…done.
Creating galsync account for default domain…done.
You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
The VERSION of zcs installed (8.0.4_GA_5737_RHEL6_64)
The ADMIN EMAIL ADDRESS created (admin@Domain Name)
Notify Zimbra of your installation? [Yes] no
A Yes/No answer is required
You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
The VERSION of zcs installed (8.0.4_GA_5737_RHEL6_64)
The ADMIN EMAIL ADDRESS created (admin@Domain Name)
Notify Zimbra of your installation? [Yes] no
Notification skipped
Setting up zimbra crontab…done.
Moving /tmp/zmsetup.07202015-184420.log to /opt/zimbra/log
Configuration complete – press return to exit
  1. check zimbra status
    su – zimbra
    zmcontrol status
Note:- If you have DNS server, don’t uncheck * Enable DNS lookups*
13.Go to admin colsole
click on configure opton
then click on Global Settings
then click on MTA option
uncheck TLS authentication only
uncheck Enable DNS lookups option


June 14, 2016

Creating an HTTP Proxy Using Squid on CentOS 6.4 with user authentication

Installing Squid

  1. Squid is available in the CentOS repositories. To ensure your system is up-to-date and install Squid run the following commands:
    sudo yum update
    sudo yum install squid
  2. Copy the original configuration file to keep as a backup:
    sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.default

Configuring Squid as an HTTP proxy

Squid Proxy can be used as an HTTP proxy to bypass local network restrictions, or mask your true location to the world.

Basic Setup

This section covers the easiest way to use Squid as an HTTP proxy, using only the client IP address for authentication.
  1. Edit the Squid configuration file and add the following lines:
    /etc/squid/squid.conf
    acl client src 12.34.56.78 # Home IP http\_access allow client

Be sure to replace client with a name identifying the connecting computer, and 12.34.56.78 with your local IP address. The comment # Home IP isn’t required, but comments can be used to help identify clients.
  1. Once you’ve saved and exited the file, start Squid:
    sudo service squid restart
  2. At this point you can configure your local browser or operating system’s network settings to use your Linode as an HTTP proxy. How to do this will depend on your choice of OS and browser. Once you’ve made the change to your settings, test the connection by pointing your browser at a website that tells you your IP address, such as ifconfigWhat is my IP, or by Googling What is my ip.
  3. Additional clients can be defined by adding new acl lines to /etc/squid/squid.conf. Access to the proxy is granted by adding the name defined by each acl to the http_access allow line.

Advanced Authentication

The following configuration allows for authenticated access to the Squid proxy service using usernames and passwords.
  1. You will need the htpasswd utility. If you’ve installed Apache on your Linode, you will already have it. Otherwise run:
    sudo yum install httpd-tools
  2. Create a file to store Squid users and passwords, and change ownership:
    sudo touch /etc/squid/squid_passwd
    sudo chown squid /etc/squid/squid_passwd
  3. Create a username password pair:
    sudo htpasswd /etc/squid/squid_passwd user1
    Replace user1 with a username. You will be prompted to create a password for this user:
    New password:
    Re-type new password:
    Adding password for user user1
    You can repeat this step at any time to create new users.
  4. Edit the Squid configuration file and add the following lines:
    File/etc/squid/squid.conf
    auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/squid_passwd
    acl ncsa_users proxy_auth REQUIRED
    http_access allow ncsa_users
  5. Once you’ve saved and exited the file, restart Squid:
    sudo service squid restart
  6. At this point, you can configure your local browser or operating system’s network settings to use your Linode as an HTTP proxy. You will need to specify that the server requires authentication, and provide the username and password. How to do this will depend on your choice of OS and browser. Once you’ve made the settings change, test the connection by pointing your browser at a website that tells you your IP address, such as ifconfigWhat is my IP, or by Googling What is my ip.
  7. To remove a user’s access to the proxy, you must delete their entry in the squid_passwd file. Each user is represented in the file on a single line in the format of user:passwordhash :
    /etc/squid/squid_passwd
    user1:gh48gfno user2:9b83v5hd
    If you are using Nano, the command Control+k will remove the entire line where the cursor rests. Once you’ve saved and exited the file, restart Squid:
    sudo service squid restart

Anonymizing Traffic

In order to mask your IP address from servers you connect to, you will need to add the following lines to the Squid configuration file.
file /etc/squid/squid.conf
forwarded_for off
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
Once you’ve saved and exited the file, restart Squid:
sudo service squid restart

June 14, 2016

Install iRedMail on Red Hat Enterprise Linux, CentOS

Enter command hostname -f to view the current hostname:
$ hostname -f
mx.example.com
On RHEL/CentOS/Scientific Linux, hostname is set in two files:
  • For RHEL/CentOS/Scientific Linux 6, hostname is defined in /etc/sysconfig/network:
HOSTNAME=mx.example.com
For RHEL/CentOS/Scientific Linux 7, hostname is defined in /etc/hostname.
mx.example.com
  • /etc/hosts: hostname <=> IP address mapping. Warning: List the FQDN hostname as first item.
127.0.0.1   mx.example.com mx localhost localhost.localdomain
Verify the FQDN hostname. If it wasn't changed, please reboot server to make it work.
$ hostname -f
mx.example.com

Disable SELinux.

iRedMail doesn't work with SELinux, so please disable it by setting below value in its config file /etc/selinux/config. After server reboot, SELinux will be completely disabled.
SELINUX=disabled
If you prefer to let SELinux prints warnings instead of enforcing, you can set below value instead:
SELINUX=permissive
Disable it immediately without rebooting your server.
# setenforce 0

Enable yum repositories for installing new packages

  • For CentOS or Scientific Linux, please enable CentOS/Scientific official yum repositories, and DISABLE all third-party yum repositories to avoid package conflict.
  • For Red Hat Enterprise Linux, please enable Red Hat Network to install packages, or create a local yum repository with DVD/CD ISO images.
  • Download the latest release of iRedMail

    • Visit Download page to get the latest stable release of iRedMail.
  • Uncompress iRedMail tarball:
  • # cd /root/
    # tar xjf iRedMail-x.y.z.tar.bz2
    

    Start iRedMail installer

    It's now ready to start iRedMail installer, it will ask you several simple questions, that's all required to setup a full-featured mail server.
    # cd /root/iRedMail-x.y.z/
    # bash iRedMail.sh
    
    Note to Chinese Users
    Our domain name iredmail.org has been blocked in mainland China for years (since Jun 04, 2011), please run command below to finish the installation:
    IREDMAIL_MIRROR='http://42.159.241.31' bash iRedMail.sh
    Additional variables are:
    • EPEL repo: IREDMAIL_EPEL_MIRROR='http://mirrors.aliyun.com/epel'
    • SOGo repo: SOGO_PKG_MIRROR='http://42.159.241.31/SOGo'

    Screenshots of installation:

    • Welcome and thanks for your use

  • Specify location to store all mailboxes. Default is /var/vmail/.


  • Choose backend used to store mail accounts. You can manage mail accounts with iRedAdmin, our web-based iRedMail admin panel.
Note
There's no big difference between available backends, so it's strongly recommended to choose the one you're familiar with for easier management and maintenance after installation.
  • If you choose to store mail accounts in OpenLDAP, iRedMail installer will ask to set the LDAP suffix.

To MySQL/MariaDB/PostgreSQL users
If you choose to store mail accounts in MySQL/MariaDB/PostgreSQL, iRedMail installer will generate a random, strong password for you. You can find it in file iRedMail.tips.
  • Add your first mail domain name

  • Set password of admin account of your first mail domain.
Note: This account is an admin account and a mail user. That means you can login to webmail and admin panel (iRedAdmin) with this account, login username is full email address.

  • Choose optional components

After answered above questions, iRedMail installer will ask you to review and confirm to start installation. It will install and configure required packages automatically. Type y or Y and press Enter to start.


Read file /root/iRedMail-x.y.z/iRedMail.tips first, it contains:
  • URLs, usernames and passwords of web-based applications
  • Location of mail service related software configuration files

Access webmail and other web applications

After installation successfully completed, you can access web-based programs if you choose to install them. Replace your_server below by your real server hostname or IP address.