Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday 25 December 2016

Install & Configure SSHFS on CentOS/RHEL/Ubuntu

Install & Configure SSHFS on CentOS/RHEL/Ubuntu


Q. What is SSHFS ?

-- SSHFS is a Filesystem Based on the SSH File Transfer Protocol (SFTP). On remote side we just need to Install SSH Server, Since most of SSH Servers already support this, there are nothing to do on Remote Server except Installing SSH Server. On Client Side we need to Install "fuse sshfs" Packages to Mount Remote Filesystem. Newer Version of SSHFS uses FUSE. We Can use it as Alternative of NFS.

Features of SSHFS:

1. Based on FUSE (Best userspace Filesystem Framework for Linux).
2. Multithreading: more than one request can be on it’s way to the server.
3. Allowing large reads (max 64k).
4. Caching Directory Contents.

Scenario :
=======

10.100.97.39    ser3.domain.com    (SSHFS Server)
10.100.97.40    ser4.domain.com    (SSHFS Client)

Step: 1. Bind Host File (on Both Server) :

# vi /etc/hosts

10.100.97.39    ser3.domain.com    ser3
10.100.97.40    ser4.domain.com    ser4

-- Save & Quit (:wq)

Step: 2. Stop the IPTables & Disable Selinux (on Both Server) :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Update the Date Time on the Server (on Both Server) :

For CentOS User :

# yum -y install ntp
# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on

For Ubuntu User :

# apt-get -y install ntp
# service ntp restart
# ntpdate pool.ntp.org

Step: 4. Reboot the System :

# init 6

Step: 5. Install FUSE-SSHFS (on Both Server) :

Note: For CentOS/RHEL users, Fuse SSHFS is Available under EPEL Repository, So make sure you have Install EPEL Repository in your System.

For CentOS/RHEL User :

# yum -y install epel-release
# yum -y install fuse-sshfs

For Ubuntu & Dabian User :

$ sudo apt-get update
$ sudo apt-get -y install sshfs

Step: 6. Mount Remote Directory (on Client SSHFS Server) :

Note: Lets mount Remote Server Directory using sshfs, make sure remote system has running SSH Server with proper SSH Connectivity from your System.

First Create a Mount Point :

# mkdir /mntssh

Lets Mount the Remote Directory. For this Example we are Mounting /home/remoteuser Directory from 10.100.97.39 (ser3.domain.com) System to our Local System.

# sshfs root@ser3.domain.com:/home/remoteuser /mntssh

[Sample Output]

The authenticity of host 'ser3.domain.com (10.100.97.39)' can't be established.
RSA key fingerprint is 90:41:70:63:04:60:31:84:34:b8:38:21:50:32:86:dd.
Are you sure you want to continue connecting (yes/no)? yes
root@ser3.domain.com's password: Remote Server Root Password Here.

Step: 7. Verify Mount (on Client SSHFS Server) :

After Mounting Remote Filesystem on Local Mount Point (/mntssh), Verify it by Running Mount Command.

# mount

/dev/xvda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/xen type xenfs (rw)
root@ser3.domain.com:/home/remoteuser on /mntssh type fuse.sshfs (rw,nosuid,nodev)

Also Navigate to your Mount Point, you will see Files there from Remote System.

# cd /mntssh
# ls

Step: 8. Mount Directory on System Boot :

Note: If you want to Mount Remote Filesystem Automatically each time when your System Reboots, Add following Entry :

# vi /etc/fstab

root@ser3.domain.com:/home/remoteuser /mntssh fuse.sshfs defaults 0 0

-- Save & Quit (:wq)

Note: Make sure you have have key based ssh Setup between Remote & Local System. Otherwise Fstab Fail to Mount the Remote Filesystem.

Step: 9. SSH Key Based Authentication Setup (On Both Server) :

On Ser3 (10.100.97.39) :

# ssh-keygen -t rsa
# ssh-keygen -t dsa
# cd /root/.ssh
# cat id_rsa.pub >> authorized_keys
# cat id_dsa.pub >> authorized_keys
# scp authorized_keys root@ser4.domain.com:/root/.ssh/

On Ser4 (10.100.97.40) :

# ssh-keygen -t rsa
# ssh-keygen -t dsa
# cd /root/.ssh
# cat id_rsa.pub >> authorized_keys
# cat id_dsa.pub >> authorized_keys
# scp authorized_keys root@ser3.domain.com:/root/.ssh/

Step: 10. Now lets Test if Both Servers can SSH each other without Password or not :

On Ser3 (10.100.97.39) :

[root@ser3 ~]# ssh ser4
Last login: Wed Aug 10 15:32:06 2016 from 10.100.97.39
[root@ser4 ~]# exit

[root@ser3 ~]# ssh ser4 date
Wed Aug 10 15:32:16 IST 2016

On Ser4 (10.100.97.40) :

[root@ser4 ~]# ssh ser3
Last login: Wed Aug 10 15:32:06 2016 from 10.100.97.40
[root@ser3 ~]# exit

[root@ser4 ~]# ssh ser3 date
Wed Aug 10 15:32:06 2016 IST 2016

Step: 11. Unmount Directory :

If your work is over & you don’t Need anymore the mounted Directory, Simply unmount is using Following command.

# umount /mntssh

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Sunday 18 December 2016

How To Install Oracle 12c on RHEL/CentOS 6x

How To Install Oracle 12c on RHEL/CentOS 6x


Step: 1. Stop Iptables & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 2. Restart the Server :

# init 6

Step: 3. Bind the Hosts File :

# vi /etc/hosts

192.168.100.221 db01.domain.com    db01

-- Save & Quit (:wq)

Step: 4. Set Hostname :

# vi /etc/sysconfig/network

HOSTNAME=db01.domain.com

-- Save & Quit (:wq)

# hostname db01.domain.com

Step: 5. Update the System :

# yum -y update

Step: 6. Add the Following lines in the "/etc/sysctl.conf" file :

# vi /etc/sysctl.conf

# Oracle Important Parameter :
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

-- Save & Quit (:wq)

-- To Load the Configuration :

# sysctl -p

Step: 7. Add the Following lines to the "/etc/security/limits.conf" file :

# vi /etc/security/limits.conf

# Oracle Important Parameter :
oracle   soft   nofile     1024
oracle   hard   nofile    65536
oracle   soft   nproc     2047
oracle   hard   nproc   16384
oracle   soft   stack       10240
oracle   hard   stack      32768

-- Save & Quit (:wq)

Step: 8. Install the Following Required Packages for Oracle 12c :

# yum -y install binutils compat-libcap1 compat-libstdc++* gcc* glibc* ksh libgcc* libstdc++* libaio* libXext* libX11* libXau* libxcb* libXi* make sysstat unixODBC*

Or Install the Package One by One :

# yum -y install binutils
# yum -y install compat-libcap1
# yum -y install compat-libstdc++-33
# yum -y install compat-libstdc++-33.i686
# yum -y install gcc
# yum -y install gcc-c++
# yum -y install glibc
# yum -y install glibc.i686
# yum -y install glibc-devel
# yum -y install glibc-devel.i686
# yum -y install ksh
# yum -y install libgcc
# yum -y install libgcc.i686
# yum -y install libstdc++
# yum -y install libstdc++.i686
# yum -y install libstdc++-devel
# yum -y install libstdc++-devel.i686
# yum -y install libaio
# yum -y install libaio.i686
# yum -y install libaio-devel
# yum -y install libaio-devel.i686
# yum -y install libXext
# yum -y install libXext.i686
# yum -y install libXtst
# yum -y install libXtst.i686
# yum -y install libX11
# yum -y install libX11.i686
# yum -y install libXau
# yum -y install libXau.i686
# yum -y install libxcb
# yum -y install libxcb.i686
# yum -y install libXi
# yum -y install libXi.i686
# yum -y install make
# yum -y install sysstat
# yum -y install unixODBC
# yum -y install unixODBC-devel

Step: 9. Create the new groups & users for Oracle :

# groupadd dba
# useradd -g dba oracle

