Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Showing posts with label Linux-Others. Show all posts
Showing posts with label Linux-Others. Show all posts

Sunday, 24 November 2019

How To Configure SonarQube on Ubuntu 16.04



Q. What is SonarQube ?

-- SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities on 20+ programming languages. SonarQube offers reports on duplicated code, coding standards, unit tests, code coverage, code complexity, comments, bugs, and security vulnerabilities.

SonarQube includes support for the programming languages Java (including Android), C#, PHP, JavaScript, TypeScript, C/C++, Ruby, Kotlin, Go, COBOL, PL/SQL, PL/I, ABAP, VB.NET, VB6, Python, RPG, Flex, Objective-C, Swift, CSS, HTML, and XML.


Requirements:
  • Ubuntu 16.04 Server
  • 2 GB of RAM to run efficiently and 1 GB of free RAM (Preferred 4 GB RAM) 
  • Disk Space: Depending on utilization (Preferred 50 GB) 
  • Instance volume type must be excellent read & write performance 
  • SonarQube does not support 32-bit systems on the server side. 
  • Open JDK 8 or Oracle Java 8
  • Database MySQL 5.7 (Preferred MSSQL)

Installation:

Step: 1. Update System & Install required Packages :

# apt-get update && apt-get -y upgrade
# apt-get -y install -y wget unzip zip
 

Step: 2.  Install Oracle Java :

# cd /opt
# mkdir java
# wget https://github.com/frekele/oracle-java/releases/download/8u212-b10/jdk-8u212-linux-x64.tar.gz
# tar -xzvf jdk-8u212-linux-x64.tar.gz -C /opt/java --strip-components=1
# update-alternatives --install /usr/bin/java java /opt/java/bin/java 100
# update-alternatives --install /usr/bin/javac javac /opt/java/bin/javac 100
# java -version
# echo $JAVA_HOME

Step: 3. Create user for SonarQube :

 
# sudo adduser --system --no-create-home --group --disabled-login sonarqube


Step: 4. Install MySQL Server & Create User for SonarQube :

 
# apt-get -y install mysql-server-5.7 mysql-server-core-5.7

# mysql_secure_installation

# mysql -u root -p

Enter Password:

MySQL> CREATE DATABASE sonardb CHARACTER SET utf8 COLLATE utf8_bin;
MySQL> GRANT ALL on sonardb.* TO 'sonarqube'@'localhost' IDENTIFIED BY 'sonardb#321';
MySQL> FLUSH PRIVILEGES;
MySQL> exit;


