Thursday 24 December 2015

How to Install Pydio on Centos 6.X


Pydio on Centos 6.X

Pydio is an Open source, secure and powerful online file sharing and synchronization software solution that can be an alternative to many online cloud storage systems. It can be accessed from the web, desktop or mobile platforms and hosting is private therefore you can implement your own security measures.

Requirments: Apache, Php, Mysql (LAMP)

Step 1: Create Database for Pydio

# mysql -u root -predhat -e "create database pydio;"
# mysql -u root -predhat -e "grant all privileges on pydio.* to pydio@'localhost' identified by 'redhat';"
# mysql -u root -predhat -e "grant all privileges on pydio.* to pydio@'%' identified by 'redhat';"
# mysql -u root -predhat -e "flush privileges;"

Step 2: Download and Installing Pydio File Hosting Server

# cd /mnt
# service iptables stop
# chkconfig iptables off
# wget https://download.pydio.com/qtev2upyln3hfi46pcya/pydio-enterprise-6.2.1.zip --no-check-certificate
# unzip pydio-enterprise-6.2.1.zip
# mv pydio-enterprise-6.2.1.zip /var/www/html/pydio
# chmod -R 777 /var/www/html/pydio/data/
# vi /etc/httpd/conf/httpd.conf

Find the line, "AllowOverride None" and Change it to "AllowOverride All"

AllowOverride All (Line Number 339)

--- save and quit (:wq) ---

Step 3: Open pydio on browser to load the web installer

https://ip-address/pydio/

1. Click on "Click here to continue to Pydio"
2. Click on the “Start Wizard” and follow on screen installer instructions….
3. Create Pydio Admin Account
4. Setup Languages
5. Configure Pydio MySQL Database
6. Click "Install Pydio Now"
7. Now open the https://ip-address/pydio/ again after installation and then login with admin Details or Newly Created User and Test it.

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

Monday 7 December 2015

How to Setup Chat Support On Website With Mibew Messenger on Centos/RHEL 6.X

Setup Chat Support On Your Website With Mibew Messenger

Mibew Messenger, also known as Open Web Messenger, is an open-source live/chat support application written in PHP and MySQL. It enables one-on-one chat assistance in real-time directly from your website. Just place the Mibew Messenger button at your site, the visitors of your site will be able to get assistance from your operators, technical support executives and customer support executives who help them by clicking on the chat button.

Step 1: Prerequisites

* First you have to install and configure LAMP server

Step 2: create a database called “mibewdb” and database user called “mibewuser” with password “redhat” for ProcessWire

# mysql -u root -p
Enter password:

mysql> create database mibewdb;
Query OK, 1 row affected (0.02 sec)

mysql> GRANT ALL ON mibewdb.* TO mibewuser@localhost IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

Step 3: Getting Mibew

# cd /mnt && wget https://sourceforge.net/projects/webim/files/Mibew%20Messenger/1.6.5/mibew165.zip --no-check-certificate

Step 4: Create a directory called “mibew” under web root folder i.e /var/www/html/

# mkdir /var/www/html/mibew

Step 5: Copy and unzip the mibew installation file in /var/www/html/mibew/ folder

# cp mibew165.zip /var/www/html/mibew/
# cd /var/www/html/mibew/
# unzip mibew165.zip
# rm -rf mibew165.zip

Step 6: Set privileges to mibew directory with command

# chown -R root:apache /var/www/html/mibew/

Step 7: Edit file config.php file

# vi /var/www/html/mibew/libs/config.php

$webimroot = "/mibew";

#### Enter the MySQL details as shown below
*  MySQL Database parameters
 */
$mysqlhost = "localhost";
$mysqldb = "mibewdb";
$mysqllogin = "mibewuser";
$mysqlpass = "redhat";
$mysqlprefix = "";

---- save and quit (:wq) ----

Step 8: Begin Installation

Open up browser and go to to URL http://domain-name/mibew/install/index.php or http://ip-address/mibew/install/index.php

If everything seems ok, the following screen should appear. Click Create required tables link.
and follow the Screen for the Further Instructions

Step 9: login to chat as user admin with empty password. For security reason set the password immediately and remove the /mibew/install/ folder

# rm -fr /var/www/html/mibew/install/

Step 10: Now click on the Proceed to Login page and login as admin with empty password

Step 11: In the next page you will be asked to create your administrator login password and email as shown below


Step 12: From here, you can

– create/delete operators,

– find the waiting users,

– Search chat history,

– View the chat statistics,

– Setup common system behavior and chat options,

– Change administrator profile details and so on.

Step 13: How to add the chat button on my website

It’s very simple. Go to the Mibew admin console. You will see a link called button code in the middle of the admin console window. Open the link in the new window and copy the HTML code and you can paste them in your website at any place. Also can change the chat image using Choose image button and can change the chat window style as well.

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