Step: 10. Edit the "/etc/security/limits.d/90-nproc.conf" file :

# vi /etc/security/limits.d/90-nproc.conf

# Change this :
*          soft    nproc    1024

# To this :
*          soft    nproc    16384

-- Save & Quit (:wq)

Step: 11. Create the Directories in which the Oracle Software will be Installed :

# mkdir -p /u01/app/oracle/product/12.1.0/db_1
# chown -Rf oracle:dba /u01
# chmod -Rf 775 /u01

Step: 12. Configure the .bash_profile for Oracle :

# su - oracle
$ vi .bash_profile

-- Add the Following Lines at the End of the file :

# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=db01.domain.com
export ORACLE_UNQNAME=oradb
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=oradb

export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

-- Save & Quit (:wq)

$ . .bash_profile
$ exit

-- Copy the Software of Oracle 12c (in zip) in to '/u01' location using Winscp.

# cd /u01
# unzip linuxamd64_12102_database_1of2.zip
# unzip linuxamd64_12102_database_2of2.zip
# chmod -Rf 777 database
# chown -Rf oracle:dba database
# ll

[OUTPUT]
drwxrwxrwx 7 oracle dba        4096 Jul  7 20:09 database

Open Xmanager & do the following Step :

Click New -> Give Session Name -> OK -> Host: (192.168.100.221) -> Protocaol: (SSH) -> User Name: (root) -> Click on Password Setup -> Give Password -> Check on Save Password -> OK -> Command: (xterm -ls -display $DISPLAY) -> Click on Save -> Run.

# su - oracle

Start the Oracle Universal Installer (OUI) by issuing the following command in the Database Directory.
$ sh /u01/database/runInstaller

-- Email (leave blank)
-- Uncheck I Wish to receive security updates vi My Oracle Support.
-- Click "Next"
-- Yes
-- Choose Install database Software Only.
-- Click "Next"
-- Choose Single Instance Database Installtion
-- Click "Next"
-- Add Language (English)
-- Click "Next"
-- Choose Enterprise Edition
-- Click "Next"
-- Oracle Base: /u01/app/oracle
-- Software Location: /u01/app/oracle/product/12.1.0/db_1
-- Click "Next"
-- Inventory Ditectory: /u01/app/oraInventory
-- Ora Inventory Group Name: dba
-- Click "Next"
-- Click "Next"
-- Check on "Ignore All"
-- Click "Next"
-- Yes
-- Click On "Install"

Note: after installation the s/w run the two scripts genrated by system on root user.

# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/12.1.0/db_1/root.sh

OK -> Close.

Create Database using dbca with the help of xmanager.

# su - oracle
$ dbca

-- Choose "Create Database"
-- Click "Next"
-- Advanced Mode
-- Click "Next"
-- Choose General Purpose or Transaction Processing
-- Click "Next"
-- Global Database Name: oradb
-- Click "Next"
-- Click "Next"
-- Choose Use the Same Administrative Password for All Account
-- Give Password
-- Click "Next"
-- Click "Next"
-- Click "Next"
-- Check "Sample Schemas"
-- Click "Next"
-- Memory Size: (Upto 75-80%)
-- Click "Next"
-- Click "Next"
-- Finally Click "Finish".
-- Close.

Note: If Facing any Memory_Target related error then do the following :

-- Increase Temp Size :

# df -h
# mount -o remount,size=1G /dev/shm
# df -h
# vi /etc/fstab

tmpfs  /dev/shm  tmpfs  defaults,size=1G  0 0

-- Save & Quit (:wq)

# mount -a

After this do the Above Step to Create a Database.

# su - oracle

To View the Database :

# cat /etc/oratab

oradb:/u01/app/oracle/product/12.1.0/db_1:N

$ sqlplus / as sysdba

To Start the Database :

SQL> startup

ORACLE instance started.

Total System Global Area  413372416 bytes
Fixed Size                                     2289016 bytes
Variable Size                              335544968 bytes
Database Buffers                    71303168 bytes
Redo Buffers                             4235264 bytes
Database mounted.
Database opened.
SQL>

To Check The Oracle Version :

SQL> select version from v$instance;

VERSION
------------
12.1.0.2.0

To Shutdown the Database :

SQL> shutdown immediate

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday 10 December 2016

Install & Configure Drupal 7 with MongoDB on CentOS/RHEL 6x

Install & Configure Drupal 7 with MongoDB on CentOS/RHEL 6x


Q. What is Drupal?

-- Drupal is content management software. The application includes a content management platform and a development framework. It's used to make many of the websites and applications you use every day. Drupal has great standard features, like easy content authoring, reliable performance, and excellent security.

Step: 1. Bind Hosts File :

# vi /etc/hosts

10.100.99.214           drupal.domain.com    drupal

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP Server (for Time Syncronization) :

# yum -y install ntp
# service ntpd restart
# chkconfig ntpd on
# ntpdate pool.ntp.org

Step: 4. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 5. Install PHP 5.6 :

# yum -y install epel-release
# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# yum -y install php56w php56w-cli php56w-devel php56w-common php56w-mbstring \
    php56w-gd php56w-xml php56w-mcrypt php56w-mysqlnd php56w-imap php56w-pdo \
    php56w-snmp php56w-soap php56w-xmlrpc php56w-opcache php56w-iconv \
    php56w-ldap php56w-pear mod_ssl wget

Step: 6. Install MySQL Server 5.6 :

# rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# yum -y install mysql mysql-server

Step: 7. Finally Restart the Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 8. Start MySQL Service & Set Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 9. Create Database for Drupal :

# mysql -u root -p
Enter Password:

mysql> create database drupaldb;
mysql> grant all privileges on drupaldb.* to drupal@localhost identified by 'password';
mysql> grant all privileges on drupaldb.* to drupal@'%' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 10. Download & Extract Drupal Source Code :

# cd /var/www/html/
# wget http://ftp.drupal.org/files/projects/drupal-7.50.tar.gz
# tar -zxvf drupal-7.50.tar.gz
# mv drupal-7.50 drupal
# chown -Rf apache:apache /var/www/html/drupal

Step: 11. We need to Create Settings file from the default.settings.php File :

# cd /var/www/html/drupal/sites/default/
# cp -p default.settings.php settings.php
# chmod a+w /var/www/html/drupal/sites/default/settings.php
# chmod a+w /var/www/html/drupal/sites/default/

Step: 12. Enable Apache mod_rewrite Module & Set Date-Time In php.ini :

# vi /etc/httpd/conf/httpd.conf

Line No: 338

AllowOverride None To AllowOverride All

At the End, Add this Line :

RewriteEngine on

-- Save & Quit (:wq)

# vi /etc/php.ini

date.timezone = "Asia/Kolkata"

-- Save & Quit (:wq)

# service httpd restart

Step: 13. Install Drupal Through Web Browser :

http://10.100.99.214/drupal/core/install.php

-- Choose Profile: Standard & Clcik on "Save & Continue"
-- Choose Language: English & Click on "Save & Continue"
-- Database Configuration:
     Database Type: Select "MySQL, MariaDB, Percona Server, or equivalent"
     Database Name: drupaldb
     Database Username: drupal
     Database Password: password
  
-- Clcik on "Save & Continue".
-- SITE INFORMATION:
     Site Name: drupal.domain.com
     Site Email Address: koushik@domain.com
-- SITE MAINTENANCE ACCOUNT:
     Username: admin
     Password: Passw0rd
     Confirm Password: Passw0rd
-- REGIONAL SETTINGS:
     Default Country: India
-- Click on "Save & Continue"
-- Click on "View Your New Site."

Step: 14. Install & Configure MongoDB :

# vi /etc/yum.repos.d/mongodb.repo

[mongodb]
name=MongoDB Repo
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

-- Save & Quit (:wq)

# yum -y install mongo-10gen mongo-10gen-server

# vi /etc/mongod.conf

## Change Line Number 19 "bind_ip"

bind_ip=0.0.0.0

-- Save & Quit (:wq)