Step: 5. Install SonarQube :

 
# cd /opt/
# wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.7.zip
# unzip sonarqube-7.7.zip
# mv sonarqube-7.7 sonarqube
# sudo chown -R sonarqube:sonarqube /opt/sonarqube
# vi sonarqube/conf/sonar.properties

     sonar.jdbc.username=sonarqube
     sonar.jdbc.password=sonardb#321
     sonar.jdbc.url=jdbc:mysql://localhost:3306/sonardb?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
     sonar.web.javaOpts=-server
     sonar.web.host=0.0.0.0
     sonar.web.port=9000
     sonar.web.context=/sonarqube (for If you want to web access like https://www.example.com/sonarqube)


-- Save & Quit (:wq)


Step: 6. Create Service for SonarQube :

 
# vi /etc/systemd/system/sonarqube.service
 
  [Unit]
  Description=SonarQube service
  After=syslog.target network.target

  [Service]
  Type=forking

  ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
  ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop

  User=sonarqube
  Group=sonarqube
  Restart=always

  [Install]
  WantedBy=multi-user.target


-- Save & Quit (:wq)

# systemctl daemon-reload

Step: 7. SonarQube Service Commands :

 
# service sonarqube start
# service sonarqube status
# service sonarqube stop

Step: 8. Install SonarScanner for Scanning :

 
# cd /opt
# wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
# unzip sonar-scanner-cli-3.3.0.1492-linux.zip
# mv sonar-scanner-3.3.0.1492-linux sonarscanner
# sudo chown -R sonarqube:sonarqube /opt/sonarscanner
# vi sonarscanner/conf/sonar-scanner.properties
    
    sonar.host.url=http://localhost:9000

-- Save & Quit (:wq)

# chmod +x sonarscanner/bin/sonar-scanner
# sudo ln -s /opt/sonarscanner/bin/sonar-scanner /usr/local/bin/sonar-scanner



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

Thursday, 11 April 2019

How To Configure GlusterFS on Ubuntu 16.04

GlusterFS_Cluster




Introduction:


-- GlusterFS is a free, open source and scalable network filesystem specially designed for 
data-intensive tasks such as cloud storage and media streaming. GlusterFS made up of two 
components a server and a client. The server runs glusterfsd and the client used to mount the
exported filesystem. You can achieve high availability by distributing the data across the multiple 
volumes/nodes using GlusterFS. GlusterFS client can access the storage like local storage. GlusterFS is a file-based scale-out storage that allows you to combine large numbers of 
commodity storage and compute resources into a high performance and virtualized pool. 
You can scale both capacity and performance on demand from terabytes to petabytes.

Requirements:

1. Two AWS EC2 instance for GlusterFS server with Ubuntu 16.04 and 20 GB external 
HDD on each. 
2. One AWS EC2 instance for GlusterFS client with Ubuntu 16.04 installed.
3. A static IP address 172.31.85.78 on glusterfs1 172.31.83.5 on glusterf2 and 172.31.82.27 

on glusterclient client is configured.

Note: On security group of all instances we need to allow the ports 111,24007,24008,
38465 to 38467,49152 to 49154,All ICMP port.


Installation Process of GlusterFS Servers:


Step: 1. Update your base system with the latest available packages :

# apt-get -y update

Step: 2. Login to the GlusterFS Servers & set the hostnames as glusterfs1 & glusterfs2 :

# hostname glusterfs1
# hostname glusterfs2

# vi /etc/hostname

glusterfs1

-- Save & Quit (:wq)

Step: 3. Configure Hostname Resolution:

# vi /etc/hosts

-- Add the following lines:

172.31.83.5 glusterfs2
172.31.85.78 glusterfs1

-- Save & Quit (:wq)

Step: 4. Install GlusterFS on Server1 & Server2:

# apt-get -y install apt-transport-https
# add-apt-repository -y ppa:gluster/glusterfs-4.1
# apt-get update -y
# apt-get -y install glusterfs-server
# systemctl enable glusterd.service
# systemctl start glusterd.service

Note: If facing any issue while adding GlusterFS Repository then do the following:

# vi /usr/bin/add-apt-repository

-- Change package header from `python3` to `python3.5` (or lower)

-- Save & Quit (:wq)

Step 5. Configure GlusterFS Storage:

# mkdir -p /gshare

Next, create a persistent mount point by editing /etc/fstab file:

# vi /etc/fstab

-- Add the following line:

/dev/xvdb /gshare ext4 defaults 0 0

-- Save & Quit (:wq)

# mount -a

Step: 6. Configure GlusterFS Storage Pool:

-- Run this command on GlusterFS Server 1:

# gluster peer probe glusterfs2
# gluster volume create gdata replica 2 glusterfs1:/gshare glusterfs2:/gshare force

-- You can verify the status of the trusted storage pool with the following command Output should
be like this peer probe: success.

#  gluster peer status

Step: 7. Configure GlusterFS Volume:

# gluster volume create gdata replica 2 glusterfs1:/gshare glusterfs2:/gshare force
# gluster volume start gdata

-- Checking the volume status on both server:

# gluster volume status

-- You can now check the status of created volume with the following command:

# gluster volume info gdata

Installation Process of GlusterFS Client:


Step: 1. Update your base system with the latest available packages:

# apt-get -y update

Step: 2. Login to the client and set the hostnames:

# hostname glusterclient

# vi /etc/hostname

glusterclient

-- Save & Quit (:wq)

Step: 3. Configure Hostname Resolution:

# vi /etc/hosts

-- Add the following lines:

172.31.83.5 glusterfs2
172.31.85.78 glusterfs1
172.31.82.27 glusterclient

-- Save & Quit (:wq)

ping glusterfs1
ping glusterfs2
ping glusterclient

Step: 4. Install GlusterFS Client:

# apt-get install apt-transport-https -y
# add-apt-repository ppa:gluster/glusterfs-4.1
# apt-get -y update

# apt-get -y install glusterfs-client

Note: If facing any issue while adding GlusterFS Repository the do the following:

# vi /usr/bin/add-apt-repository

-- Change package header from `python3` to `python3.5` (or lower)

-- Save & Quit (:wq)

Step 5. Create a directory to mount GlusterFS filesystem:

# mkdir /storage-pool

-- Create a persistent mount point by editing fstab file:

# vi /etc/fstab file

glusterfs2:/gdata /storage-pool glusterfs defaults,_netdev 0 0

-- Save & Quit (:wq)

# mount -a

-- Testing the Replication Features:

On our client machine (glusterclient), we can type this to add some files into our storage-pool directory:

# cd /storage-pool
# touch file.txt

If we look at our /gshare directories on each storage server, we will see that file is present on each system:

# cd /gshare (on glusterfs1 and glusterfs2 server)
# ls

-- Testing the High-availability Features:

To check the high-availability, shutdown the glusterfs2 instance. Now, goto the
glusterclient client instance and check the availability of the files:

On glusterclient:

# ls -l /storage-pool

You should see the file even though the glusterfs2 is down.

Next, create some files on glusterclient

# touch /storage-pool/file21.txt
# touch /storage-pool/file22.txt

All the files are now written on glusterfs1. Now, start the glusterfs2 instance.

Now, check the /gshare directory on both servers.

# ls -l /gshare

You should see all files there.

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

Sunday, 24 June 2018

How To Install Jenkins on Ubuntu 16.04


 

About Jenkins:

-- Jenkins is a Continuous Integration (CI) server or tool which is written in java. The software enables developers to find and solve defects in a code base rapidly and to automate testing of their builds.

Step: 1. Update & Upgrade the System :

# apt-get update && apt-get -y upgrade
# apt-get -y install zip unzip wget curl rsync telnet

Step: 2. Install JDK 8 :

# apt-get -y install software-properties-common
# add-apt-repository ppa:webupd8team/java -y
# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 -y
# apt-get update
# apt-get -y install oracle-java8-installer

Step: 3. Set JAVA_HOME Environment Variables :

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

#!/bin/bash
JAVA_HOME=/usr/lib/jvm/java-8-oracle/
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
# echo $JAVA_HOME
# java -version

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Step: 4. Download & Install Jenkins :

# wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
# sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
# apt-get -y update
# apt-get -y install jenkins
# service jenkins start
or
# systemctl start jenkins

Step: 5. Setting up Jenkins (Jenkins GUI Configurations) :


-- To use and configure Jenkins, visit the following address in your browser.

http://your-ip-address:8080

We should see "Unlock Jenkins" screen, which displays the location of the initial password.

# cat /var/lib/jenkins/secrets/initialAdminPassword

We'll copy the 32-character alphanumeric password from the terminal and paste it into the "Administrator password" field, then click "Continue". The next screen presents the option of installing suggested plugins or selecting specific plugins.


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

Sunday, 27 August 2017

How To Configure SVN (Subversion) Server on RHEL/Centos 6x

How To Configure SVN (Subversion) Server on RHEL/Centos 6x


Q. What is SVN (Subversion)?

-- Subversion is a free/open-source version control system. Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of "time machine".

Step: 1. Install Apache Server :

# yum -y install httpd httpd-devel mod_ssl

Step: 2. Configure Apache Server :

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

-- Uncomment :

NameVirtualHost *:80

-- Add the following Lines at the End :

DocumentRoot "/var/www/html"
RewriteEngine on
CheckCaseOnly On

-- Save & Quit (:wq)

Step: 3. Install SVN Packages :

# yum -y install mod_dav_svn subversion

Step: 4. Modify Subversion config file :

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

-- Add following config to /etc/httpd/conf.d/subversion.conf file.

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /repos>
  DAV svn
  SVNParentPath /var/www/svn/repos
  AuthType Basic
  AuthName "Welcome To KMInfosystems VersionControl"
  AuthUserFile /var/www/svn/secure/svn-users
  AuthzSVNAccessFile /var/www/svn/secure/svn-access-control
  Require valid-user
</Location>

-- Save & Quit (:wq)

Step: 5. Restart the httpd Service :

# service httpd restart
# chkconfig httpd on

Step: 6. Add SVN (Subversion) Users :

-- At First Create User Directory :

# mkdir -p /var/www/svn/secure/

-- For 1st User :

# htpasswd -cm /var/www/svn/secure/svn-users koushik

-- For 2nd User :

# htpasswd -m /var/www/svn/secure/svn-users user1
# htpasswd -m /var/www/svn/secure/svn-users user2
# htpasswd -m /var/www/svn/secure/svn-users user3

Step: 7. Create SVN Access Control List :

# cd /var/www/svn/secure/
# touch svn-access-control
# vi svn-access-control

[groups]
admin = koushik
testrepo = user2,user3
prodrepo = user1

[/]
@admin = rw

[testrepo:/]
@testrepo = rw

[prodrepo:/]
@prodrepo = rw

-- Save & Quit (:wq)

Step: 8. Create and configure SVN Repository :

# mkdir /var/www/svn/repos
# cd /var/www/svn/repos

# svnadmin create testrepo
# chmod -Rf 777 testrepo

# svnadmin create prodrepo
# chmod -Rf 777 prodrepo

Step: 9. Restart Apache Server :

# service httpd restart

Step: 10. Point Your Web Browser :

http://192.168.72.140/repos/testrepo/

User: koushik
Pass: redhat

Step: 11. Configure Repository (Optional) :

To disable anonymous access and enable access control add following rows to svnserve.conf file.

# vi /var/www/svn/repos/testrepo/conf/svnserve.conf

## Disable anonymous access ##
anon-access = none

## Enable access control ##
authz-db = authz

-- Save & Quit (:wq)

Step: 12. Create trunk, branches and tags structure under testrepo :

# mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}

Step: 13. Then import Template to Project Repository using “svn import” command :

# svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/repos/testrepo/

Password for 'root': (Just Press Enter)

Authentication realm: <http://localhost:80> Subversion repositories

Username: user1
Password for 'user1': redhat

Adding         /tmp/svn-structure-template/trunk
Adding         /tmp/svn-structure-template/branches
Adding         /tmp/svn-structure-template/tags

Store password unencrypted (yes/no)? yes

Committed revision 1.

Note: Check results on browser and see testrepo revision 1.

http://192.168.72.140/repos/testrepo

User: user2, user3
Pass: redhat

http://192.168.72.140/repos/prodrepo

User: user1 (only user1)
Pass: redhat

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


Saturday, 27 May 2017

How To Configure PredictionIO on CentOS/RHEL 6x

How To Configure PredictionIO on CentOS/RHEL 6x


What is PredictionIO ?

-- PredictionIO is an open source Machine Learning Server. It empowers programmers and data engineers to build smart applications. With PredictionIO, you can add the following features to your apps instantly: predict user behaviors.


Step: 1. Set Host Name :

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

HOSTNAME=predictionio.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

192.168.72.140    predictionio.domain.com        predictionio

-- Save & Quit (:wq)

Step: 3. Stop Firewall & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

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. Reboot the System :

# init 6

Step: 6. Download Oracle JAVA :

# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-i586.tar.gz"

#  tar -zxvf jdk-8u5-linux-i586.tar.gz

Step: 7. Install JAVA using Alternatives :

# cd jdk1.8.0_05/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_05/bin/java 2
# alternatives --config java


There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.8.0/bin/java
 + 2           /opt/jdk1.7.0_55/bin/java
   3           /opt/jdk1.8.0_05/bin/java

Enter to keep the current selection[+], or type selection number which you want to make default. : 3

Step: 8. 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)