Saturday 5 December 2015

Shell Script For Take Backup of Mysql Databases


Shell Script For Take Backup of Mysql Databases


Step 1: Create Directory For Backups Scripts & Backups

# mkdir -p /backups/db_backup /backups/scripts

Step 2: Create Backups Scripts

# vi /backups/scripts/db_backups.sh

#!/bin/bash
export path1=/backups/db_backup  ### Backup Path
date1=`date +%y%m%d_%H%M%S`
/usr/bin/find /backups/db_backup/* -type d -mtime +14 -exec rm -r {} \; 2> /dev/null  ### Retention For Backups of 15 Days
cd $path1/
mkdir $date1
USER="root"  ## Mysql User Name
PASSWORD="redhat"  ## Mysql User's Password
OUTPUTDIR="$path1/$date1"
MYSQLDUMP="/usr/bin/mysqldump"
MYSQL="/usr/bin/mysql"
HOST="localhost"
databases=`$MYSQL --user=$USER --password=$PASSWORD --host=$HOST \
-e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
echo "` for db in $databases; do
   echo $db

       if [ "$db" = "performance_schema" ] ; then
       $MYSQLDUMP --force --opt --single-transaction --lock-tables=false --skip-events --user=$USER --password=$PASSWORD --host=$HOST --routines \
        --databases $db | gzip > "$OUTPUTDIR/$db.gz"
        else

$MYSQLDUMP --force --opt --single-transaction --lock-tables=false --events --user=$USER --password=$PASSWORD --host=$HOST --routines \
   --databases $db | gzip > "$OUTPUTDIR/$db.gz"
fi
done `"
/root/monitor.sh 99 | tee /root/backup_report >> /root/monthly_backup_report #to create a backup report in /root/backup_report file
cat /root/backup_report | mail -s "backup_report of Test Server (192.168.72.240) "  -r root@Test_Server deb.mind009@gmail.com  ### Mail the Backup Report But Need Monitoring Script for this Feature

--- save and quit (:wq) ---

Step 3: Schedule Backup Scripts on Crontab

## Then Schedule the script to Crontab for Run it As per a schedule, Here we are scheduling it Daily Basis at 12:00 AM

# crontab -e

0 0 * * * /backups/scripts/db_backups.sh > /dev/null

--- save and quit (:wq) ---

# crontab -l (To see the Scheduled Crontab List)

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

Shell Script For Take Backup of Web Files on Centos/RHEL

Shell Script For Take Backup of Web Files on Centos/RHEL

Step 1: Create Directory For Backup Scripts and Backups

# mkdir -p /backups/web_backup /backups/scripts

Step 2: Create Backups Backup Script

# vi /backups/scripts/web_backups.sh

#!/bin/bash
export path1=/backups/web_backup ### Backup Path
date1=`date +%y%m%d_%H%M%S`

/usr/bin/find /backups/web_backup/* -type d -mtime +6 -exec rm -r {} \; 2> /dev/null
mkdir $path1/$date1  ### Retention For Backups of 7 Days
cp -r /var/www/html $path1/
cd $path1/html
for i in */; do /bin/tar -zcvf "$path1/$date1/${i%/}.tar.gz" "$i"; done
if [ $? -eq 0 ] ; then
rm -r $path1/html
fi

if [ `date +%d` -eq '01' ] ; then
mv /home/som/monthly_backup_report /root/Test_192.168.72.240_Backup_Report_`date +%B_%G --date="-1 day"`
fi

/root/monitor.sh 99 | tee /root/backup_report >> /root/monthly_backup_report ### to create a backup report in /root/backup_report file
cat /root/backup_report | mail -s "backup_report of Test Server (192.168.72.240)" deb.mind009@gmail.com ### Mail the Backup Report But Need Monitoring Script for this Feature

--- save and quit (:wq) ---

Step 3: Schedule The Script on Crontab

## Then Schedule the script to Crontab for Run it As per a schedule, Here we are scheduling it Daily Basis at 12:00 AM

# crontab -e

0 0 * * * /backups/scripts/web_backups.sh > /dev/null

--- save and quit (:wq) ---

# crontab -l (To see the Scheduled Crontab List)

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

How to Install utorrent on Centos/RHEL 6.X


Install utorrent on Centos/RHEL 6


Step 1: Install needed packages

# yum install -y wget glibc openssl* libgcc unzip

Step 2: Create sym link for libssl because the CentOS 6 has newer version of uTorrent required For x86_64

# ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8
# ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8

Step 3: Download uTorrent for Linux and Extract it

# cd /mnt && wget -qO - http://download.utorrent.com/linux/utorrent-server-3.0-ubuntu-10.10-27079.x64.tar.gz |tar xvzf -