# service mongod restart
# chkconfig mongod on

Step: 15. Install MongoDB Driver :

# yum -y install gcc openssl-devel
# pecl install mongo

Build with Cyrus SASL (MongoDB Enterprise Authentication) support? [no] : Just Press Enter.

Step: 16. Add the Extension in php.ini File :

# vi /etc/php.d/mongo.ini

extension=mongo.so

-- Save & Quit (:wq)

Step: 17. Finally Restart the Apache Service & Verify :

# service httpd restart

# php -i | grep mongo

Step: 18. Install MongoDB Module in Drupal :

# cd /opt
# wget http://ftp.drupal.org/files/projects/mongodb-7.x-1.x-dev.tar.gz
# tar -zxvf mongodb-7.x-1.x-dev.tar.gz
# mv mongodb /var/www/html/drupal/sites/all/modules/
# chown -Rf apache:apache /var/www/html/drupal/sites/all/modules/mongodb
# cd /var/www/html/drupal/sites/default
# vi local.settings.php

<?php
# MongoDB
$conf['mongodb_connections'] = array(
     'default' => array(
       'host' => 'localhost',                   
       'db' => 'drupal', // Database name. Mongodb will automatically create the database.
       'connection_options' => array( 'replicaSet' => 'my_mongodb_0' ),
      ),
   );

include_once('./includes/cache.inc');

   # -- Configure Cache
   $conf['cache_backends'][] = 'sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc';
   $conf['cache_class_cache'] = 'DrupalMongoDBCache';
   $conf['cache_class_cache_bootstrap'] = 'DrupalMongoDBCache';
   $conf['cache_default_class'] = 'DrupalMongoDBCache';

   # -- Don't touch SQL if in Cache
   $conf['page_cache_without_database'] = TRUE;
   $conf['page_cache_invoke_hooks'] = FALSE;

   # Session Caching
   $conf['session_inc'] = 'sites/all/modules/mongodb/mongodb_session/mongodb_session.inc';
   $conf['cache_session'] = 'DrupalMongoDBCache';

   # Field Storage
   $conf['field_storage_default'] = 'mongodb_field_storage';

   # Message Queue
   $conf['queue_default_class'] = 'MongoDBQueue';
?>

-- Save & Quit (:wq)

# chown apache:apache local.settings.php
# chmod 644 local.settings.php

# sed -i 's|localhost|10.100.99.214|g' /var/www/html/drupal/sites/all/modules/mongodb/mongodb.module
# sed -i 's|localhost|10.100.99.214|g' /var/www/html/drupal/sites/all/modules/mongodb/mongodb.drush.inc

http://10.100.99.214/drupal/admin/modules

Note: Now Open the Admin Panel of Drupal & Uncheck the "Block" & "Dashboard" from the Modules & Check all the Modules of MongoDB Section except "MongoDB Cache" & "MongoDB Migrate".

-- Click on "Save Configuration."

# mongo
mongo> show dbs
admin   (empty)
drupal  0.078GB
local   0.078GB

mongo> use drupal
mongo> show collections

session
system.indexes
watchdog
watchdog_event_3f71fc116d395612bd0b3dd8e022dc09
watchdog_event_782ddf217853242a4f40f642a4792b9e
watchdog_event_d29d18b2c99dc1af6e22838feee53c62

mongo> exit

** That mean the MongoDB has been Successfully Integrated with the Drupal.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Sunday 4 December 2016

How to Configure WaypointHR on RHEL/Centos 6x

How to Configure WaypointHR on RHEL/Centos 6x


Q. What is WaypointHR?
 
-- WaypointHR provides a flexible Human Resource Information System (HRIS) developed by HR-Fundamentals ltd. Managing employee records and personal information - WaypointHR. It is an HR database that features a PHP based web-interface and a MySQL database. Effective management reports and ease of use are the major focus of this HR software. WaypointHR is available in two version the free one and On-Demand.

Requirements :

1. MySQL 4.1 or MySQL 5.
2. PHP 5.
3. MySQLi & InnoDB recommended.

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.100.220 hr.domain.com    hr

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Iptables :

 # vi /etc/sysconfig/selinux

 SELINUX=disabled

 -- Save & Quit (:wq)
 
# service iptables stop
# chkconfig iptables off

# init 6

Step: 3. Install EPEL Repo :

# cd /tmp
# wget wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
Or
# yum -y install epel-release


Step: 4. Install Apache Server :


# yum -y install httpd httpd-devel wget

Step: 5. Restart Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 6. Install MySQL Database Server :

# yum -y install mysql mysql-server mysql-devel

Step: 7. Start Mysql Service :

# service mysqld restart
# chkconfig mysqld on

Step: 8. Set Mysql Root Password :

# mysql_secure_installation

Step: 9. Install PHP5 Scripting Language :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
    php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap mod_ssl

Step: 10. Create Database For WaypointHR :

# mysql -u root -p
Enter Password:

mysql> create database waypoint;
mysql> grant all on waypoint.* to waypoint@'localhost' identified by 'redhat123G';
mysql> grant all on waypoint.* to waypoint@'%' identified by 'redhat123G';
mysql> flush privileges;
mysql> exit

Step: 11. Download WaypointHR Tar File :

# cd /var/www/html
# wget http://kaz.dl.sourceforge.net/project/waypointhr/waypointhr/0.3_Alpha_5/WaypointHR_Release_0.3_Alpha_5.tar.gz
# tar -zxvf WaypointHR_Release_0.3_Alpha_5.tar.gz

Step: 12. Configure WaypointHR for Apache :


# vi /etc/httpd/conf/httpd.conf

<Directory /var/www/html/waypointhr>
        Options -Indexes +Multiviews +FollowSymLinks
        DirectoryIndex index.php index.html
        AllowOverride All
        Allow from all
</Directory>

-- Save & Quit (:wq)

Step: 13. Restart httpd Service :

# service httpd restart

Step: 14. Point Your Web Browser :

http://192.168.100.220/waypointhr

-- Click on Continue with Installation.
-- Click on Continue with Installation.
-- Database Creation :
     Server name: localhost
     Server port: 3306
     Schema: waypoint
     Table prefix: whr_
     Username: waypoint
     Password: redhat123G

-- Finally Click on Create Database.

-- Click on 'Click Here'

Username: admin
Password: admin

Note: By default username: admin, pass: admin

Step: 15. Reset WaypointHR Admin Password :

# cd /var/www/html/waypointhr/
# vi reset.php

Find this Line:

// reset_admin_password('newpassword');

Delete // and Set you admin password.

reset_admin_password('Passw0rd');

-- Save & Quit (:wq)

Now Open Your Web Browser & Type :

http://192.168.100.220/waypointhr/reset.php

Your admin password has been reset. Please edit the reset.php file the return to WaypointHR login as normal.

# vi reset.php

Find this Line:
reset_admin_password('Passw0rd');

and Change To :

// reset_admin_password('newpassword');

-- Save & Quit (:wq)

 Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday 19 November 2016

How to Install & Configure PXE Boot Server on CentOS/RHEL 6x

How to Install & Configure PXE Boot Server on CentOS/RHEL 6x


Q. What is PXE Boot Server ?

-- PXE Server, stands for preboot Execution Environment, is used to Enable a Network Computer to boot only from a Network interface card.

PXE Environment needs Following Services :

1. DHCP server that distributes the IP addresses to the client systems.
2. TFTP Server which makes bootable images available to be downloaded via network using
    Trivial File Transfer Protocol (TFTP).
3. Syslinux package which provides bootloaders for network booting.
4. http/ftp (any one) which will host the local mounted mirrored DVD (RHEL/CentOS6) image,
    from where the installer will extract its required packages.

PXE Server Details :

OS: CentOS 6.5 Minimal Installation
IP Address: 192.168.1.52/24
Hostname: pxe.domain.com
SELinux Disabled on PXE Server
IPtables Stopped on PXE Server

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.1.50    pxe.domain.com    pxe

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Reboot the System :

# init 6