Note: If it shows error, Then install the following Package :

# yum -y install glibc.i686
   
Step: 9. Setup Environment Variables :

Setup JAVA_HOME Variable:
   
# export JAVA_HOME=/opt/jdk1.8.0_05

Setup JRE_HOME Variable:

# export JRE_HOME=/opt/jdk1.8.0_05/jre

Setup PATH Variable:

# export PATH=$PATH:/opt/jdk1.8.0_05/bin:/opt/jdk1.8.0_05/jre/bin
   
Step: 10. Change the Environment Variable :

# cd
# vi .bash_profile

-- Add the following lines :

PATH=$PATH:/opt/jdk1.8.0_05/bin:/opt/jdk1.8.0_05/jre/bin
export JAVA_HOME=/opt/jdk1.8.0_05
export JRE_HOME=/opt/jdk1.8.0_05/jre

-- Save & Quit (:wq)

Step: 11. Execute the Bash Profile :
   
# . .bash_profile
 
Step: 12. Download and prepare for the PredictionIO :
# yum -y install zip unzip
# cd /opt/
# wget http://download.prediction.io/PredictionIO-0.7.3.zip
# unzip PredictionIO-0.7.3.zip

Step: 13. Setting Up PredictionIO (Run the 3rd-party software setup script) :

# cd /opt/PredictionIO-0.7.3/bin
# sh setup-vendors.sh
   