Step 4: change the permission on uTorrent-server folder and link uTorrent server to the /user/bin directory

# chmod -Rf 777 /mnt/utorrent-server-v3_0/
# ln -s /mnt/utorrent-server-v3_0/utserver /usr/bin/uts

Step 5: Finally, run the commands below to start uTorrent (it will run on 8080 port by default)

# uts -settingspath /mnt/utorrent-server-v3_0/

Step 6: open the GUI on the Browser of the Torrent

http://192.168.72.243:8080/gui
User: admin
Pass: none

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

Thursday 3 December 2015

How to Install Lamp on Centos 7


Install Lamp on Centos 7
1. Install Apache:

# yum -y install httpd httpd-devel

2. Edit httpd.conf file:

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

add this last line-
RewriteEngine on
CheckCaseOnly On

----Save & Quit (:wq)----

3. make logs directory:

# mkdir /logs

4. Go to /var/www/html :


# vi index.html

Make A HTML
add those line...

<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>

----Save & Quit (:wq)----

5. Install MySQL Database Server:

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

6. Start Mysqld Service:

# systemctl restart mysqld

7. Changing MySQL Root Password:


# mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit

8. Check by logging in:


# mysql -u root -p
Enter Password: <your new password>


mysql> show databases;
+--------------------------------+
| Database               |
+---------------------------------+
| information_schema |
| mysql                         |
+---------------------------------+
2 rows in set (0.00 sec)


mysql> exit

9. Install PHP5 Scripting Language:

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

# yum install -y  php56w php56w-cli php56w-mysql php56w-pdo php56w-pecl-memcache php56w-xml php56w-imap php56w-mbstring php56w-mcrypt php56w-common php56w-fpm       php56w-odbc php56w-devel  php56w-xmlrpc php56w-soap php56w-pecl-igbinary php56w-pdo php56w-ldap php56w-xml php56w-imap php56w-pear php56w-gd

10. Create a file named /var/www/html/info.php:


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


<?php
  phpinfo();
?>

----Save & Quit (:wq)----

11. Restart Apache to load php:

# systemctl restart httpd

12. Then point your browser to http://ip address/info.php:


Ex- http://192.168.72.249/info.php

13. Download this phpMyAdmin rpm:


# cd /var/www/html
# wget https://files.phpmyadmin.net/phpMyAdmin/4.4.10/phpMyAdmin-4.4.10-english.tar.gz

14. Extract the tar File & Rename it :


# tar -zxvf phpMyAdmin-4.4.10-english.tar.gz
# mv phpMyAdmin-4.4.10-english phpmyadmin

15. Edit the /etc/httpd/conf/httpd.conf File :


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

Add those Lines : (line number 158)
<Directory /var/www/html/phpmyadmin>
    Options  -Indexes +Multiviews +FollowSymLinks
        DirectoryIndex index.php index.html
    AllowOverride All
    Allow from all
</Directory>

----Save & Quit (:wq)----

16. Rename the config.sample.inc.php File :

#cd /var/www/html/phpmyadmin

# mv config.sample.inc.php config.inc.php

17. Now needs a secret passphrase (blowfish_secret):


# vi /var/www/html/phpmyadmin/config.inc.php


$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Just Add Password - $cfg['blowfish_secret'] = 'Your Password but wrong pass'


$cfg['blowfish_secret'] = 'wron pass'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

$cfg['Servers'][$i]['host'] = 'MySQL_Server_Name'; ← Database Server Hostname.

----Save & Quit (:wq)----

18. Start the httpd & mysql Service & stop iptables :

# systemctl enable httpd
# systemctl enable mysqld
# systemctl stop firewalld.service

and stop selinux

19. Point your browser to: http://ip.address/phpmyadmin :


ex- http://192.168.72.249/phpmyadmin
User Name: root
Password: Mysql_Password

---- DONE,Thanks ----

How to Install Web VMStat on centOS 6


Web VMStat Install on centos 6

Web-Vmstat it’s a small application written in Java and HTML which displays live Linux system statistics, such as Memory, CPU, I/O, Processes, etc. taken over vmstat monitoring command line in a pretty Web page with charts (SmoothieCharts) and diagrams through WebSocket streams using websocketd program.

Step 1: Install Web-Vmstat

# yum install wget nano unzip -y

Step 2. Now go to Veb-Vmstat official web page at and download the latest version

# wget https://github.com/joewalnes/web-vmstats/archive/master.zip

Step 3. Extract the downloaded master.zip

# unzip master.zip
# cd web-vmstats-master

Step 4. Web directory holds the HTML and Java files needed for the application to run in a Web environment. Create a directory under your system where you want to host the Web files and move all web content to that directory.

# mkdir /opt/web_vmstats
# cp -r web/* /opt/web_vmstats/

Step 5. Download and install websocketd streaming program.

