Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Saturday 11 February 2017

How To Configure GlusterFS on Centos/RHEL 6x

How To Configure GlusterFS on Centos/RHEL 6x


Q. What is GlusterFS ?

-- GlusterFS is an open source, powerful clustered file system capable of scaling to several petabytes of storage which is available to user under a single mount point. It uses already available disk filesystems like ext3, ext4, xfs etc to store data and client will able to access the storage as local filesystem. GlusterFS cluster aggregates storage blocks over Infiniband RDMA and/or TCP/IP interconnect in a single global namespace.

Before the Installation:

Ensure that TCP and UDP ports 24007 and 24008 are open on all Gluster Servers.
Apart from these ports, you need to open one port for each brick starting from port 24009.
For example: if you have five bricks, you need to have ports 24009 to 24014 open.

Step: 1. Make sure to Add the bind the hostname of every Servers :

# vi /etc/hosts
   
192.168.100.220 ser1.domain.com   ser1   # (Server)
192.168.100.221 ser2.domain.com   ser2   # (Server)
192.168.100.229 ser5.domain.com   ser5   # (Client)

-- Save & Quit (:wq)

Step: 2. Stop Firewall & Disable the Selinux (All Nodes) :

# iptables -L
   
# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux
   
SELINUX=disabled
   
-- Save & Quit (:wq)

Step: 3. Reboot the All Servers :

# init 6
               
Step: 4. Time Synchronization NTP (Both Nodes) :

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

Step: 5. Install Epel Repo (All Servers) :

# yum -y install epel-release

Step: 6. Installation Gusterfs (on ser1.domain.com & ser2.domain.com) :

# cd /tmp
# wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo
# yum -y install glusterfs glusterfs-fuse glusterfs-server

Step: 7. Installation on Client (ser5.domain.com) :

On Client execute following command to install clusterfs client side packages.

# cd /tmp
# wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo
# yum -y install glusterfs glusterfs-fuse fuse fuse-libs libibverbs
   
Step: 8. Start Glusterfs Service (on Ser1 & Ser2):

# service glusterd start
# chkconfig glusterfsd on
   
Step: 9. Creating Trusted Storage Pool (on Ser1.domain.com):