Cannot find mongod from process list, search path, nor vendors area. Do you want to automatically install MongoDB 2.4.9? [y/n] y

Cannot find hadoop from search path nor vendors area. Do you want to automatically install Apache Hadoop 1.2.1? (Please make sure you can SSH to the localhost without a password.) [y/n] n

Step: 14. Make data & logs directory for PredictionIO :

# cd ..
# mkdir -p vendors/mongodb/data
# mkdir -p vendors/mongodb/logs
# vendors/mongodb-linux-x86_64-2.4.9/bin/mongod --config conf/mongodb/mongodb.conf >/dev/null 2>&1 &

Step: 15. Afterwards, Start all PredictionIO Services :

# cd /opt/PredictionIO-0.7.3/bin
# sh start-all.sh
       
Found MongoDB in vendors area. Do you want to start it? [y/n] y
   
Step: 16. Now Create a user For PredictionIO :

# cd /opt/PredictionIO-0.7.3/bin
# sh users
   
PredictionIO CLI User Management

1 - Add a new user
2 - Update email of an existing user
3 - Change password of an existing user
Please enter a choice (1-3): 1
Adding a new user

Email: kchatterjee@domain.com
Password: Passw0rd
Retype password: Passw0rd
First name: admin
Last name:
 
User added...

Step: 17. Now, you should be able to access PredictionIO :

http://192.168.72.140:9000

Step: 18. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 19. Restart Apache Server :

# chkconfig httpd on
# service httpd restart
   
Step: 20. Make Reverse Proxy Setting for PredictionIO :

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

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin support@domain.com
  ServerName 192.168.72.140
  # ServerAlias


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php index.html
  DocumentRoot /var/www/html


  # Custom log file locations
  LogLevel warn
  ErrorLog  /logs/192.168.72.140-error_log
  SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
  CustomLog /logs/192.168.72.140-access_log combined Env=!DontLog