# wget https://github.com/joewalnes/websocketd/releases/download/v0.2.9/websocketd-0.2.9-linux_386.zip (for 32 bit)
# wget https://github.com/joewalnes/websocketd/releases/download/v0.2.9/websocketd-0.2.9-linux_amd64.zip (for 64 bit)

Step 6. Extract the WebSocket.

# unzip websocketd-0.2.9-linux_amd64.zip
# cp websocketd /usr/local/bin/

Step 7. Now you can test it by running websocketd.

# websocketd --port=8080 --staticdir=/opt/web_vmstats/ /usr/bin/vmstat -n 1

Step 8. This step is optional and only works with init script supported systems.

# vi /etc/init.d/web-vmstats

Add the following content.

#!/bin/sh
# source function library
. /etc/rc.d/init.d/functions
start() {
                echo "Starting webvmstats process..."

/usr/local/bin/websocketd --port=8080 --staticdir=/opt/web_vmstats/ /usr/bin/vmstat -n 1 &
}

stop() {
                echo "Stopping webvmstats process..."
                killall websocketd
}

case "$1" in
    start)
       start
        ;;
    stop)
       stop
        ;;
    *)
        echo "Usage: stop start"
        ;;
esac

------ save and quit (:wq) ------

# chmod +x /etc/init.d/web-vmstats
# /etc/init.d/web-vmstats start

Step 9. Open a browser and use the following URL to display Vmstats system statistics.

http://ip:8080

Step 10. To display name, version and other details about your current machine and the operating system running on it. Go to Web-Vmstat files path and run the following commands.

# cd /opt/web_vmstats
# cat /etc/issue.net | head -1 > version.txt
# cat /proc/version >> version.txt

Step 11. Then open index.html file and add the following javascript code before <main id=”charts”> line.

# vi index.html

Use the following JavaScript code.

<div align='center'><h3><pre id="contents"></pre></h3></div>
<script>
function populatePre(url) {
    var xhr = new XMLHttpRequest();
    xhr.onload = function () {
        document.getElementById('contents').textContent = this.responseText;
    };
    xhr.open('GET', url);
    xhr.send();
}
populatePre('version.txt');
                </script>

------ save and quit (:wq) -------

Step 12. To view the final result refresh http://system_IP:8080

---- DONE,Thanks ----

Wednesday 2 December 2015

How to Install OsCommerce on Centos/RHEL


INSTALL OsCommerce on Centos

Step 1: At First Configure LAMP, Disable selinux

Step 2: INSTALL osCommerce:
# cd /opt
# wget http://www.oscommerce.com/files/oscommerce-2.3.4.zip
# unzip oscommerce-2.3.4.zip
# mv oscommerce-2.3.4 /var/www/html/
# mv /var/www/html/oscommerce-2.3.4/ /var/www/html/oscommerce/
# chmod 777 /var/www/html/oscommerce/catalog/includes/configure.php
# chmod 777 /var/www/html/oscommerce/catalog/admin/includes/configure.php

Step 3: CREATE MYSQL DATABASE:

# mysql -u root -predhat

mysql> CREATE DATABASE oscommerce;
mysql> GRANT ALL PRIVILEGES on oscommerce.* to oscuser@localhost identified by 'your_password';
mysql> FLUSH PRIVILEGES;
mysql> \q

Step 4: Now open your favorite web browser and navigate to http://your_IP_address/oscommerce/catalog/install/index.php and follow the on-screen instructions.

Step 5: Post Installation Things:

# rm -rf /var/www/html/oscommerce/catalog/install
## Rename the Administration Tool directory located at /var/www/html/oscommerce/catalog/admin
## Set the permissions on /var/www/html/oscommerce/catalog/includes/configure.php to 644 (or 444 if this file is still writable).
## Set the permissions on /var/www/html/oscommerce/catalog/admin/includes/configure.php to 644 (or 444 if this file is still writable).
## Review the directory permissions on the Administration Tool -> Tools -> Security Directory Permissions page.
## The Administration Tool should be further protected using htaccess/htpasswd and can be set-up within the Configuration -> Administrators page.

---- DONE,Thanks ----

Tuesday 1 December 2015

How to Install & Configure Redmine on RHEL/Centos 6x


Install & Configure Redmine on RHEL/Centos 6x

What is Redmine ?

Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

Features :

1. Multiple projects support
2. Flexible role based access control
3. Flexible issue tracking system etc.

Step: 1. Stop Iptables :

# service iptables stop
# chkconfig iptables off

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Restart the Server :

# init 6

Step: 4. Install Prerequisites :

# yum install -y ruby-devel gcc-c++ openssl-devel httpd httpd-devel make ruby-rdoc libcurl-devel rubygem-rake zlib-devel curl-devel apr-devel apr-util-devel wget