-- Trusted storage pool are the servers which are running as gluster servers and will provide bricks for volumes. You will need to probe all servers to the main server ( here : ser1 is main server ) (don't probe ser1 or localhost). We will now create all three servers in a trusted storage pool and probing will be done on ser1.

# gluster peer probe 192.168.100.221
OR
# gluster peer probe ser2

Probe successful.

# gluster peer status
   
-- To Remove Server from the Trusted Storage Pool :

# gluster peer detach ser1

Step: 10. Creating Replicated Glusterfs Server Volume (on Ser1.domain.com) :

-- A gluster volume is a logical collection of bricks where each brick is an export directory on a server in the trusted storage pool. Use replicated volumes in storage where high-availability and high-reliability are critical because replicated volumes create same copies of files across multiple bricks in the volume.

Important Note: /data is New Attached Volume for Ser1 & Ser2.

# gluster volume create rep-volume replica 2 ser1:/data ser2:/data force
   
Here: force is used as gluster permits us to create the volume in another disk only.
   
Step: 11. Starting the replicated volume (on Ser1.domain.com) :

# gluster volume start rep-volume
# gluster volume info
# gluster pool list

Step: 12. We cannot mount the /data bricks by the same name. So mounting it on /shared. on both the servers (on Ser1 & Ser2) :

# mkdir /shared
# mount -t glusterfs ser1:/rep-volume /shared
# df -h
   
-- Now add following line at the end of /etc/fstab file to make it available to server on every reboot.

# vi /etc/fstab
   
ser1.domain.com:/rep-volume /shared glusterfs defaults,_netdev 0 0

-- Save & Quit (:wq)
       
On Client Machine :
===============
You can just mount and the gluster volume is ready.
   
# mkdir /shared
# mount -t glusterfs ser1:/rep-volume /shared
# df -h
# vi /etc/fstab
       
ser1.domain.com:/rep-volume /shared glusterfs defaults,_netdev 0 0

-- Save & Quit (:wq)
   
Create a file in any of the nodes and Check the replication is working in all the nodes.

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

 

Saturday 4 February 2017

How To Configure Pen-Load Balancer on Centos/RHEL 6x

How To Configure Pen-Load Balancer on Centos/RHEL 6x


Q. What is PEN ?

-- Install Pen to configure Load Balance server. Pen is a light weight simple load balancer. This example shows to configure on the environment like follows.

Scenario:
=======
192.168.100.229    ser5.domain.com     ser5 - PEN Server
192.168.100.220    ser1.domain.com     ser1 - Web Server1
192.168.100.221    ser2.domain.com     ser2 - Web Server2

Step: 1. Bind Hosts File (All Servers) :

# vi /etc/hosts

192.168.100.229    ser5.domain.com     ser5
192.168.100.220    ser1.domain.com     ser1
192.168.100.221    ser2.domain.com     ser2

-- Save & Quit (:wq)

Step: 2. Install and Configure Pen (192.168.100.229-ser5.domain.com) :

# cd /tmp
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

# yum -y install pen

# vi /etc/pen.conf

-- Paste the Following Lines :

# log file
LOGFILE=/var/log/pen.log

# output file of status
WEBFILE=/var/www/pen/webstats.html

# control port
CONTROL=127.0.0.1:10080

# max connections
MAX_CONNECTIONS=500

# listen port
PORT=80

# number of backend servers
BACKEND=2

# IP address of a backend webserver
SERVER1=192.168.100.220:80

# IP address of a backend webserver
SERVER2=192.168.100.221:80

-- Save & Quit (:wq)

Step: 3. Create init Script for Pen :

# vi /etc/rc.d/init.d/pend

#!/bin/bash

# pend: Start/Stop Pend
# chkconfig: - 90 10
# description: Pen is a light weight simple load balancer.
# pidfile: /var/run/pen.pid

. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
. /etc/pen.conf

LOCKFILE="/var/lock/subsys/pen"
PID=/var/run/pen.pid
PROG=/usr/bin/pen

RETVAL=0
start() {
   echo -n $"Starting Pend: "
   SERVER=`grep "^SERVER" /etc/pen.conf | cut -d= -f2`
   daemon $PROG -w $WEBFILE -x $MAX_CONNECTIONS -p $PID -l $LOGFILE -C $CONTROL -S $BACKEND -r $PORT $SERVER
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && touch $LOCKFILE
   return $RETVAL
}
stop() {
   echo -n $"Stopping Pend: "
   killproc $PROG
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && rm -f $PID $LOCKFILE
   return $RETVAL
}
case "$1" in
   start)
      start
      ;;
   stop)
      stop
      ;;
   status)
      status pend
      ;;
   restart)
      stop
      start
      ;;
   *)
      echo $"Usage: $0 {start|stop|status|restart}"
      exit 1
esac
exit $?

-- Save & Quit (:wq)

Step: 4. Setting up Log Rotation :

# vi /etc/logrotate.d/pen

/var/log/pen.log {
   daily
   copytruncate
   compress
   notifempty
   missingok
   postrotate
     /etc/rc.d/init.d/pend restart 2>&1 > /dev/null || true
   endscript
}

-- Save & Quit (:wq)

# chmod 755 /etc/rc.d/init.d/pend
# service pend start
# chkconfig --add pend
# chkconfig pend on

Step: 5. Install & Configure Backend Web Server (Web-Server1 & Web-Server2) :

# yum -y install httpd httpd-devel
# cd /var/www/html
# vi index.html

<html>
<body bgcolor="black">
<marquee><font size="8" color="yellow"> This is Web-Server1...!!!</font></marquee>
</body>
</html>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on

On Web-Server2 :

# yum -y install httpd httpd-devel
# cd /var/www/html
# vi index.html

<html>
<body bgcolor="black">
<marquee><font size="8" color="yellow"> This is Web-Server2...!!!</font></marquee>
</body>
</html>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on

Step: 6. Now, Point Your Web Browser & Type :