</VirtualHost>

-- Save & Quit (:wq)
   
# vi /etc/httpd/conf.d/predictionio.domain.com.conf
   
<VirtualHost *:80>
  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin support@domain.com
  ServerName www.predictionio.domain.com
  ServerAlias predictionio.domain.com
  ProxyRequests On
  ProxyPass / http://localhost:9000/
  ProxyPassReverse / http://localhost:9000/
</VirtualHost>

-- Save & Quit (:wq)

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

-- Find the Line & Uncomment :

NameVirtualHost *:80

-- Save & Quit (:wq)
       
# mkdir /logs
# service httpd restart
   
Step: 21. Now, Point your Web Browser :

http://predictionio.domain.com
User: admin
Pass: Passw0rd

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

Sunday, 9 April 2017

How To Configure Revive AD Server on CentOS/RHEL 6x

How To Configure Revive AD Server on CentOS/RHEL 6x



What is OpenX Ad Server?

-- OpenX Ad Server is an ad server, created and published by the British-American company OpenX.org. It is a system that can be used to manage and optimize the advertising space on one or more websites. It is a tool for web site owners (called ‘publishers’ in the online advertising industry) but also for organizations running their own ad network. It can even be used by advertisers to manage and measure the ads that they display on their distribution of sites and/or ad networks.

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.97.40    ad.domain.com     ad

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Iptables (This Is For On CentOS/RHEL Server) :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Rebbot the System :

# init 6

Step: 4. Install Apache Server :


# yum -y install httpd httpd-devel wget

Step: 5. 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 Ad Server Package :
 
# cd /var/www/html
# wget http://download.revive-adserver.com/revive-adserver-3.0.2.zip
# unzip revive-adserver-3.0.2.zip
# mv revive-adserver-3.0.2 adserver
# chmod -Rf 775 adserver

Step: 7. Edit the /etc/httpd/conf/httpd.conf File :

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

Add those Lines :

<Directory /var/www/html/adserver>
    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

Step: 9. Start Mysqld Service & Set MySQL Root Password :

# service mysqld start
# chkconfig mysqld on

# mysql_secure_installation

-- Press "Enter".
-- Type "Y" & Press "Enter".
-- Give the Root Password & Press "Enter".
-- Type "Y" & Press "Enter".
-- Type "N" & Press "Enter".
-- Type "Y" & Press "Enter".
-- Type "Y" & Press "Enter".

Step: 10. Create Database for Openx :

# mysql -u root -p
Give root Password: redhat

Mysql> create database revivedb character set utf8;
Mysql> grant all privileges on revivedb.* to 'revive'@'localhost' identified by '0p3nx123';
Mysql> flush privileges;
Mysql> exit

Step: 11. Install EPEL Repository :

# yum -y install epel-release

Step: 12. Install PHP5 Scripting Language :

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

Step: 13. Create a file Under "html" Directory for Testing php :

# 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 Web Browser & Check php :

Ex- http://server_ip_address/info.php

Step: 16. Configure Openx AD Server :

Go to http://server_ip/adserver

-- Check "I Agree".
-- Database Name: revivedb
     Database Username: revive
     Database Password: 0p3nx123
     Database Hostname: localhost
  
-- Click on "Continue".
-- Administrator Username: admin
     Administrator Password: Passw0rd
     Repeat Password: Passw0rd
     Administrator Email Address: kchatterjee@domain.com
     Language: English
     Timezone: GMT+0530 Asia/Culcutta
  
-- Click on "Continue"
-- Click on "Continue".

Step: 17. OpenX Memcached Configuration from Web Interface :

http://Server_ip/adserver/plugin-settings.php?group=oxMemcached

-- Add your memcached server and port if it’s default installation on the same machine add
    localhost:11211 and expiry time of 600 seconds.
-- Click on "Save Changes"

-- Now you need to go in Configuration
-- Banner Delivery Settings and set Time Between Banner Cache Updates to 600 seconds and
     change Banner Delivery Cache Store Type to Memcached.

-- Click on "Save Changes"



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

 

Saturday, 18 March 2017

How To Configure Magento2 with Nginx on Ubuntu 14.04

How To Configure Magento2 with Nginx on Ubuntu 14.04


Q. What is Magento :

-- Magento is an e-commerce platform built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online store. Magento offers powerful marketing, search engine optimization, and catalog-management tools.

Step: 1. Set Host Name :

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

magento.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Hosts File :

# vi /etc/hosts

10.100.97.37    magento.domain.com        magento

-- Save & Quit (:wq)

Step: 3. Update the System :

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

Step: 4. Install NTP Server For Time Synchronization :

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

Step: 5. Install Nginx Server :

# apt-get -y install nginx

-- Verify that Nginx has been Installed Properly by Checking the Port :