Step: 4. Install DHCP-Server, SYSLINUX Bootloaders, TFTP-Server, Web-Server 
                 (Apache httpd),  FTP-Server (Optional) :

# yum -y install dhcp tftp-server syslinux http ftp vsftpd

Step: 5. Configure HTTP/FTP Server :

# mkdir /var/lib/tftpboot/centos6
# mount -o loop /tmp/CentOS-6.iso /var/lib/tftpboot/centos6

# vi /etc/httpd/conf.d/pxeboot.conf

Alias /centos6 /var/lib/tftpboot/centos6
<Directory /var/lib/tftpboot/centos6>
      Options Indexes FollowSymLinks
          Order Allow,Deny
          Allow from all
</Directory>

-- Save & Quit (:wq)

# service httpd start
# chkconfig httpd on

Step: 6. Manually Browse to the Server IP & Verify if you can see all the Files :

http://192.168.1.50/centos6/

Step: 7. Enable the tftp Service in Xinetd :

# cp -r /usr/share/syslinux/* /var/lib/tftpboot/
# vi /etc/xinetd.d/tftp

service tftp
{
    socket_type       = dgram
    protocol               = udp
    wait                        = yes
    user                        = root
    server                    = /usr/sbin/in.tftpd
    server_args        = -s /var/lib/tftpboot
    disable                 = no
    per_source         = 11
    cps                          = 100 2
    flags                      = IPv4
}

-- Save & Quit (:wq)

# service xinetd start
# chkconfig xinetd on

Step: 8. Configure PXE Boot Server :

# mkdir /var/lib/tftpboot/pxelinux.cfg
# vi /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) Install CentOS 6 Edition
kernel centos6/images/pxeboot/vmlinuz
append initrd=centos6/images/pxeboot/initrd.img method=http://192.168.1.52/centos6 devfs=nomount
label 2
menu label ^2) Boot from local drive localboot

-- Save & Quit (:wq)

Step: 9. Configure DHCP Server :

# vi /etc/sysconfig/dhcpd

DHCPDARGS=eth0

-- Save & Quit (:wq)

# vi /etc/dhcp/dhcpd.conf

option domain-name "pxe.domain.com";
option domain-name-servers 192.168.1.1, 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.240 192.168.1.254;
    option routers 192.168.1.1;
    option broadcast-address 192.168.1.255;
}
allow booting;
    allow bootp;
    next-server 192.168.1.50;            # PXE Server IP Address.
    filename "pxelinux.0";

-- Save & Quit (:wq)

# service dhcpd restart
# service xinetd restart
# service httpd restart

# chkconfig dhcpd on
# chkconfig xinetd on

Note:

KERNEL - Defines the location from where the PXELINUX bootloader will load.
APPEND - Defines the location for PXE initrd image file to load.
FTP Server - There is not much Change for ftp server just replace the below line in the above file.

APPEND initrd=centos6/images/pxeboot/initrd.img method=ftp://192.168.1.6/centos6/ devfs=nomount


# mkdir /var/lib/tftpboot/centos6
OR
# mkdir /var/ftp/pub/centos6

# vi /etc/vsftpd/vsftpd.conf

anonymous_enable=YES
anon_root=/var/lib/tftpboot/centos6 # Specify the path

-- Save & Quit (:wq)

# service vsfptd restart
# chkconfig vsftpd on

ftp://192.168.1.50/centos6/

Step: 10. PXE Client Configuration :

The Client may be any System that has Network boot Enabled Option (PXE boot). You can Enable this Option in your BIOS Settings. That’s it. Now, power on the Virtual client system.

Once you have Reached PXE Menu, Choose your CentOS 6 Installation Type, hit Enter key & Continue with the Installation Procedure the same way as you might Install it from a Local Media Boot Device.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Sunday 13 November 2016

Install & Configure IT Operational Portal Using iTop On RHEL/CentOS 6x

Install & Configure IT Operational Portal Using iTop On RHEL/CentOS 6x


Q. What is iTop?

-- iTop, stands for IT Operational Portal, is an Open Source web based application for the day to day operations of an IT environment. iTop was designed with the ITIL best practices in mind but does not dictate any specific process, the application is flexible enough to adapt to your processes whether you want rather informal and pragmatic processes or a strict ITIL aligned behaviour.

  • Using iTop you can :
- Document your entire IT infrastructure assets such as servers, applications, network devices,
   virtual machines, contacts.. etc.
- Manage incidents, user requests, planned outages.
- Document IT services and contracts with external providers including service level agreements.
- Export all the information in a manual or scripted manner.
- Import or synchronize/federate any data from external systems.

  • Features :
- Fully configurable CMDB.
- HelpDesk and Incident Management.
- Service and Contract Management.
- Change Management.
- Configuration Management.
- Automatic SLA management.
- Automatic impact analysis.
- CSV import tool for all data.
- Consistency audit to check data quality.
- Data synchronization (data federation).

Configuration :

Step: 1. Install EPEL Repo :

# yum -y install epel-release

Step: 2. Install Apache Server :

# yum -y install httpd httpd-devel mod_ssl wget

Step: 3. Start Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 4. Install Mysql Server :

# yum -y install mysql mysql-server mysql-devel

Step: 5. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 6. Install PHP5 Scripting Language :


# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
   php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap \
   php-cli graphviz

Step: 7. We need to Adjust the following PHP Settings :

# vi /etc/php.ini

post_max_size = 32M

-- Save & Quit (:wq)

Step: 8. Restart Apache Server To Load the New Configuration :

# service httpd restart

Step: 9. Download & Install iTop :

# yum -y install zip unzip
# cd /var/www/html
# wget http://sourceforge.net/projects/itop/files/itop/2.0.2/iTop-2.0.2-1476.zip
# unzip iTop-2.0.2-1476.zip
# mv web itop
# rm -rf iTop-2.0.2-1476.zip INSTALL LICENSE README

Step: 10. Create the following Directory & Make them to be Writable :

# mkdir /var/www/html/itop/conf
# mkdir /var/www/html/itop/data
# mkdir /var/www/html/itop/env-production
# mkdir /var/www/html/itop/log
# chmod 777 /var/www/html/itop/conf/
# chmod 777 /var/www/html/itop/data
# chmod 777 /var/www/html/itop/env-production/
# chmod 777 /var/www/html/itop/log

Step: 11. Finally, Install iTop Using Web Browser :

http://Server_ip_address/itop

-- Click on "Continue"
-- Select "Install a New iTOP"
-- Click on "Next"
-- I Accept the Agreement.
-- Click Next
-- MySQL Sever Details :
     Server Name: localhost,
     Login: root,
     Password: redhat

Database :

Select Create a new Database: itopdb
-- Click Next.

Administrator Account :

Login: admin
Password: Passw0rd
Confirm password: Passw0rd

-- Language: English
-- Click Next.

Sample Data :

If you directly use it in production environment, then select the second option and Click Next. I want to populate my database with some demo data’s, so checked the first option.

-- Click Next.
-- Click Next.
-- Select "Service Management for Enterprises"
-- Click Next.
-- Select "ITIL Compliant Tickets Management" & Check 'User Request Management' &  
     'Incident Management'
-- Then Click Next
-- Select "ITIL Change Management"
-- Click Next.
-- Check Both Option 'Known Errors Management' & 'Problem Management'
-- Click Next.
-- Click Install.
-- Finally Click on Enter iTop.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday 5 November 2016

Install & Configure Joomla on CentOS/RHEL 6x

Install & Configure Joomla on CentOS/RHEL 6x


Q. What is Joomla?

-- Joomla is a popular Open Source Content Management System (CMS) tool which allows us to easily build dynamic website and manage online applications. It also manage & publish your website contents like video, pictures, articles on the website. Joomla is freely available, which supports huge third party plug-ins and themes. With the help of Content Management System (CMS), you can set up websites in the World Wide Web (WWW) without having knowledge of programming.

Step: 1. Set Host Name :

# hostname joomla.domain.com
# vi /etc/sysconfig/network