http://192.168.100.229  # Pen Server IP Address.

Step: 7. Configure the tool that it's possible to watch Pen's Status :

# cp /usr/share/doc/pen-*/penstats /var/www/pen
# vi /var/www/pen/penstats

# Line No. 4: Change to:

PIDFILE=/var/run/pen.pid

# Line No. 5: Change to:

WEBFILE=/var/www/pen/webstats.html

-- Save & Quit (:wq)

Step: 8. Install Apache Server for See Pen Status :

# yum -y install httpd httpd-devel

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

Chenge Listen Port to:

Listen 8080

-- Save & Quit (:wq)

# mv /etc/httpd/conf.d/pen.conf /etc/httpd/conf.d/pen.conf.bak
# vi /etc/httpd/conf.d/pen.conf

Alias /pen/ /var/www/pen/
<Directory /var/www/pen/>
   DirectoryIndex penctl.cgi
   Options ExecCGI
   order deny,allow
   deny from all
   allow from 127.0.0.1 192.168.100.0/24   # IP address you permit
</Directory>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on
# service pend restart

Step: 10. Run the Following Command :

# chmod 755 /var/www/pen/penstats
# /var/www/pen/penstats > /dev/null

Step: 10. Schedule in Crontab (Update by 1 minutes) :

# crontab -e

*/1 * * * * /var/www/pen/penstats > /dev/null

-- Save & Quit (:wq)

# service crond restart

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


Sunday 22 January 2017

How to Configure Proftpd on RHEL/CentOS 6x

How to Configure Proftpd on RHEL/CentOS 6x


Q. What is Proftpd?

-- ProFTPD is an FTP Server. ProFTPD is Free & open-source software, compatible with Unix-like systems and Microsoft Windows (via Cygwin). Along with vsftpd, Pure-FTPd and ProFTPD is among the most popular FTP servers in Unix-like environments today.

Step: 1. Install the EPEL Repository :

# yum -y install epel-release

Step: 2. Install Proftpd :

# yum -y install proftpd

Step: 3. Restart Proftp Service :

# service proftpd restart
# chkconfig proftpd on

Step: 4. Configure Proftpd :

# vi /etc/proftpd.conf

ServerName     "Give Hostname"

MasqueradeAddress       192.168.100.10    # Server IP Address
PassivePorts 60000 65535

# For Extension Retriction :

PathAllowFilter "\\.(jpg|jpgeg|mpeg|mpg|mp3)$"

or

PathDenyFilter "\\.(pdf|ini)$"

# For Upload File Size Limit :

MaxStoreFileSize  25 Mb
MaxRetrieveFileSize  25 Mb

# Jailing Directory :
<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                ftp
Group                                            ftp
RequireValidShell                   off
<Directory *>
<Limit WRITE>
    AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

# service proftpd restart

Note: If proftpd service fails to start bind it in hosts file.

# vi /etc/hosts

Add the <machine ip> <machine name>

Step: 5. Add a System User To Access FTP Server :

# useradd -d /home/koushik koushik
# passwd koushik

-- Give Password.

Go To Proftp Configuration File :

# vi /etc/proftpd.conf

-- At the End Add those Lines :

<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                <username>
Group                                              ftp
RequireValidShell                     off
<Directory *>
<Limit WRITE>
          AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

Step: 6. Change Server Level :

# vi /etc/pam.d/proftpd

-- Delete all & Add those Lines :

#%PAM-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth include system-auth
auth required pam_shells.so
account include system-auth
session include system-auth
session required pam_loginuid.so

-- Save & Quit (:wq)

Step: 7. Restart Proftpd Service :

# service proftpd restart
# chkconfig proftpd on

Step: 8. Proftp Configuration for Specific User & Directory :

# groupadd ftpusers

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/nologin username
# passwd username

-- Give Password.

Step: 9. Change Group :

# chown -Rf username:ftp domain.com (Directory name of the Site)

Example :

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/lologin ftpdomain
# passwd ftpdomain

-- Give Password.

# chown -Rf ftpdomain:ftp /var/www/html/domain.com

Step: 11. Testing Proftpd Server :