Step: 5. Install Ruby :

# cd /tmp
# wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
# tar -zxvf ruby-2.1.2.tar.gz
# cd ruby-2.1.2
# ./configure
# make install
# cd ..
# rm -rf ruby-2.1.2.tar.gz ruby-2.1.2

Step: 6. To Check Ruby Version :

# ruby -v

Step: 7. Install Rubygems :

# cd /tmp
# wget http://production.cf.rubygems.org/rubygems/rubygems-2.2.2.tgz
# tar zxvf rubygems-2.2.2.tgz
# cd rubygems-2.2.2
# ruby setup.rb
# cd ..
# rm -rf rubygems-2.2.2.tgz rubygems-2.2.2

Step: 8. To Check Gems Version :

# gem -v

Step: 9. Install Passenger :

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

Press Enter and press " ! " and make sure you select only the ruby one.

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

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

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

Go, to the load module section and paste it.
Add the below line. In the module section. Line num 202.

LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so

Add the following line on line number 377.

<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>

-- Save & Quit (:wq)

Step: 11. Now, you can download the latest version of Redmine :

# cd /var/www/html
# wget http://www.redmine.org/releases/redmine-2.5.2.tar.gz
# tar -zxvf redmine-2.5.2.tar.gz
# mv redmine-2.5.2 redmine
# rm -rf redmine-2.5.2.tar.gz
# chown -R apache.apache /var/www/html/redmine
# chmod -R 755 /var/www/html/redmine
# touch /var/www/html/redmine/log/production.log
# chown root.apache /var/www/html/redmine/log/production.log
# chmod 664 /var/www/html/redmine/log/production.log


Step: 12. Start the Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 13. Install Mysql Server :

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

Step: 14. Start Mysql Service :

# service mysqld restart
# chkconfig mysqld on

Step: 15. Set Mysql Root Password :

# mysql_secure_installation

Step: 16. Create Database for Redmine :

# mysql -u root -predhat

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

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

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

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

Note: If you see any of the gem is not installing then go to.

# cd /var/www/html/redmine
# vi Gemfile

Commented the following line, Line no. 29

# gem "rmagick", ">= 2.0.0"

-- Save & Quit (:wq)

Step: 18. Setup the Database Connection for Redmine :

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

In the production section, update username, password and other parameters accordingly like so :

production:

adapter: mysql2
database: redmine
host: localhost
username: redmine
password: redhat
encoding: utf8

-- Save & Quit (:wq)

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

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

<VirtualHost *:80>
ServerName redmine

DocumentRoot /var/www/html
Alias /redmine /var/www//html/redmine/public

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

-- Save & Quit (:wq)

Step: 20. Restart Apache Server :

# service httpd restart

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

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

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

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


Step: 22. In terminal, use following command.

# RAILS_ENV=production bundle exec rake generate_session_store
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Type en when asked.

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

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

Step: 24. Fix rights for the apache user :

# cd /var/www/html
# chown -R apache:apache redmine
# chmod -Rf 777 redmine

Step: 25. Also,for configuration of email :

# cd /var/www/html/redmine/config
# cp configuration.yml.example configuration.yml
# vi configuration.yml

Just close.
You can configured the email as per your need.

Step: 26. Restart the Apache Server :

# service httpd restart

Step: 27. Point Your Web Browser & Type :

http://192.168.20.140/redmine
User: admin
Pass: admin

---- DONE,Thanks ----

How to Install Cpanel & WHM On CentOS/RHEL 6.X


Installing CPanel & WHM optimized for CentOS/RHEL 6.X

Link: http://www.tecmint.com/install-cpanel-whm-in-rhel-centos

Need to install and configure yum, epel.repo and remi.repo

# vi cat /etc/selinux/config
SELINUX=disabled

# service iptables stop
Set the hostname with FQDN

#vi /etc/sysconfig/network
kmi.server.com

# yum update

Install depandences

# yum install -y bind-devel gd-devel gd-progs gdbm-devel glibc-static lcms python-tools quota-devel sharutils tclx
Download latest cPanel

# cd /home
# wget -N http://httpupdate.cpanel.net/latest

Installing cPanel

# sh ./latest

Sit back and relax (don't let your laptop sleep or hybernate your terminal window!), my installation
CentOS 6 Install time: cPanel install finished 4 hour!

When installation is complted you will get this message

After ensuring that your firewall allows access on port 2087, you can configure your server.
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): 1. Open your preferred browser
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): 2. Type https://192.168.72.155:2087 in the address bar
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): 3. Enter the word root in the Username text box
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): 4. Enter your root password in the Password text box
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): 5. Click the Login button
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): Visit http://go.cpanel.net/whminit for more information about first-time configuration of your server.
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): Visit http://support.cpanel.net or http://go.cpanel.net/whmfaq for additional support
2014-01-03 19:29:23 714 ( INFO):
2014-01-03 19:29:23 714 ( INFO): Thank you for installing cPanel & WHM 11.40!