HOSTNAME=joomla.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Hosts File :


# vi /etc/hosts

10.100.99.214           joomla.domain.com    joomla

-- Save & Quit (:wq)

Step: 3. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 4. Install NTP Server (for Time Synchronization) :

# yum -y install ntp ntpdate
# service ntpd restart
# chkconfig ntpd on
# ntpdate pool.ntp.org

Step: 5. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 6. Edit httpd.conf file :

# vi /etc/httpd/conf/httpd.conf

#ServerName www.example.com:80

-- Add this Line:

ServerName ip_address_of_server:80

-- Save & Quit (:wq)

Step: 6. Download & Extract Joomla Package :

# cd /var/www/html
# wget http://joomlacode.org/gf/download/frsrelease/18323/80367/Joomla_3.1.1-Stable-Full_Package.tar.gz
# mkdir joomla
# tar zxvf Joomla_3.1.1-Stable-Full_Package.tar.gz -C joomla/

# chmod -Rf 775 joomla

Step: 7. Edit the 'httpd.conf' File :

# vi /etc/httpd/conf/httpd.conf

-- Add those Lines :

<Directory /var/www/html/joomla>
    Options -Indexes +Multiviews
       DirectoryIndex index.php index.html
    AllowOverride All
    Allow from all
</Directory>

-- Save & Quit (:wq)

Step: 8. Install MySQL Database Server :

# yum -y install mysql mysql-server mysql-devel

Step: 9. Start MySQL Service :

# service mysqld start
# chkconfig mysqld on

Step: 10. Setup MySQL Root Password :

# mysql_secure_installation

Step: 11. Create Database & User for Joomla :

# mysql -u root -p

-- Give root Password.

Mysql> create database joomladb character set utf8;
Mysql> grant all privileges on joomla.* to joomla@'localhost' identified by 'password';
Mysql> grant all privileges on joomla.* to joomla@'%' identified by 'password';
Mysql> flush privileges;
Mysql> exit

Step: 12. Install PHP5 Scripting Language :

# yum -y install epel-release
# yum -y install php php-devel php-cli php-mysql php-common php-gd php-mbstring \
   php-mcrypt php-imap php-xml php-xmlrpc

Step: 13. Check php Configuration :

# vi /var/www/html/info.php

<?php
  phpinfo();
?>

-- Save & Quit (:wq)

Step: 14. Restart Apache to Load php :

# service httpd restart
# chkconfig httpd on

Step: 15. Then Point your Browser to http://ip_address/info.php :

Ex- http://10.100.99.214/info.php

Step: 16. Configure Joomla Server through Web Browser :

Go to http://10.100.99.214/joomla

-- Select Language: English
-- Site Name: Koushik's World
     Admin Email: kchatterjee@domain.com
-- Admin Username: admin
     Admin Password: Passw0rd
     Confirm Admin Password: Passw0rd
  
-- Click Next
-- Database Type: MySQL
     Hostname: localhost
     Username: joomla
     Password: password
     Database Name: joomladb
  
-- Click Next.
-- Just Skip Ftp Configuration.
-- Click Next.
-- Select Blog English Sample Data.
-- Click Install.
-- Click on Remove Installation Folder.
-- Click on Site.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Sunday 30 October 2016

Install & Configure GlassFish on CentOS/RHEL 6x

Install & Configure GlassFish on CentOS/RHEL 6x


-- GlassFish is an Application Server which can also be used as a Web Server (Http Server). GlassFish Server is the world's first implementation of the Java Platform.

Step: 1. Bind Hosts File :

# vi /etc/hosts

10.100.97.39           ser3.domain.com    ser3

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP Server (for Time Synchronization) :

# yum -y install ntp
# service ntpd restart
# chkconfig ntpd on
# ntpdate pool.ntp.org

# init 6

Step: 4. Installing the Java :

# yum -y install wget
# cd /opt
# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
   
# yum -y install jdk-8u5-linux-x64.rpm

Step: 5. Setup JAVA_HOME Variable :

# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME

Step: 6. Edit the Java Profile :

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)

# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 7. Check Version of JAVA :

# java -version

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)

Step: 8. Download & Extract Glassfish :

# yum -y install unzip
# cd /opt
# wget http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip
# wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip
# unzip glassfish-4.1.1.zip

Step: 9. Start the GlassFish Server :

# /opt/glassfish4/bin/asadmin start-domain

Waiting for domain1 to start .........
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

Step: 10. Set GlassFish Admin Password (By Default Password is Blank) :

# cd /opt/glassfish4/bin/
# ./asadmin
asadmin> change-admin-password

Enter admin user name [default: admin]> Just Press Enter.
Enter the admin password> Just Press Enter.
Enter the new admin password> Passw0rd (Press Enter.)
Enter the new admin password again> Passw0rd (Press Enter.)
Command change-admin-password executed successfully.

Step: 11. Enabled to Access the DAS Remotely on GlassFish :

asadmin> enable-secure-admin

Enter admin user name>  admin
Enter admin password for user "admin"> Passw0rd

You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

asadmin> stop-domain

Waiting for the domain to stop .
Command stop-domain executed successfully.

asadmin> start-domain

Waiting for domain1 to start .......
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

asadmin> exit
Command multimode executed successfully.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Saturday 22 October 2016

SFTP Chroot Jail Configuration on CentOS/RHEL 6.x

SFTP Chroot Jail Configuration on CentOS/RHEL 6.x


-- This tutorial describes how to give users chrooted SSH or SFTP access on CentOS. With this setup, you can give your users shell access without having to fear that they can see your whole system. Your users will be jailed in a specific directory which they will not be able to break out of.

Step: 1. Create a New Group For SFTP Users :

# groupadd sftpusers

Step: 2. Create a SFTP User :

# mkdir /var/www/html/koushik.com
# useradd -g sftpusers -d /var/www/html/koushik.com/koushik -s /sbin/nologin koushik
# passwd koushik

Step: 3. Configure SFTP Server :

# vi /etc/ssh/sshd_config

-- Find & Commented :

#Subsystem      sftp    /usr/libexec/openssh/sftp-server

-- Add those Lines :

Subsystem sftp internal-sftp
AllowUsers koushik

# User specific configuration
Match User koushik
ChrootDirectory /var/www/html/koushik.com
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

-- Save & Quit (:wq)

Step: 4. Restart SFTP/SSH Service :

# service sshd restart

Step: 5. Give Permission of Chroot Directory :

# chown -Rf koushik:sftpusers /var/www/html/koushik.com/
# chmod -Rf 755 /var/www/html/koushik.com/

Step: 6. Testing SFTP Chroot Jail :

# sftp koushik@192.168.100.229

Are you sure you want to continue connecting (yes/no)? yes

koushik@192.168.100.229's password: redhat

sftp> pwd
Remote working directory: /
sftp> cd /tmp
Couldn't canonicalise: No such file or directory
sftp> cd /etc
Couldn't canonicalise: No such file or directory
sftp> mkdir test
sftp> ls
test
sftp> bye
[root@ser2 ~]#

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Wednesday 12 October 2016

Install & Configure Vsftpd Server on CentOS/RHEL 6x

Install & Configure Vsftpd Server on CentOS/RHEL 6x


Q. What is VSFTPD ?

-- vsftpd, (or very secure FTP daemon), is an FTP server that runs on Linux/UNIX Operating Systems. It is Licensed under the GNU General Public License. It supports IPv6 and SSL. VSFTP is a secure, stable, and fast FTP Server.

Step: 1. Install VSFTP Server :

# yum install -y vsftpd

Step: 2. Configure FTP Server :

# vi /etc/vsftpd/vsftpd.conf

Find these Lines :

-- At line 12:

anonymous_enable=NO

-- At lines 96 & 97 Uncommented the following :

chroot_local_user=YES
chroot_list_enable=YES

-- At line 98 Uncomment the following :

chroot_list_file=/etc/vsftpd/chroot_list

-- Just delete the # sign

userlist_enable=YES