# netstat -plntu | grep 80

Step: 6. Install PHP7 with PHP7-FPM :

# apt-get -y install language-pack-en-base
# LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
# apt-get update

# apt-get -y install php7.0 php7.0-fpm php7.0-mcrypt php7.0-curl php7.0-cli php7.0-mysql \
    php7.0-gd php7.0-xsl php7.0-json php7.0-intl php7.0-dev php7.0-common php7.0-mbstring \
    php7.0-zip php-pear php-soap libcurl3 curl wget

Step: 7. Modify PHP Settings For Magento :

# vi /etc/php/7.0/fpm/php.ini

memory_limit = 512M
max_execution_time = 1800
zlib.output_compression = On

-- Save & Quit (:wq)

# vi /etc/php/7.0/cli/php.ini

memory_limit = 512M
max_execution_time = 1800
zlib.output_compression = On

-- Save & Quit (:wq)

Step: 8. Restart the PHP7-FPM Service to Apply the Configuration Changes :
 
# service php7.0-fpm restart

Step: 9. Install MySQL Server :

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

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

Step: 10. Create Database & DB User for Magento :

# mysql -u root -p
Enter the Password:

mysql> create database magentodb;
mysql> grant all privileges on magentodb.* to magento@localhost identified by 'password';
mysql> flush privileges;
mysql> \q

Step: 11. Install PHP Composer :

# cd ~/
# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/bin/composer

-- Now Verify that Composer Command is Working :

# composer -v

Step: 12. Download & Extract Magento 2 :

# mkdir /var/www/
# cd /var/www/
# wget https://github.com/magento/magento2/archive/2.0.7.tar.gz
# tar -zxvf 2.0.7.tar.gz
# mv magento2-2.0.7 magento2

Step: 13. Configure the Magento Key :

At 1st Register A Magento Account. Click on Below Link :

http://repo.magento.com/

-- Create An Account.
-- After Created the Account & Click on "My Account"
-- Click on "Developers"
-- Click on "Secure Keys"
-- Give A Name & Click on "Generate New". (It will Generate Random Public & Private Keys).

Step: 14. Install Third-Party Components for Magento :

# cd /var/www/magento2/
# composer install -v

Authentication required (repo.magento.com):
Username: 65500dc62bc7a48f09c36056df12bf03 (Use Public Key For User Name)
Password: 528d7b92a879cb673f18940322312e10 (Use Private Key For User Password)
     
-- Do you want to store credentials for repo.magento.com in /root/.config/composer/auth.json ?
     [Yn] Type "Y" & Press "Enter"

Step: 15. Configure the Nginx Virtualhost :

# vi /etc/nginx/sites-available/magento

-- Paste the below Configuration :

upstream fastcgi_backend {
        server  unix:/run/php/php7.0-fpm.sock;
}

server {

        listen 80;
        server_name magento.domain.com;
        set $MAGE_ROOT /var/www/magento2;
        set $MAGE_MODE developer;
        include /var/www/magento2/nginx.conf.sample;
}

-- Save & Quit (:wq)

# ln -s /etc/nginx/sites-available/magento /etc/nginx/sites-enabled/
# service nginx restart

Step: 16. Install Magento Through Command Line :

# cd /var/www/magento2
# bin/magento setup:install --backend-frontname="adminlogin" \
--key="65500dc62bc7a48f09c36056df12bf03" \
--db-host="localhost" \
--db-name="magentodb" \
--db-user="magento" \
--db-password="password" \
--language="en_US" \
--currency="INR" \
--timezone="Asia/Kolkata" \
--use-rewrites=1 \
--use-secure=0 \
--base-url="http://magento.domain.com" \
--base-url-secure="https://magento.domain.com" \
--admin-user=admin \
--admin-password=Passw0rd \
--admin-email=admin@domain.com \
--admin-firstname=Koushik \
--admin-lastname=Chatterjee \
--cleanup-database

IMPORTANT Note:

backend-frontname: The admin page for our magento site, we use 'adminlogin'.
Key: Magento Keys, we can generate it, or find it random on http://randomkeygen.com/.
Base-url: Make sure it is same with Virtualhost Configuration.

Step: 17. Set Appropriate Permission for Magento :

# cd /var/www/magento2/
# chmod 700 /var/www/magento2/app/etc
# chown -Rf www-data:www-data .

Step: 18. Restart the Nginx Server :

# service nginx restart

Step: 19. Access the Site & Admin Panel :

http://magento.domain.com

-- For Admin Access :

http://magento.oit.com/adminlogin
User: admin
Pass: Passw0rd

Note: If You get an Error about a Missing Magento indexer Cronjob, then you can Solve it by adding the Following Cronjob to Your Server.

# crontab -u www-data -e

-- Add the Following Lines:

* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/magento2/update/cron.php >> /var/www/magento2/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/magento2/bin/magento setup:cron:run >> /var/www/magento2/var/log/setup.cron.log

-- Save & Quit (:wq)

# service cron restart

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


Sunday, 5 March 2017

Install & Configure Chamilo (Learning Management System) on CentOS 6x

Install & Configure Chamilo (Learning Management System) on CentOS 6x


Q. What is Chamilo?

-- Chamilo is a  software which is used for virtual/online trainings or Learning Management System. Chamilo is absolutely free and comes under GPL License, with Chamilo you can store and organize all of study materials which can be utilized by tutors and students.

-- Some of the important features of Chamilo are:

1. Course and user management based on various user’s profiles like students, Teachers, Session
     Managers, Administrators.
2. You can Download, upload or hide some course contents as and when required.
3. Create, add , delete questions in the form of multiple choice, fill in the blank, matching type questions or
     open questions.
4. Various types of survey can be conducted with the help of Chamilo.
5. You can enable deadline based assignments.
6. Users can be generated in bulk.
7. CSV/Excel data can bde downloaded or uploaded and Instant results reports can be generated.

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Firewall :


# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP :

# 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 MySQL Database Server :

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

Step: 6. Install Epel Repo :

# rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Step: 7. Install PHP :

# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

# yum -y install php56w php56w-mysql php56w-common php56w-gd php56w-mbstring \
    php56w-mcrypt php56w-devel php56w-xml php56w-imap php56w-ldap php56w-pdo \
    php56w-odbc php56w-pear php56w-xmlrpc php56w-soap php56w-cli mod_ssl \
    libtool-ltdl mhash mcrypt unzip
 
Step: 8. Start Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 9. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 10. Create Database and User for Chamilo :

# mysql -u root -predhat

mysql> create database chamilodb;
mysql> grant all privileges on chamilodb.* TO chamilo@localhost identified by 'password';
mysql> grant all privileges on chamilodb.* TO chamilo@'%' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 11. Install Some Prerequired Packages :

# yum -y install gcc-c++ libuuid-devel

Step: 12. Modify php.ini :


# vi /etc/php.ini

date.timezone = "Asia/Kolkata"
max_execution_time = 300
max_input_time = 600
memory_limit = 256M
post_max_size = 128M
upload_max_filesize = 128M
session.cookie_httponly = On
extension = xapian.so

-- Save & Quit (:wq)

Step: 13. Enable Internationalization Support in PHP :

# yum -y install libicu libicu-devel.x86_64
# /usr/bin/pecl install intl
# echo 'extension=intl.so' >> /etc/php.ini

Step: 13. Download latest Version of Chamilo :

# cd /var/www/html/
# wget https://github.com/chamilo/chamilo-lms/archive/v1.10.0.zip
# unzip v1.10.0.zip
# rm -rf v1.10.0.zip
# mv chamilo-lms-1.10.0 chamilo
# chmod -Rf 755 /var/www/html/chamilo
# chown -R apache:apache /var/www/html/chamilo

Step: 14. Restart the Apache Service :

# service httpd restart

Step: 15. Install Chamilo Through Web Browser :

http://192.168.72.220/chamilo

-- Click on "Install Chamilo".
-- Select Language & Click Next.
-- Scroll Down & Click "New Installation".
-- Check "I Accept" & Click Next.
-- MySQL database settings:
     Database Host: localhost
     Port: 3306
     Database Login: chamilo
     Database Password: password
     Main Chamilo database (DB): chamilodb
  
-- Click on "Check Database Connection".
-- Click Next.
-- Config settings:
     Administrator login: admin
     Administrator Password: Passw0rd
     Administrator first name: Koushik
     Administrator last name: Chatterjee
     Administrator email: kchatterjee@domain.com
  
-- Click Next.
-- Click "Install Chamilo".
-- Click "Go to Your Newly Created Portal".
     User: admin
     Pass: Passw0rd

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

 

Sunday, 19 February 2017

How to Configure Online Shopping Store Using osCommerce on CentOS/RHEL 6x & Ubuntu 14.04

How to Configure Online Shopping Store Using osCommerce on CentOS/RHEL 6x & Ubuntu 14.04


Q. What is osCommerce ?

-- OsCommerce (Online Shopping Store) is an e-commerce and Online Store-Management Software program. It can be used on any web server that has PHP and MySQL installed. It is available as free software under the GNU General Public License.

Step: 1. Bind Hosts File :


# vi /etc/hosts

192.168.72.221    ser2.domain.com    ser2

-- Save & Quit (:wq)

Step: 2. Stop Firewall :

For CentOS/RHEL Users :

# service iptables stop
# chkconfig iptables off

For Debian Users :

# service ufw stop

Step: 3. Disable Selinux :

Important: This 3rd Step, is only Applicable for RedHat & CentOS Based Systems only, Debian & Ubuntu users skip this Step.

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Important: In Case you Don’t want to Disable Selinux you can use the Following Command to over-ride policy :