point this URL on address BAR https://192.168.72.155:2087 in the address bar

To manage WHM consol follow the URL

---- DONE,Thanks ----

How to Install Haproxy With Http and Https on Centos 6.X


Install Haproxy With Http and Https both

What is haproxy?
Configure Servers that HTTP connection to HAProxy Server is forwarded to backend Web Servers.

Here is the setup like this===
1. server3.kminfo.com [192.168.100.158] - Haproxy Load Balancer Server
2. server2.kminfo.com [192.168.100.127] - Web Server#2
3. server1.kminfo.com [192.168.100.156] - Web Server#1

Step 1: Install HAProxy.

# yum -y install haproxy

N.B: And one more thing before configure HAProxy prepare two webserver for backend.

Step 2: Configure HAProxy(For HTTP)

# mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.org
# vi /etc/haproxy/haproxy.cfg

# create new
 global
      # for logging section
    log         127.0.0.1 local2 info
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
      # max per-process number of connections
    maxconn     256
      # process' user and group
    user        haproxy
    group       haproxy
      # makes the process fork into background
    daemon

defaults
      # running mode
    mode               http
      # use global settings
    log                global
      # get HTTP request log
    option             httplog
      # timeout if backends do not reply
    timeout connect    10s
      # timeout on client side
    timeout client     30s
      # timeout on server side
    timeout server     30s

# define frontend ( set any name for "http-in" section )
frontend http-in
      # listen 80
    bind *:80
      # set default backend
    default_backend    backend_servers
      # send X-Forwarded-For header
    option             forwardfor

# define backend
backend backend_servers
      # balance with roundrobin
    balance            roundrobin
      # define backend servers
    server             server1.kminfo.com 192.168.100.156:80 check # (hostname of webserver#1)
    server             server2.kminfo.com 192.168.100.127:80 check # (hostname of webserver#2)

Save n exit (:wq)

# /etc/rc.d/init.d/haproxy start
# chkconfig haproxy on

 Step 3: Configure Rsyslog to get logs for HAProxy.

# vi /etc/rsyslog.conf

# line 13,14: uncomment, lne 15: add
$ModLoad imudp
$UDPServerRun 514
$AllowedSender UDP, 127.0.0.1(add on line nu 15)

# line 42: change like follows
*.info;mail.none;authpriv.none;cron.none,local2.none   /var/log/messages
local2.*                                                                      /var/log/haproxy.log

Save n exit(:wq)

# service rsyslog restart

Step 4: Configure Haproxy(For HTTPS).

# cd /etc/pki/tls/certs
# openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/certs/haproxy.pem -out /etc/pki/tls/certs/haproxy.pem -days 365

Generating a 2048 bit RSA private key
......++++++
.......++++++
writing new private key to '/etc/pki/tls/certs/proftpd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP# country
State or Province Name (full name) [Some-State]:Hiroshima   # state
Locality Name (eg, city) []:Hiroshima# city
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Server World   # company
Organizational Unit Name (eg, section) []:IT Solution   # department
Common Name (eg, YOUR name) []:dlp.server.world   # server's FQDN
Email Address []:xxx@server.world # admin email address

# chmod 600 haproxy.pem

# vi /etc/haproxy/haproxy.cfg

## add in the "global" section

# max per-process number of SSL connections
maxsslconn     256
# set 2048 bits for Diffie-Hellman key
tune.ssl.default-dh-param 2048

## add follows in the "frontend" section

# specify port and certs
bind *:443 ssl crt /etc/pki/tls/certs/haproxy.pem

Save n exit(:wq)

# /etc/rc.d/init.d/haproxy restart

# service iptables stop

##Stop selinux

# setenforce 0

Step 5: then try to open your haproxy server like this:==

http://IPaddress
https://IPaddress

try to open open both and just refresh on every refresh the backen servers will be altered.
---- DONE,Thanks ----

How to Install Java 7 (JDK 7u65) on CentOS/RHEL 6/5


Install Java 7 (JDK 7u65) on CentOS/RHEL 6/5

Step 1: Download Archive File

Download latest version of java from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.

For 64 Bit –
# cd /opt/
# wget http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz?AuthParam=1410461115_7bfe6685f15c82dcaaedb31561201f2b