-- Install Filezilla & Test the FTP Server.

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

Sunday 15 January 2017

Install & Configure PowerDNS with MySQL on RHEL/CentOS 6x

Install & Configure PowerDNS with MySQL on RHEL/CentOS 6x


Q. What is PowerDNS?

-- PowerDNS is a DNS server, written in C++ and licensed under the GPL. It runs on most Unix derivatives. PowerDNS features a large number of different backends ranging from simple BIND style zonefiles to relational databases and load balancing/failover algorithms. A DNS recursor is provided as a separate program.

Step: 1. Install REMI and EPEL Repositories and Packages :

# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step: 2. Installing MySQL Server :

# yum -y install mysql mysql-server

Step: 3. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secoure_installation

Step: 4. Install Apache Server & PHP :

# yum -y install httpd httpd-devel php php-mcrypt php-pdo php-mysql php-devel php-gd \
    php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring gettext wget

Step: 5. Restart Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 6. Install following two PEAR Packages :

# yum -y install php-pear-DB php-pear-MDB2-Driver-mysql

Step: 7. Create a Database for PowerDNS :

# mysql -u root -predhat

mysql> create database powerdns;
mysql> grant all privileges on powerdns.* to powerdns@'localhost' identified by 'password';
mysql> grant all privileges on powerdns.* to powerdns@'%' identified by 'password';

Step: 8. Create Tables :

mysql> use powerdns;
mysql> CREATE TABLE domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);

mysql> CREATE UNIQUE INDEX name_index ON domains(name);

mysql> CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);

mysql> CREATE INDEX rec_name_index ON records(name);
mysql> CREATE INDEX nametype_index ON records(name,type);
mysql> CREATE INDEX domain_id ON records(domain_id);

mysql> CREATE TABLE supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);

mysql> flush privileges;
mysql> quit;

Step: 9. Install & Configure PowerDNS :

# yum -y install pdns pdns-backend-mysql

# vi /etc/pdns/pdns.conf

#################################
# launch Which backends to launch and order to query them in
#
# launch=

launch=gmysql
gmysql-host=localhost
gmysql-user=powerdns
gmysql-password=password
gmysql-dbname=powerdns

#################################

-- Save & Quit (:wq)

# service pdns restart
# chkconfig pdns on

Step: 10. Install PowerAdmin :

# cd /var/www/html
# wget https://github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz
# tar xvfz poweradmin-2.1.6.tgz
# mv poweradmin-2.1.6 poweradmin
# cd poweradmin/inc/
# mv config-me.inc.php config.inc.php

Step: 11. Edit config.inc.php & make sure to change password you've specified in Step 7 :

# vi config.inc.php

Modify db_pass and session_key to your own values :

$db_host                = 'localhost';
$db_port                = '3306';
$db_user                = 'powerdns';
$db_pass                = 'password';
$db_name                = 'powerdns';
$db_type                = 'mysql';
$session_key            = 'Passw0rd';

-- Save & Quit (:wq)

# service httpd restart

Step: 12. Create PowerAdmin Account :

http://192.168.72.140/poweradmin

Click on Install -> Choose I prefer to proceed in English -> Go to Step2 -> Go to Step3 ->

Username: powerdns
Password: password
Database Type: MySQL
Hostname: 127.0.0.1
DB Port: 3306
Database: powerdns
PowerAdmin Administrator Password: Passw0rd

Go to Step4 -> This step is optional (SKIP) -> Go to Step5 -> Go to Step6 -> Go to Step7.

Note: Now we have finished the configuration, you should (must!) remove the directory "install/"

# cd /var/www/html/poweradmin
# mv install/ install_bak

Step: 13. Now you can login as Admin :

http://192.168.72.140/poweradmin

User: admin
Pass: Passw0rd

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

Sunday 8 January 2017

Install Maven3 on Ubuntu Server 14.04

Install Maven3 on Ubuntu Server 14.04


Q. What is Apache Maven?

-- Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Step: 1. Add the following line in sources.list file :

# vi /etc/apt/sources.list

deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main
deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main

-- Save & Quit (:wq)
       