-- Save & Exit (:wq)

Step: 3. Make the Directory Accessible to the ftp-users Group :

# useradd -d /var/www/path/to/your/dir -s /usr/sbin/nologin ftpuser1
# passwd ftpuser1
# chown -Rf ftpuser1 /var/www/path/to/your/dir
# chmod 775 /var/www/path/to/your/dir

Step: 4. Create a File Under /etc/vsftpd :

# vi /etc/vsftpd/chroot_list

-- Jail Users or Limits Users to only their home directory. To add the limited user name in the 'chroot_list'

ftpuser1
ftpuser2

-- Save & Quit (:wq)

Step: 5. To Add a nologin to the Shell :

# vi /etc/shells

-- The file should look like this:

    /bin/ksh
    /usr/bin/rc
    /usr/bin/tcsh
    /bin/tcsh
    /usr/bin/esh
    /bin/dash
    /bin/bash
    /bin/rbash

-- Add this line at the End:

    /usr/sbin/nologin

-- Save & Exit (:wq)

Step: 6. Now Create a usergroup & Add the ftpuser1 to it :

# addgroup ftp-users
# usermod -Gftp-users ftpuser1

Step: 7. Restart the FTP Service :

# service vsftpd restart
# chkconfig vsftpd on
# netstat -tulpn | grep :21
# service vsftpd status

Step: 8. Configure Firewall & Set SELinux for FTP :

# iptables -I INPUT -p tcp -m tcp --dport 20 -j ACCEPT
# iptables -I INPUT -p tcp -m tcp --dport 21 -j ACCEPT
# iptables -I INPUT -p tcp -m tcp --dport 12000:12100 -j ACCEPT
# iptables -I INPUT -p udp -m tcp --dport 12000:12100 -j ACCEPT

# setsebool -P ftpd_disable_trans=1

Step: 9. View FTP Log File :

# tail –100f /var/log/vsftpd.log

Step: 10. VSFTP Passive Port Configuration :

# vi /etc/vsftpd/vsftpd.conf

-- Add these Lines at the End:

# PASV Configurations :
pasv_promiscuous=YES
pasv_enable=YES
pasv_min_port=12000
pasv_max_port=12100
#pasv_address=X.X.X.X

# Other Parameter :
max_login_fails=5
max_per_ip=5
max_clients=10
require_ssl_reuse=NO
listen_port=21
use_localtime=YES
connect_from_port_20=NO

-- Save & Quit (:wq)

# service vsftpd restart

Step: 11. Check Connectivity through Web Browser:

ftp://192.168.72.142
Enter User name & Password.

-- Or You Can use Filezilla or Any other FTP Client.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Saturday 1 October 2016

Install & Configure Apache CouchDB 1.6.1 on Ubuntu 14.04

Install & Configure Apache CouchDB 1.6.1 on Ubuntu 14.04


What is Apache CouchDB?

-- Apache CouchDB is an open source document-oriented database with NoSQL. NoSQL means, it doesn’t have any database schema, tables, rows, etc. CouceDB uses JSON to store data with documents, which you can access from a web browser via HTTP. CouchDB works smoothly with all latest modern web and mobile apps.

Step: 1. Install Build Tools & Required Dependencies :
 
# apt-get update
# apt-get -y upgrade
# apt-get -y install build-essential erlang-base-hipe erlang-dev erlang-manpages erlang-eunit \
   erlang-nox libicu-dev libmozjs185-dev libcurl4-openssl-dev wget

Step: 2. Installing CouchDB  :

# cd /tmp
# wget http://mirror.fibergrid.in/apache/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
# tar -xvf apache-couchdb-1.6.1.tar.gz
# rm -rf apache-couchdb-1.6.1.tar.gz
# cd apache-couchdb-1.6.1
# ./configure
# make && make install

Step: 3. Configuring CouchDB :

# adduser --disabled-login --disabled-password --no-create-home couchdb
# chown -Rf couchdb:couchdb /usr/local/var/lib/couchdb/
# chown -Rf couchdb:couchdb /usr/local/var/log/couchdb/
# chown -Rf couchdb:couchdb /usr/local/var/run/couchdb/
# ln -s /usr/local/etc/init.d/couchdb /etc/init.d/couchdb
# update-rc.d couchdb defaults

Step: 4. Give HTTP Access To CouchDB :

# vi /usr/local/etc/couchdb/local.ini

-- Uncomment & Modify Line No. 11 & 12 :

[httpd]
port = 5984
bind_address = 0.0.0.0

-- Save & Quit (:wq)

Step: 5. Start CouchDB Service :

# service couchdb start
# service couchdb status

Step: 6. Verifing CouchDB :

# curl http://localhost:5984

Or

Open Web Browser & Type: http://10.100.97.37:5984

Step: 7. Access Couchdb Web Interface For Manage the Database :

http://10.100.97.37:5984/_utils/

-- Create Admin User :

-- By Default there is no admin user, you need to create one by just clicking on the bottom right
     corner that says "Fix this". Once you click on that link you will prompted to enter admin user
     and password.

-- Give Username & Password.
-- Click on "Create" Button.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog


Saturday 24 September 2016

How To Change RDP (Remote Desktop) Default Port on Windows Server 2008 R2

Change RDP (Remote Desktop) 3389 Port on Windows Server 2008 R2


-- Remote Desktop Protocol (RDP) stands for Administrative Console Access. If your System has Remote Desktop enabled, it is listening for TCP connections on Port 3389 (by default Port) and it may be necessary to make it even more secure by changing the TCP Port used for the network access. Since this port is both well known and can be used to attack accounts. If you want to change the port, it requires a quick change in the Windows registry.

Note: Editing the registry is very risky, So be sure you have a verified backup before saving any changes.

Step: 1. Open Registry Editor :

Click on Start -> Run -> Type: regedit -> Press 'OK'.

Step: 2. Change Registry :

Go to:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

Double Click on PortNumber -> Select Decimal -> Give Value Data (2289) -> OK

Step: 3. Allow your Port Number within Windows 2008 Firewall :

Click on Start -> Administrative Tools -> Windows Firewall with Advanced Security -> Inbound Rules -> Search Remote Desktop (TCP-In) & Right Click -> Disable Rule.

-- Then Create a New Rule for RDP :

Inbound Rules -> New Rule -> Select Port -> Next -> Specific Local Ports (2289) -> Next -> Next -> Next -> Give Name (RDP) -> Finish -> Close.

Step: 4. Restart Remote Desktop Service (plus Dependent Services) :

Click on Start -> Administrative Tools -> Services -> Restart the following Services :

-- Remote Desktop Configuration
-- Remote Desktop Services
-- Remote Desktop Services
-- UserMode Port Redirector

Step: 5. Finally Restart the Server :

Now Login with new Port Number.

Note: When you try to Connect to this Computer by using the Remote Desktop Connection, you must Type the new Port Number.

Ex: 192.168.100.102:2289

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday 17 September 2016

How to Install & Configure Redmine 3 on Ubuntu 14.04

How to Install & Configure Redmine 3 on Ubuntu 14.04


Q. What is Redmine ?

-- Redmine is a free and open source, web-based project management and issue tracking tool, Written using the Ruby on Rails framework. It allows users to manage multiple projects and associated sub projects. It features per project wikis and forums, time tracking, and flexible role based access control.

Features :

1. Multiple Projects Support.
2. Flexible Role Based Access Control
3. Flexible Issue Tracking System etc.

Step: 1. Set Host Name :

# hostname tickets.domain.com
# vi /etc/hostname

tickets.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

10.100.97.137    tickets.domain.com    tickets

-- Save & Quit (:wq)

Step: 3. Update the System :

# apt-get update
# apt-get -y upgrade

Step: 4. Install Prerequisites :

# apt-get -y install apache2 apache2-utils apache2-threaded-dev apache2-prefork-dev \
    libapache2-mod-passenger make automake autoconf cmake openssl libcurl4-openssl-dev \
    libapr1-dev libaprutil1-dev libmysqlclient-dev wget