Note: In any case if above command failed to download and you need to download java through Linux terminal, watch below screen cast ( http://screencast.com/t/wf9bQ0XjDPxT ), You are required a graphical browser.

After completing download, Extract archive using following command. Use archive file as per your system configuration. For this example we are using 32 bit machine.

# tar -zxvf jdk-7u67-linux-x64.gz

Step 2: Install JAVA using Alternatives

After extracting java archive file, we just need to set up to use newer version of java using alternatives. Use the following commands to do it.

# cd /opt/jdk1.7.0_65/
# alternatives --install /usr/bin/java java /opt/jdk1.7.0_65/bin/java 2
# alternatives --config java

There are 4 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
 + 2           /opt/jdk1.7.0_55/bin/java
   3           /opt/jdk1.7.0_60/bin/java
   4           /opt/jdk1.7.0_65/bin/java

Enter to keep the current selection[+], or type selection number: 4 [Press Enter]

Now you may also required to setup javac and jar commands path using alternatives

# alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_65/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_65/bin/javac 2
# alternatives --set jar /opt/jdk1.7.0_65/bin/jar
# alternatives --set javac /opt/jdk1.7.0_65/bin/javac
Step 3: Check JAVA Version

Use following command to check which version of java is currently being used by system.

# java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode)


Step 4: Setup Environment Variables

Most of java based application’s uses environment variables to work. Use following commands to set up it.

Setup JAVA_HOME Variable
# export JAVA_HOME=/opt/jdk1.7.0_65
Setup JRE_HOME Variable
# export JRE_HOME=/opt/jdk1.7.0_65/jre
Setup PATH Variable
# export PATH=$PATH:/opt/jdk1.7.0_65/bin:/opt/jdk1.7.0_65/jre/bin

---- DONE,Thanks ----

How To Install Apache Web Server on Centos/RHEL


How To Install Apache Web Server on Centos/RHEL

1. Install Apache:

# yum -y install httpd httpd-devel


2. Edit httpd.conf file:

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


#ServerName www.example.com:80

Just Add this Line-
ServerName ip address of server:80

Check this Line-991
NameVirtualHost *:80

Last-add this line-
DocumentRoot "/var/www/html"

add this last line-

RewriteEngine on
CheckCaseOnly On


----Save & Quit (:wq)-----


make logs directory...

#mkdir /logs


3. Go to /var/www/html :


# vi index.html

Make A HTML
add those line...


<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>


----Save & Quit (:wq)----

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

then paste those line

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin deb.mind009@gmail.com
  ServerName 192.168.100.251


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


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

</VirtualHost>

----Save & Quit (:wq)----

# vi /etc/httpd/conf.d/debojyoti.com.conf (FOR VIRTUAL HOSTS)

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin deb.mind009@gmail.com
  ServerName www.debojyoti.com
  ServerAlias debojyoti.comi


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


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

</VirtualHost>

----Save & Quit (:wq)----

4. Start httpd Service:

# /etc/init.d/httpd start

------ DONE,Thanks-------

How to Install And Deploy a Meteor App on Centos 6.X


INSTALL AND DEPLOY A METEOR APP ON CENTOS
** Production Environment:
1. Centos
2. Apache

** Software Stack on production:
1. Mongo DB
2. Node.js 0.1.100
3. NodeJS “Forever” module to start application in the background

Step 1: Just make sure that all the development libraries are available.

# yum update -y
# yum groupinstall "Development Tools" -y

Step 2: Install Node.js and NPM

# wget http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz
# tar xvfz node-v0.10.4.tar.gz
# cd node-v0.10.4
# ./configure
# make
# make install
# rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Step 3: Install MongoDB
Create a /etc/yum.repos.d/mongodb.repo file to hold the following configuration information for the MongoDB repository:

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

add these lines

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

--- save and quit (:wq) ---

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

Step 4: Package your app from your local machine where the app situated for testing purpose.

# meteor build <path_to_save_the_file>

Step 5: Push app to server throuh ftp or scp

# cd yourapp_prod/bundle/programs/server
# export PORT=8080
# export MONGO_URL=mongodb://localhost:27017/yourapp_db
# export ROOT_URL=http://yourapp_domain/
# npm install
# cd ../../../
# node bundle/main.js

Step 6: Install node “forever” module to run your app in the background

# npm -g install forever
# forever start <Yourapp_Name>/bundle/main.js

Step 7: configure a reverse proxy in your apache configuration

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

<VirtualHost *:80>
  ServerName yourapp_domain
  ProxyRequests off
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  <Location />
    ProxyPass http://localhost:8080/
    ProxyPassReverse http://localhost:8080/
  </Location>
</VirtualHost>

--- save and quit (:wq) ---

Step 8: Install Meteor

# curl install.meteor.com | /bin/sh

Step 9: Deploy A Existing Meteor App and Screen
N.B: .meteor directory must be there without .meteor directory the app will not able to deploy

# yum -y install screen
# screen
# cd Your_app_Path
# meteor &
Press ctrl A + ctrl D together to detach the screen
---------- DONE,Thanks -------------

How to Install Tomcat7 on Centos/RHEL 6.X


Install Tomcat7 on Centos/RHEL
Make sure apache configuration is done.

Step 1. Install JAVA

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

# yum install jdk-8u5-linux-x64.rpm

# java -version

# export JAVA_HOME=/usr/java/jdk1.8.0_05

# export PATH=$PATH:$JAVA_HOME

# echo $JAVA_HOME

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

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

save and exit


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

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

# java -version

Step 2: Download and Extract Tomcat Archive

# cd /tmp

# wget http://psg.mtu.edu/pub/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz

# tar -zxvf apache-tomcat-7.0.57.tar.gz

# mv apache-tomcat-7.0.57 /usr/local/tomcat7

Step 3. Add the init scripts for it.

# vi /etc/init.d/tomcat

#!/bin/bash
# description: Tomcat Start Stop Restart-SOM
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.8.0_05
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/local/tomcat7

case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0

save and exit


# chmod 755 /etc/init.d/tomcat

Step 4 . Start the tomcat as a service.

# service tomcat start

# chkconfig tomcat on


Step 5. Access Tomcat in Browser

http://ipaddress:8080 OR http://hostname:8080

Step 6. Setup User Accounts. Paste inside <tomcat-users> </tomcat-users> tags.

# vi /usr/local/tomcat7/conf/tomcat-users.xml

<role rolename="manager-gui" />
<user username="manager" password="redhat" roles="manager-gui" />

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="nasant" roles="manager-gui,admin-gui" />

save and exit.


# service tomcat restart

# service httpd restart

----- DONE,Thanks -----

How to Install Wetty (WEB+TTY) on Centos


Install Wetty (WEB+TTY) on Centos

As a system administrator, you probably connect to remote servers using a program such as GNOME Terminal (or the like) if you’re on a Linux desktop, or a SSH client such as Putty if you have a Windows machine, while you perform other tasks like browsing the web or checking your email.

Step 1: Install epel repo

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

Step 2: Install dependencies

# yum install epel-release git nodejs npm -y

Step 3: After installing these dependencies, clone the GitHub repository

# git clone https://github.com/krishnasrinivas/wetty

Step 4: Run Wetty

# cd wetty
# npm install

Step 5: Starting Wetty and Access Linux Terminal from Web Browser

# node app.js -p 8080

Step 6: Wetty through HTTPS

# openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes (complete this)

Step 7: launch Wetty via HTTPS

# nohup node app.js --sslkey key.pem --sslcert cert.pem -p 8080 &

Step 8: Add an user for wetty

# useradd <username>
# Passwd <username>

Step 9: Access wetty

http://Your_IP-Address:8080
give the credential have created before for wetty and access

--------- DONE, Thanks ---------

How to Install OrangeHRM on Centos


How to install OrangeHRM on Centos

Step 1. Requirments: Apache, Mysql and Php

Step 2: Download the OrangeHRM Package and Create the Apache Environment to Run it:

# cd /tmp
# wget http://nchc.dl.sourceforge.net/project/orangehrm/stable/3.3.2/orangehrm-3.3.2.zip
# unzip orangehrm-3.3.2.zip
# mv orangehrm-3.3.2 orangehrm
# mv orangehrm /var/www/html
# chown -R apache:apache orangehrm
# chmod -R 755 /var/www/html/orangehrm/lib/confs/
# vi /etc/httpd/conf/httpd.conf

Line number 304 and 338

Change AllowOverride to All from None

AllowOverride All

add these lines after line number 312

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

---- save and quit (:wq) ----

# service httpd restart

Step 3: Create Mysql Database and User for OrangeHRM:

Note: It can be Created by the Web Panel of OrangeHRM Installation, But Here Creating it Before and Will Give the Details to the Panel at the Installation Time

# mysql -u root -predhat -e "create database orangehrm"
# mysql -u root -predhat -e "grant all privileges on orangehrm.* to 'orangehrm'@'localhost' identified by 'redhat'"
# mysql -u root -predhat -e "grant all privileges on orangehrm.* to 'orangehrm'@'%' identified by 'redhat'"
# mysql -u root -predhat -e "flush privileges"

Step 4: Its time to install OrangeHRM

Browse on Browser: http://<Your-IP>/orangehrm/installer/installerUI.php

Press Next --> Accept The License --> At the place of Database Do the Following:

Database to Use: Existing Empty Databse
Database Host Name: localhost
Database Host Port: 3306
Database Name: orangehrm
OrangeHRM Database Username: orangehrm
OrangeHRM Database User Password: redhat

Press Next -->  Press Next --> Set admin Password and then Press Next --> Press Install --> Press Next --> Finish.

Step 5: The Installation is Complete now Open OrangeHRM and Login to the Admin Panel:

http://<Your-IP>/orangehrm

User: admin
Pass: <You_set_at_Installation_Time>

____________________ DONE ,Thanks _____________________