Step: 2. Update the Systems & Install Maven3 :

# apt-get update --fix-missing
# apt-get install maven3
   
Step: 3. Create a Symbolic link :

# ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn

Step: 4. Check mvn is Working :
   
# mvn -version

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-44-generic", arch: "amd64", family: "unix"

Step: 5. Running Maven Tools :

-- These are the most Common default lifecycle phases executed.



# mvn validate: Validate the project is correct & all necessary information is available.

# mvn compile: Compile the source code of the project.

# mvn test: test the compiled source code using a suitable unit testing framework.

# mvn package: take the compiled code & package it in its distributable format, such as a JAR.

# mvn integration-test: Process & Deploy the Package if necessary into an environment where
integration tests can be run.

# mvn verify: Run any checks to verify the package is valid and meets quality criteria.

# mvn install: Install the package into the local repository, for use as a dependency in other projects locally.

# mvn deploy: Done in an integration or release environment, copies the final package to the rem.


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

 

Sunday 1 January 2017

How to Install & Configure Linux Malware Detect (LMD) on CentOS 6x

How to Install & Configure Linux Malware Detect (LMD) on CentOS 6x


Q. What is LMD ?

-- Linux Malware Detect (LMD) is Malware detector & scanner for Linux, Designed for shared hosting environments. LMD is released under GNU GPLV2 license, it can be installed on cPanel WHM & Linux Environments with together other Detection tools such as ClamAV.

Prerequisite:

1. CentOS 6.x
2. Root Privileges.

Step: 1. Install Epel Repository :

# yum -y install epel-release

Step: 2. Install Mailx :

# yum -y install mailx

Step: 3. Install Linux Malware Detect (LMD) :

# cd /tmp
# wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
# tar -xzvf maldetect-current.tar.gz
# cd maldetect-1.5
# ./install.sh

Step: 4. Make a Symlink to the maldet Command in the /bin/ Directory :

# ln -s /usr/local/maldetect/maldet /bin/maldet
# hash -r

Step: 5. Configure Linux Malware Detect (LMD) :

# cd /usr/local/maldetect/
# vi conf.maldet

-- Enable Email Alert by Changing the value to '1' on Line No 16.

email_alert="1"

-- Type in Your Email Address on Line No 21.

email_addr="koushik@domain.com"

-- Use the ClamAV Scan binary as default Scan Engine because it provides a high-performance Scan on large file sets. Change value to '1' on Line No 114.

scan_clamscan="1"

-- Enable Quarantining to move Malware to the Quarantine Automatically During the Scan Process. Change value to '1' on Line No 180.

quarantine_hits="1"

-- Enable Clean based Malware Injections. Change value to '1' on Line No 185.

quarantine_clean="1"

-- Save & Quit (:wq)

Step: 6. Install ClamAV :

# yum -y install clamav clamav-devel

Step: 7. Update the ClamAV Virus Databases :

# freshclam

Step: 8. Testing LMD and ClamAV :

-- Go to the Web root Directory & Download some sample malware (eicar) with wget.

# yum -y install wget
# cd /var/www/html
# wget http://www.eicar.org/download/eicar.com.txt
# wget http://www.eicar.org/download/eicar_com.zip
# wget http://www.eicar.org/download/eicarcom2.zip

-- Scan the Web root Directory with the maldet.

# maldet -a /var/www/html

Step: 9. Check the Scan Report :

# maldet --report 161008-0524.9466

Step: 10. Now Check the Email Report from LMD :

# tail -f /var/mail/root

Step: 11. Other LMD Commands :

-- Perform a Scan for Specific file Extention only :

# maldet -a /var/www/html/*.php

-- Get a List of all Reports :

# maldet -e list

-- Scan Files that have been Created/Modified in the last X Days :

# maldet -r /var/www/html/ 5

-- Restore Files from the Quarantine Directory :

# maldet -s SCANID

-- Enable Monitoring of a Directory :

# maldet -m /var/www/html/

-- Check the Monitor Log File :

# tail -f /usr/local/maldetect/logs/inotify_log

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

 

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


Copyright © 2016 Kousik Chatterjee's Blog