# chcon -R -t httpd_sys_content_rw_t /var/www/html/

Step: 4. Reboot the System :

# init 6

Step: 5. Install Apache Server :

For CentOS/RHEL Users :

# yum -y install httpd httpd-devel

For Debian Users :

# apt-get -y install apache2

Step: 6. Install PHP :

For CentOS/RHEL Users :

# 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 \
    php-pdo php-intl mod_ssl
 
For Debian Users :

# apt-get -y install php5 php5-mysql libapache2-mod-php5

Step: 7. Restart Apache Service :

For CentOS/RHEL Users :

# service httpd restart
# chkconfig httpd on

For Debian Users :

# service apache2 restart

Step: 8. Install MySQL Server :

For CentOS/RHEL Users :

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

For Debian Users :

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

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

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 10. Create Database For osCommerce :

# mysql -u root -predhat

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

Step: 11. Install Following System Utilities :

For CentOS/RHEL Users :

# yum -y install wget unzip

For Debian Users :

# apt-get -y install wget unzip

Step: 12. Download OsCommerce Online Shopping Package :

# cd /var/www/html
# wget http://www.oscommerce.com/files/oscommerce-2.3.4.zip
# unzip oscommerce-2.3.4.zip
# mv oscommerce-2.3.4/catalog /var/www/html/commerce
# rm -rf oscommerce-2.3.4 oscommerce-2.3.4.zip

Step: 13. Give Appropriate Permission :

# chmod 777 /var/www/html/commerce/includes/configure.php
# chmod 777 /var/www/html/commerce/admin/includes/configure.php

Step: 14. Installing OsCommerce Online Shopping Package through Web Browser :

http://<ip_or_domain>/commerce/install

-- Click on "Start"
-- Database Server:
     Database Server: localhost
     Username: commerce
     Password: password
     Database Name: commercedb
  
-- Click on "Continue"
-- Web Server:
     WWW Address: http://192.168.72.221/commerce/
     Webserver Root Directory: /var/www/html/commerce/
  
-- Click on "Continue"
-- Online Store Settings:
     Store Name: Your Store Name
     Store Owner Name: Koushik Chatterjee
     Store Owner E-Mail Address: kchatterjee@domain.com
     Administrator Username: admin
     Administrator Password: Passw0rd
     Time Zone: select Kolkata

-- Click on "Continue"

Step: 15. Secure the osCommerce Online Shopping Store :

# rm -rf /var/www/html/commerce/install/
# chmod 644 /var/www/html/commerce/includes/configure.php
# chmod 644 /var/www/html/commerce/admin/includes/configure.php

Step: 16. To Check & Set the Appropriate Permission :

http://192.168.72.221/commerce/admin/login.php
Username: admin
Password: Passw0rd

-- Click on "Tools"
-- "Security Directory Permissions".

# chmod -R 775 /var/www/html/commerce/images/
# chown -R root:apache /var/www/html/commerce/images/
# chmod -R 775 /var/www/html/commerce/pub/
# chown -R root:apache /var/www/html/commerce/pub/
# chmod -R 755 /var/www/html/commerce/includes/
# chmod -R 755 /var/www/html/commerce/admin/
# chown -R root:apache /var/www/html/commerce/admin/backups/
# chmod -R 775 /var/www/html/commerce/admin/backups/
# chmod -R 775 /var/www/html/commerce/includes/work/
# chown -R root:apache /var/www/html/commerce/includes/work/

# chmod -R 775 /var/www/html/commerce/images/
# chown -R root:apache /var/www/html/commerce/images/
# chmod -R 775 /var/www/html/commerce/pub/
# chown -R root:apache /var/www/html/commerce/pub/
# chmod -R 755 /var/www/html/commerce/includes/
# chmod -R 755 /var/www/html/commerce/admin/
# chown -R root:apache /var/www/html/commerce/admin/backups/
# chmod -R 775 /var/www/html/commerce/admin/backups/
# chmod -R 775 /var/www/html/commerce/includes/work/
# chown -R root:apache /var/www/html/commerce/includes/work/

-- Click on "Configuration"
-- Click on "Administrator"

# chmod 775 /var/www/html/commerce/admin/.htpasswd_oscommerce
# chmod 775 /var/www/html/commerce/admin/.htaccess
# chgrp apache /var/www/html/commerce/admin/.htpasswd_oscommerce
# chgrp apache /var/www/html/commerce/admin/.htaccess
   
-- Again Click on "Administrator"
-- Click on "Edit" Button.
-- Give Admin User Name & Password.
-- Check on "Protect With htaccess/htpasswd".
-- Finally Click on "Save" Button.

http://192.168.72.221/commerce/

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


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

 

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, 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, 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
Copyright © 2016 Kousik Chatterjee's Blog