# apt-get -y install php5 libapache2-mod-php5 php5-mysql libapache2-mod-perl2 libssl-dev \
    libmagickcore-dev libmagickwand-dev curl git-core patch build-essential bison zlib1g-dev \
    libxml2-dev autotools-dev libxslt1-dev libyaml-0-2 libreadline6-dev libyaml-dev libtool \
    imagemagick libicu-dev libssh2-1 libssh2-1-dev libgpg-error-dev

Step: 5. Install Ruby & Gem with Rails :

# apt-get -y remove ruby
# curl -#LO https://rvm.io/mpapis.asc
# gpg --import mpapis.asc
# curl -sSL https://get.rvm.io | bash -s stable
# source /etc/profile.d/rvm.sh
# rvm requirements
# rvm install 2.3.0
# rvm use 2.3.0 --default

Step: 6. To Check Ruby & Gem Version :

# ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

# gem -v
2.5.1

Step: 7. Install Passenger :

# gem install passenger
# passenger-install-apache2-module

Press Enter and Press " ! " and Make Sure you Select only the 'ruby' one.

**LOOK CAREFULLY after successfully installing it give codes .we must edit in our apache. FOR ME .It may be other for you. ========================================================================
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
    PassengerRoot /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30
    PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby
</IfModule>
=========================================================================

Step: 8. To Load the Passenger Module into Apache :

# vi /etc/apache2/mods-available/passenger.load

-- Delete the LoadModule Line & Paste the Below Module.

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so

-- Save & Quit (:wq)

# vi /etc/apache2/mods-available/passenger.conf

-- Delete Everything & Paste the Below Code.

<IfModule mod_passenger.c>
    PassengerRoot /usr/local/rvm/gems/ruby-2.3.0/gems/passenger-5.0.30
    PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby
</IfModule>

-- Save & Quit (:wq)

# a2enmod passenger

Step: 9. Now, you can Download the Latest Version of Redmine :

# cd /var/www
# wget http://www.redmine.org/releases/redmine-3.0.4.tar.gz
# tar zxf redmine-3.0.4.tar.gz
# rm redmine-3.0.4.tar.gz
# mv redmine-3.0.4 redmine
# chown -R www-data:www-data /var/www/redmine
# chmod -R 775 /var/www/redmine
# touch /var/www/redmine/log/production.log
# chown root:www-data /var/www/redmine/log/production.log
# chmod 664 /var/www/redmine/log/production.log

Step: 10. Start the Apache Server :

# service apache2 restart

Step: 11. Install MySQL Server :

# apt-get -y install mysql-server mysql-client

New password for the MySQL "root" user: redhat
Repeat password for the MySQL "root" user: redhat

Step: 12. Create Database for Redmine :

# mysql -u root -p
Enter Password:

mysql> create database redminedb character set utf8;
mysql> grant all privileges on redminedb.* to redmine@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 13. Now, Install the Gem file and the bundler :

# gem install rake rack i18n rubytree RedCloth mysql coderay rails jquery-rails fastercsv builder mime-types awesome_nested_set activerecord-jdbc-adapter selenium-webdriver shoulda mysql2

# cd /var/www/redmine
# gem install bundler
# bundle install --without development test rmagick

Step: 14. Setup the Database Connection for Redmine :

# cd /var/www/redmine/config
# mv database.yml.example database.yml
# vi database.yml

In the 'production' Section, update the 'database', username, password and other Parameters Accordingly like so :

production:
  adapter: mysql2
  database: redminedb
  host: localhost
  username: redmine
  password: "password"
  encoding: utf8

-- Save & Quit (:wq)

Step: 15. Create the Virtual host files for running Redmine :

# mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak
# cd /etc/apache2/sites-enabled
# unlink 000-default.conf
# vi /etc/apache2/sites-available/redmine.conf

<VirtualHost *:80>
ServerName redmine

DocumentRoot /var/www/
Alias /tickets /var/www/redmine/public

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/redmine>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/redmine/public>
PassengerEnabled on
SetHandler none
PassengerAppRoot /var/www/redmine
RailsBaseURI /redmine
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

-- Save & Quit (:wq)

# a2ensite redmine.conf

Step: 16. Restart Apache Server :

# service apache2 restart

Step: 17. Set Environment to "production" Environment :

# cd /var/www/redmine/config
# vi environment.rb

Note: If there is line uncomment it, if not just proceed ahead.

ENV['RAILS_ENV'] ||= 'production'

-- Save & Quit (:wq)

Step: 18. In Terminal, use Following Command :

# cd /var/www/redmine/
# bundle install
# RAILS_ENV=production bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Type 'en' when asked & Press Enter.

Step: 19. Rename dispatch CGI files in /redmine/public/ :

# cd /var/www/redmine/public
# mv dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess

Step: 20. Fix Rights for the Apache user :

# chown -Rf www-data:www-data /var/www/redmine

Step: 21. Restart the Apache Server :

# service apache2 restart

Step: 22. Point Your Web Browser & Type :

http://ip_address_server/redmine
or
http://domain_name/redmine
User: admin
Pass: admin

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Sunday 11 September 2016

Install & Configure CSF (Config Server Firewall) on CentOS/RHEL 6x

Install & Configure CSF on CentOS/RHEL 6x


-- Config Server Firewall (or CSF) is a free and advanced firewall for most Linux distributions and Linux based VPS. In Addition to the Basic Functionality of a Firewall – Filtering Packets. CSF includes other security features, such as Login/Intrusion/Flood Detections.

Step: 1. Stop Firewall :

# service iptables stop
# chkconfig iptables off

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Reboot the Server :

# init 6

Step: 4. Installation of CFS Dependencies :

# yum -y install wget vim perl perl-libwww-perl.noarch perl-Time-HiRes

Step: 5. Download & Extract CSF Package :

# cd /usr/src/
# wget https://download.configserver.com/csf.tgz
# tar -xzf csf.tgz

Step: 6. Install CFS :

# cd csf
# sh install.sh

Step: 7. Now You should Check that CSG really Works on this Server :

# cd /usr/local/csf/bin/
# perl csftest.pl

[OUTPUT]
RESULT: csf should function on this server.

Step: 8. Configure CSF :

# vi /etc/csf/csf.conf

-- Line No. 11 :

TESTING = "0"

Note: By default CSF Allows Incoming & Outgoing Traffic for the SSH Standard Port 22, if you use a Different SSH Port then please Add your port to the Configuration in line 139 "TCP_IN".

-- Line No. 69 :

RESTRICT_SYSLOG = "3"

-- Save & Quit (:wq)


Step: 9. Start CSF & LFD Service :

# service csf restart
# chkconfig csf on

# service lfd restart
# chkconfig lfd on

Step: 10. To View the list of Default Rules of CSF :

# csf -l
Or
# csf --status

Step: 11. Basic CSF Commands :

-- Start the Firewall (Enable the Firewall Rules) :

# csf -s
Or
# csf --start

-- Flush/Stop the Firewall Rules :

# csf -f
Or
# csf --stop

-- Reload the Firewall Rules :

# csf -f

-- Restart the Firewall Rules :

# csf -r
Or
# csf --restart

-- Allow an IP & Add it to csf.allow :

# csf -a 10.100.97.37
Or
# csf --add 10.100.97.37

-- Remove/Delete an IP from csf.allow :

# csf -ar 10.100.97.37
Or
# csf --addrm 10.100.97.37

-- Deny an IP & Add to csf.deny :

# csf -d 10.100.97.37
Or
# csf --deny 10.100.97.37

-- Remove/Delete an IP from csf.deny :

# csf -dr 10.100.97.37
Or
# csf --denyrm 10.100.97.37

-- Remove & Unblock all Entries from csf.deny :

# csf -df
Or
# csf --denyf

-- Search for a Pattern Match on iptables e.g : IP, CIDR, Port Number :

# csf -g 10.100.97.37
Or
# csf --grep 10.100.97.37

-- Disable CSF & LFD Completely :

# csf -x
Or
# csf --disable

-- Displays the Current List of Temporary Allow & Deny IP Entries with their TTL & Comment :

# csf -t
Or
# csf --temp

-- Add an IP to the Temp IP Allow List :

# csf -ta 10.100.97.37 ttl -p 22 -d 0.0.0.0 Allow All For Port No 22
Or
# csf --tempallow 10.100.97.37 ttl [-p port] [-d direction] [comment]

-- Add an IP to the Temp IP Ban List :

# csf -td 10.100.97.37 ttl -p 22 -d 0.0.0.0 Ban All For Port No 22
Or
# csf --tempdeny 10.100.97.37 ttl [-p port] [-d direction] [comment]

-- Remove an IP From the Temporary IP Ban or Allow List :

# csf -tr 10.100.97.37
Or
# csf --temprm 10.100.97.37

-- Flush all IPs from the Temporary IP Entries :

# csf -tf
Or
# csf --tempf

Step: 12. Advanced CSF Configuration :

# vi /etc/csf/csf.conf

-- Don't Block IP addresses that are in the csf.allow files :

IGNORE_ALLOW = "1"

-- Allow Incoming & Outgoing ICMP. Line No 152 for Incoming & Line 159 for Outgoing :

ICMP_IN = "1"
ICMP_OUT = "1"

-- Block Certain Countries. Go To Line 836 & Add the Country Codes :

CC_DENY = "CN,UK,US"
CC_ALLOW = "ID,IN,DE"

-- Send the Su & SSH Login Logs by Email. Go to the Line No. 1069 :

LF_SSH_EMAIL_ALERT = "1"

LF_SU_EMAIL_ALERT = "1"

-- And then Define the Email Address at Line No. 588 :

LF_ALERT_TO = "koushik@domain.com"

-- Save & Quit (:wq)

Step: 13. Restart CSF & LFD Service :

# service csf restart
# service lfd restart

IMPORTANT NOTES:
=================

-- The Ports Opened by Default are the Following :

TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"
TCP_OUT = "20,21,22,25,53,80,110,113,443"
UDP_IN = "20,21,53"
UDP_OUT = "20,21,53,113,123"

-- Services using the Open Ports :

Port 20: FTP data transfer
Port 21: FTP control
Port 22: Secure shell (SSH)
Port 25: Simple mail transfer protocol (SMTP)
Port 53: Domain name system (DNS)
Port 80: Hypertext transfer protocol (HTTP)
Port 110: Post office protocol v3 (POP3)
Port 113: Authentication service/identification protocol
Port 123: Network time protocol (NTP)
Port 143: Internet message access protocol (IMAP)
Port 443: Hypertext transfer protocol over SSL/TLS (HTTPS)
Port 465: URL Rendesvous Directory for SSM (Cisco)
Port 587: E-mail message submission (SMTP)
Port 993: Internet message access protocol over SSL (IMAPS)
Port 995: Post office protocol 3 over TLS/SSL (POP3S)

-- Below are Port sets that should be opened if you are Running the Listed Service :

On any Server:

TCP_IN: 22,53
TCP_OUT: 22,53,80,113,443
UPD_IN: 53
UPD_OUT: 53,113,123

Apache:

TCP_IN: 80,443

FTP Server:

TCP_IN: 20,21
TCP_OUT: 20,21
UPD_IN: 20,21
UPD_OUT:20,21

Mail Server:

TCP_IN: 25,110,143,587,993,995
TCP_OUT: 25,110

MySQL Server (if remote access is required):

TCP_IN: 3306
TCP_OUT: 3306

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Saturday 3 September 2016

How To Install & Configure OpenFire on RHEL/Centos 6x

How To Install & Configure OpenFire on RHEL/Centos 6


Q. What is Openfire?

-- Openfire is an Instant Messaging and Group chat server, written in Java that uses XMPP (Extensible Messaging and Presence Protocol) server. Wikipedia reports, Openfire was previously called as ‘Wildfire‘ and ‘Jive Messenger‘. The Application Software is developed by Jive Software and a community called ‘IgniteRealtime.org‘, and is Licensed under Apache License.

Openfire Features :

- Web Based Admin control
- SSL/TLS support
- LDAP connectivity
- User Friendly
- Platform Independent

Openfire Installation :

Step: 1. Bind Host File :

# vi /etc/hosts

192.168.100.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# init 6


Step: 3. Install Java ( lastest version is preferred) :

# cd /opt
# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
   
# yum -y install jdk-8u5-linux-x64.rpm
# yum -y install libldb.i686

Step: 4. Setup Environment Variables :

Setup JAVA_HOME Variable :
   
# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME

Step: 5. Edit the Java Profile :

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)

# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 6. Check Version of JAVA :

# java -version
   
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)

Step: 7. Install the Openfire Dependencies :

# yum -y install httpd httpd-devel wget
# service httpd restart
# chkconfig httpd on

Step: 8. Download the Openfire RPM using wget Command :

# cd /tmp
# wget http://download.igniterealtime.org/openfire/openfire-3.9.3-1.i386.rpm

Step: 9. Install the OpenFire RPM :

# rpm -Uvh openfire-3.9.3-1.i386.rpm

Step: 10. Once the RPM has been installed, Start the OpenFire service :

# service openfire start

Step: 11. Ensure that OpenFire will boot with your Server :

# chkconfig openfire on

Step: 12. For this instance, you’ll want to make sure iptables is not running, you can Configure the iptables rules how you need them later :

# service iptables stop
# chkconfig iptables off

Step: 13. Install MySQL Server with MySQL Connector :

# yum -y install mysql mysql-server mysql-connector-java

Step: 14. Start MySQL Server :

# service mysqld restart
# chkconfig mysqld on

Step: 15. Set MySQL Root Password :

# mysql_secure_installation

Step: 16. Create Database for OpenFire :

# mysql -u root -predhat

mysql> CREATE DATABASE openfire;
mysql> grant all on openfire.* to openfire@'localhost' identified by 'password';
mysql> grant all on openfire.* to openfire@'%' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 17. Navigate in your Web Browser To :

Note: If Showing any JAVA Error while Installing the OpenFire through Web Browser then Restart the Server Once.

http://yourip_address:9090

-- Choose Language: (English)
-- Click on "Continue"

-- Server Settings:
     Domain: (127.0.0.1)
     Admin Console Port: (9090)
     Secure Admin Console Port: (9091)

Note: Don't Change Admin Port and Secure Admin Port. Generally you don’t need to change these data, until you need a custom port.

-- Select "Blowfosh"-- Property Encryption Key: (Leave it Blank)
-- Click on "Continue"

-- Database Settings:
-- Select "Standard Database Connection".
-- Click on "Continue"

-- Database Settings - Standard Connection :
     Database Driver Presets: Select MySQL
     Database URL:  jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true
     Username: openfire
     Password: password
     Minimum Connections: 5
     Maximum Connections: 25
-- Click on "Continue"

-- Profile Settings: Select Default
-- Click on "Continue"

-- Administrator Account:
     Admin Email Address: kchatterjee@kminfosystems.com
     New Password: Passw0rd
     Confirm Password: Passw0rd
-- Click on "Continue"

-- Finally Click on "Login to the Admin Console"

Note: Login to Openfire Admin User using username 'admin' and password, the one we set above.

User: admin
Pass: Passw0rd

Step: 18. To Create OpenFire Chat User :

-- Click on Users/Groups (Tabs)
-- Click on Create New User.
-- Fill the User Details.
-- Click on "Create User"'.

Step: 19. Installation of Spark Client :

Download and Install cross platform Spark client for your system using the below link.

http://www.igniterealtime.org/downloads/index.jsp

Once you’ve installed Spark client, open the application and enter username, password and IP addresss of openfire server.

User Name: koushik
Password: Passw0rd
Server IP: 192.168.100.221

-- Check on Save Password.
-- Check on Auto Login
-- Click on Login

Once you logged in you can chat with the users who are online.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.


Copyright © 2016 Kousik Chatterjee's Blog