Showing posts with label Others. Show all posts
Showing posts with label Others. Show all posts

Tuesday, 27 September 2016

How to Install and Configure VTiger CRM on CentOS 6.X


Install and Configure VTiger CRM on CentOS 6.X

What is CRM?

Customer relationship management (CRM) is a term that refers to practices, strategies and technologies that companies use to manage and analyze customer interactions and data throughout the customer lifecycle, with the goal of improving business relationships with customers, assisting in customer retention and driving sales growth. CRM systems are designed to compile information on customers across different channels -- or points of contact between the customer and the company -- which could include the company's website, telephone, live chat, direct mail, marketing materials and social media. CRM systems can also give customer-facing staff detailed information on customers' personal information, purchase history, buying preferences and concerns.

What is VTiger CRM?

Vtiger CRM is an Open Source CRM software, used mainly by small and medium-sized businesses. Vtiger CRM can be used to manage your company's wide CRM and Inventory Management activities, such as sales force automation, customer support & service, marketing automation, procurement & fulfillment effectively.

Step 1: Stop the Selinux, and Update the Date Time on the Server :


# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service iptables stop
# chkconfig iptabes off
# yum -y install ntpd
# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on

Step 2: Install and Configure LAMP and Others Dependencies for the VTiger CRM :

# yum -y install httpd httpd-devel
# yum -y install mysql-server
# service httpd start
# service mysqld start
# chkconfig httpd on
# chkconfig mysqld on
# mysql_secure_installation (Set MySQL Root Password)
# yum install -y php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-snmp php-soap php-tidy libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel zlib openssl openssl-devel krb5-devel php php-gd php-imap gd gd-devel gcc wget

Step 3: Download and Configure Php for VTiger CRM :

# cd /tmp
# wget http://jaist.dl.sourceforge.net/project/vtigercrm/vtiger%20CRM%206.5.0/Core%20Product/vtigercrm6.5.0.tar.gz
# tar -zxvf vtigercrm6.5.0.tar.gz -C /var/www/html
# chown -Rf apache:apache /var/www/html/vtigercrm/
# chmod -Rf 755 /var/www/html/vtigercrm/
# vi /etc/php.ini

## Change the following lines as per below mentioned--

allow_call_time_pass_reference on ## Line Number 335
error_reporting E_WARNING & ~E_NOTICE ## Line Number 513
safe_mode off ## Line Number 339
display_errors on ## Line Number 530
file_uploads on ## Line Number 869
max_execution_time 600 ## Line Number 440
memory_limit 64M ## Line Number 457
log_errors off ## Line Number 551
output_buffering on ## Line Number 264
register_globals off ## Line Number 693
short_open_tag on ## Line Number 229

---- save & quit (:wq) ----

# service httpd restart

# mysql -u root -p
Enter Password:

mysql> create database vtigerdb;
mysql> grant all privileges on vtigerdb.* to vtiger@'localhost' odentified by 'redhat';
mysql> grant all privileges on vtigerdb.* to vtiger@'%' odentified by 'redhat';
mysql> flush privileges;
mysql> \q

Step 4: Open the Browser and Install the rest of the part of the VTiger CROM through browser :

Open: http://<Server-IP>/vtigercrm/index.php

click on "Install" button in the welcome screen --> click "I Agree" to proceed ahead --> Check your PHP Configurations and make sure that Required Values are in compliance with Present Values. Click "Next" to proceed with the installation --> Please provide Mysql credentials of your server under Database Information block. Also, configure default currency and personal information through System Information and Admin User Information blocks respectively. After providing appropriate values, click "Next" --> Confirm your configuration settings and click "Next" --> You're done! Within just a few seconds, your Vtiger CRM account will be provisioned and ready for use.

After Installation Complete the Modules will come to the screen, Select all the modules for install to the CRM.

Step 5: Configure Apaache Virtual Host for VTiger CRM :


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

## Add after line number 312

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

---- save & quit (:wq) ----

# vi /etc/httpd/conf.d/vtiger.example.com.conf

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerName www.vtiger.example.com
  ServerAlias vtiger.example.comi


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


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

</VirtualHost>

---- save & quit (:wq) ----

# mkdir /logs
# service httpd restart

Open in Browser: http://<Server-IP>/vtigercrm or http://vtiger.example.com
User: admin
Pass: <Admin-Pass-Set-At-Time-Of-Installation>


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

Wednesday, 24 August 2016

How to Install FreeRadius for SSH Authentication on Centos 6


Install FreeRadius for SSH Authentication (Two-Factor Authentication)


What is FreeRadius?

Radius is a great standard. It is powerful enough to accomplish a great deal and simple enough to be easy to handle. Freeradius is an excellent, open source radius server that ships with many Linux variants. It is well documented and well supported. The WiKID Strong Authentication server is a commercial/open source two-factor authentication system that uses public key encryption to transmit PINs and one-time passcodes securely to software tokens running on Blackberries, cell phones, Palms, PocketPCs or, using the J2SE client, Linux, Macs and Windows PCs. You can think of WiKID like certificates, but without the hassles of white lists/black lists and more secure - because the PIN is validated on the server preventing offline brute-force attacks.



Requirement: 1. 2 CentOS 6 Server (1 for FreeRadius & 1 for SSH Authentication)



Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Servers :


# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

** Configure FreeRadius Server:

Step 2: Install and Configure Radius Server and its Dependencies :


# yum install freeradius freeradius-mysql freeradius-utils mysql-server -y
# service mysqld start

* Set MySQL Root Password by the Following Command:

# mysql_secure_installation

mysql -uroot -p
Enter password:

mysql> CREATE DATABASE radius;
mysql> GRANT ALL PRIVILEGES ON radius.* TO radius@localhost IDENTIFIED BY "radpass";
mysql> flush privileges;
mysql> use radius;
mysql> SOURCE /etc/raddb/sql/mysql/schema.sql;
mysql> \q

* Edit and Check the DB Connection once-

# vi /etc/raddb/sql.conf

### (In Between Line Number 36-42)

# Connection info:
       server = "localhost"
       #port = 3306 login = "radius"
       password = "mypassword"

       # Database table configuration for everything except Oracle
       radius_db = "radius"
 
---- save & quit (:wq) ----

# vi /etc/raddb/radiusd.conf

## Uncomment the Following Line (Line Number 735)

$INCLUDE sql.conf

---- save & quit (:wq) ----

# vi /etc/raddb/sites-available/default

### uncomment the line containing ‘sql’ in theauthorize{} section and ‘sql’ in the accounting {} section, also uncomment ‘sql’ under session{}

### Line Number 177 & Line Number 406


---- save & quit (:wq) ----

# vi /etc/raddb/sites-available/inner-tunnel

### uncomment the line containing ‘sql’ under “authorize {}” and under session {}

## Line Number 132

---- save & quit (:wq) ----

* For change the secret key of the radius server-

# vi /etc/raddb/clients.conf

### Change: secret = testing123 to secret = <your-secret-password>

---- save & quit (:wq) ----

# service radiusd restart

Step 3: Adding Clinets and Users to the Radius Server :


# vi /etc/raddb/clients.conf

client SERVER_IP {
              secret          = YOUR SECRET
              shortname       = yourVPN
 nastype        = other
   }
 
---- save & quit (:wq) ----

# service radiusd restart

# mysql -uroot –p
Enter password:

mysql> use radius;
mysql> INSERT INTO `radcheck` (`username`, `attribute`, `value`) VALUE ('testuser', 'password', 'User_Password');
mysql> \q

* Test the Radius Authentication--

# radtest testuser password localhost 1812 <Radius-Server-Secret-Key>

rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=185, length=20

Step 4: Configure the SSH Server to Connect the Radius Server and Authentication from Radius Server :


# yum -y install pam pam-devel gcc
# cd /tmp
# wget ftp://ftp.freeradius.org/pub/radius/pam_radius-1.4.0.tar.gz
# tar zxf pam_radius-1.4.0.tar.gz
# cd pam_radius-1.4.0
# ./configure
# make
# cp pam_radius_auth.so /lib/security/

** Modify the Pam File of sshd and passwd for the Radius Authentication--

# vi /etc/pam.d/sshd

## Add this Line at 2nd Line--

auth sufficient /lib/security/pam_radius_auth.so

---- save & quit (:wq) ----

# vi /etc/pam.d/passwd

## Add the line at 3rd Line--

password sufficient /lib/security/pam_radius_auth.so

---- save & quit (:wq) ----

# vi /etc/ssh/sshd_config

## Change or Uncomment Line Number 48

PubkeyAuthentication no

---- save & quit (:wq) ----

# mkdir /etc/raddb/
# cp /tmp/pam_radius-1.4.0/pam_radius_auth.conf /etc/raddb/server
# vi /etc/raddb/server

## # Radius Server IP address           Secret                                   Timeout
<Radius-Server-IP> <Secret-Key-of-Radius-Server> 10

---- save & quit (:wq) ----

# service sshd restart
# useradd testuser

Note: Which Users will be authenticate from the Radius Server, those users should be there in the Radius Server Database and the User must exist on the SSH Server as well but no password has to be set on the SSH Server for the user, the password will be set at the database of the Radius Server.


** For Example as per the Doc:
user: testuser
pass: User_Password

# ssh testuser@<SSH-Server-IP>
Password: User_Password

** You should able to login now!

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

Tuesday, 9 August 2016

How to Install NewRelic Agent on RHEL/Centos/Ubuntu/Debian/Windows

Install NewRelic on RHEL/Centos/Ubuntu/Debian/Windows


What is NewRelic?

New Relic is an American software analytics company based in San Francisco, California. Lew Cirne founded New Relic in 2008 and currently acts as the company's CEO. New Relic's technology, delivered in a software as a service (SaaS) model, monitors Web and mobile applications in real-time that run in cloud, on-premises, or hybrid environments. The name "New Relic" is an anagram of founder Lew Cirne's name.


Create a New Account for New Relic Free of cost: https://newrelic.com/
Sign up here & find out you License Key.
After Creating a new Account Login to your Account & Click on Right top Corner Drop down List , Then click on Account Settings.
Then you will find out th License key from the Right Panel.


1. For RHEL/CentOS 6 :


Step 1: Install & Add the New Relic yum repository :


# rpm -Uvh https://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm

Step 2: Install the Server Monitor package :


# yum install newrelic-sysmond -y

Step 3: Add license key to config file: (See /etc/newrelic/nrsysmond.cfg for other config options) :


# nrsysmond-config --set license_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Step 4: Start the NewRelic Monitor Process :


# /etc/init.d/newrelic-sysmond start

2. For Ubuntu/Debian :


Step 1: Add the New Relic apt repository :


# echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
# wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -
# apt-get update -y

Step 2: Install the Server Monitor package :


# apt-get install newrelic-sysmond -y

Step 3: Add license key to config file: (See /etc/newrelic/nrsysmond.cfg for other config options) :


# nrsysmond-config --set license_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Step 4: Start the NewRelic Monitor Process :


# /etc/init.d/newrelic-sysmond start

3. For Windows:


Step 1: Download the NewRelicServerMonitor msi/zip file :


Download Link:-- 

https://download.newrelic.com/windows_server_monitor/release/NewRelicServerMonitor_x64_3.3.5.0.msi /

Step 2: Run the Installer and the Put the License Key :

License Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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

How to Install Bamboo With JIRA & BitBuckeet Integration in Ubuntu




Install Bamboo With JIRA & BitBuckeet Integration in Ubuntu


What is Bamboo?

Bamboo is a continuous integration server from Atlassian, the makers of JIRA, Confluence and Crowd. Bamboo is free for open-source projects.


What is JIRA?

JIRA is a tool developed by Australian Company Atlassian. It is used for bug tracking, issue tracking, and project management. The name "JIRA" is actually inherited from the Japanese word "Gojira" which means "Godzilla". The basic use of this tool is to track issues, and bugs related to your software and mobile apps.


What is BitBucket?

Bitbucket is a web-based hosting service for projects that use either the Mercurial (since launch) or Git (since October 2011) revision control systems. Bitbucket offers both commercial plans and free accounts.


N.B: Get a Bamboo Server/JIRA Server/BitBucket Server License from https://id.atlassian.com/login?application=mac&continue=https://my.atlassian.com
Create a Account here and Get the License Key. And 2 GB Ram Recommanded for the Server.


Step 1: Install Dependencies For Bamboo:


# apt-get install software-properties-common
# add-apt-repository ppa:openjdk-r/ppa
# apt-get update
# apt-get install openjdk-8-jdk

Step 2: Download & Install Bamboo Server:


# wget https://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-5.10.1.1.tar.gz
# tar -xvf atlassian-bamboo-5.10.1.1.tar.gz
# mv atlassian-bamboo-5.10.1.1 /opt/bamboo
# cd /opt/bamboo

**N.B: Edit the bamboo-init.properties from the bamboo installation directory and set the bamboo home environment:-

# vi /opt/bamboo/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties

### Add the line at last

bamboo.home=/home/bamboo/bamboo-home

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

# mkdir -p /home/bamboo/bamboo-home

Step 3: To bamboo as service & auto-start with system boot follow in steps in given below:


# vi /etc/init.d/bamboo

JAVA_OPTS=" -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx2048m -XX:NewSize=1536m -XX:MaxNewSize=2048m -XX:SurvivorRatio=6  -XX:MaxPermSize=2048m -XX:+DisableExplicitGC"
export JAVA_OPTS
JAVA_HOME=/usr/share/java/
CATALINA_HOME=/opt/bamboo
export CATALINA_HOME
BAMBOO_HOME=/opt/bamboo/bin
START_BAMBOO=/opt/bamboo/bin/startup.sh
STOP_BAMBOO=/opt/bamboo/bin/shutdown.sh
start() {
echo -n "Starting bamboo: "
cd $BAMBOO_HOME
${START_BAMBOO}
echo "done."
}
stop() {
echo -n "Stopping bamboo"
cd $BAMBOO_HOME
${STOP_BAMBOO}
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0

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

# chmod 755 /etc/init.d/bamboo
# update-rc.d bamboo defaults

** Change Bamboo Service Port Number from 8085 to 80:-

# vi /opt/bamboo/conf/server.xml

Line Number 50: Change the port from 8085 to 80

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

# service bamboo restart

Step 4: Check the Bamboo Installation on Browser:


http://IP-Address

Enter the License Key --> Choose Express Installation --> Fill up required field

Step 5: Download & Install JIRA:


# wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin
# chmod 755 atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin
# ./atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin

Step 6: Check the JIRA Installation on Browser:


http://IP-Address:8080

Then Follow the Instruction and Install it. Get a JIRA Server License from https://id.atlassian.com/login?application=mac&continue=https://my.atlassian.com
Create a Account here and Get the License Key.


Step 7: Download and Install Dependebicies & BitBucket:


# wget https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-4.3.2-x64.bin
# apt-get -y install git
# chmod 755 atlassian-bitbucket-4.3.2-x64.bin
# ./atlassian-bitbucket-4.3.2-x64.bin

Destination Directory: /opt/atlassian/bitbucket
Default location of plugin and other data: /var/atlassian/application-data/bitbucket

N.B: For external database need connector. Download the JDBC Connector.

# wget http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz
# tar -xvf mysql-connector-java-5.1.38.tar.gz
# cd mysql-connector-java-5.1.38
# cp mysql-connector-java-5.1.38-bin.jar /opt/atlassian/bitbucket/lib
# chown atlbitbucket:atlbitbucket mysql-connector-java-5.1.38-bin.jar
# service atlbitbucket stop
# service atlbitbucket start

Step 8: Check the BitBucket Installation on Browser With Integrated JIRA & Bamboo:


http://IP-Address:7990

Fill up the required field and select Integrate with Jira.
After that provide Jira url connection with port and username with password and select connect.
Select Linked Repository --> Select Add Repository --> Finish.

** To Link Repository From Bitbucket to Bamboo:

Go to Bamboo Administration Right Side Top Panel --> Overview --> Select Application Links from Left Side Panel --> Give the Bamboo Server URL --> Create New Link --> Done.

N.B: Now both Bamboo with JIRA & BitBucket Integration is Done. Find out all the Things altogether from any one server at the Left Top Drop Down List.

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

How to Install SSHFS on Centos/RHEL/Ubuntu


Install SSHFS on Centos/RHEL/Ubuntu

** 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 user 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

** Requirement:

1. 2 Centos/Ubuntu Server
2. SSH Key Authentication on the Servers


Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Servers and SSH Authentication on the Servers:

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

On Server 1:
# ssh-keygen -t rsa (Enter 3 Times)
# ssh-keygen -t dsa (Enter 3 Times)
# cd /root/.ssh
# cat id_rsa.pub >>authorized_keys
# cat id_dsa.pub >>authorized_keys

On Server 2:
# ssh-keygen -t rsa (Enter 3 Times)
# ssh-keygen -t dsa (Enter 3 Times)
# cd /root/.ssh
# cat id_rsa.pub >>authorized_keys
# cat id_dsa.pub >>authorized_keys

** Now Open the authorized_keys file on both Server and Paste the Server 1's Key to Server 2's authorized_keys File and vice-versa.

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Install FUSE-SSHFS :


For CentOS/RHEL users, Fuse SSHFS is available under epel repository, So make sure you have install epel repository in your system. Now execute following command to install it.

On CentOS/RHEL:

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

On Ubuntu & Dabian:

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

Step 3: Mount Remote Directory :


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 x.x.x.x (remote.example.com) system to our local system.

# sshfs remoteuser@remote.example.com:/home/remoteuser /mntssh

[Sample output]

The authenticity of host 'remote.example.com (x.x.x.x)' can't be established.
RSA key fingerprint is 77:85:9e:ff:de:2a:ef:49:68:09:9b:dc:f0:f3:09:07.
Are you sure you want to continue connecting (yes/no)? yes
remoteuser@remote.example.com's password: yes

Step 4: Verify Mount :


After mounting remote filesystem on local mount point, verify it by running mount command.

# mount

/dev/mapper/vg_svr1-lv_root 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)
/dev/sda1 on /boot type ext4 (rw)
remoteuser@remote.example.com:/home/remoteuser on /mntssh type fuse.sshfs (rw,nosuid,nodev)

Also naviate to your mount point, you will see files there from remote system

# cd /mntssh
# ls

Step 5: Mount Directory on System Boot :


If you want to mount remote filesystem automatically each time when your system reboots, Add following entry to /etc/fstab file. Make sure you have have key based ssh setup between remote and local system.

# vi /etc/fstab

remoteuser@remote.example.com:/home/remoteuser /mntssh fuse.sshfs defaults 0 0

--- save & quit (:wq) ---

Step 6: Unmount Directory :


If your work is over and 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.

Saturday, 6 August 2016

How to Import SSL to the Existing Openfire Server in Linux Server

How to import SSL in the Existing Openfire Installation




What is Openfire?


Openfire is a real time collaboration (RTC) server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber).



Step 1: Put the Keys and Certificates:

Put the Cert and the Key and the CA Cert in the /etc/ssl/ Directory

# ll /etc/ssl/

-rw-r--r--  1 root root  4795 Aug  1 11:39 ca-bundle.crt
-rw-r--r--  1 root root  1838 Aug  1 11:39 ca-cert.crt
-rw-r--r--  1 root root  1704 Aug  1 11:39 ca-cert.key

Step 2: Create a Init Script for Run Openfire Run as a Service:

# vi /etc/init.d/openfire

#!/bin/bash
# description: Openfire Service Status
# processname: openfire
# chkconfig: 234 20 80
OPENFIRE_HOME=/opt/openfire

case $1 in
start)
sh $OPENFIRE_HOME/bin/openfire start
;;
stop)
sh $OPENFIRE_HOME/bin/openfire stop
;;
restart)
sh $OPENFIRE_HOME/bin/openfire restart
;;
status)
sh $OPENFIRE_HOME/bin/openfire status
;;
esac
exit 0

---- save & quit (:wq) ----

# chmod 755 /etc/init.d/openfire

Step 3: Create a Shell Script for Importing the Certs  keys to the JAVA Platform:

# vi /mnt/key-import.sh

### Add these lines

JavaDir="/opt/openfire/resources/security" ### Openfire Installation Directory for Store the Imported Keys
PASS="changeit" ### SSl Exportable & Openfire Admin Certificate Stores Passord
cert="ca-cert" ### Cert Name only
certdir="/etc/ssl" ### Cert Directory
tmp="/root" ### Temporary Folder
ca="/etc/ssl/ca-bundle.crt" ### CA Cert Name

test -e "${JavaDir}/truststore" && rm -f "${JavaDir}/truststore"  ### Checking if there is anything stored already in trustore
test -e "${JavaDir}/keystore" && rm -f "${JavaDir}/keystore"  ### Checking if there is anything stored already in keystore

service openfire stop
cat "${certdir}/${cert}.crt" "${ca}" > ${tmp}/"combined.crt"
keytool -import -trustcacerts -storepass $PASS -alias "StartSSL Class 2" -file "${ca}" -keystore "${JavaDir}/truststore"
openssl pkcs12 -export -in "${tmp}/combined.crt" -inkey "${certdir}/${cert}.key" -out "${tmp}/${cert}.p12" -name "${cert}" -CAfile "${ca}" -passout pass:"${PASS}"
keytool -importkeystore -deststorepass "$PASS" -srcstorepass "$PASS" -destkeystore "${JavaDir}/keystore" -srckeystore "${tmp}/${cert}.p12" -srcstoretype PKCS12 -alias "${cert}"
chmod 640 "${JavaDir}/truststore" "${JavaDir}/keystore"
chown openfire:openfire "${JavaDir}/truststore" "${JavaDir}/keystore"
service openfire start

---- save & quit (:wq) ----

# useradd -s /sbin/nologin openfire
# chown -Rf openfire:openfire /opt/openfire
# chmod -Rf 775 /opt/openfire
# vi /etc/sudoers

### Add at last of the File

openfire  ALL=(ALL)       NOPASSWD:ALL

---- save & quit (:wq) ----

N.B: After creating the openfire User can run the Key Import Script, then the Keys will be imported to the Openfire

# sh /mnt/key-import.sh
# ll /opt/openfire/resources/security

-rw-r----- 1 openfire openfire 6117 Aug  1 12:35 keystore
-rw-r----- 1 openfire openfire 1309 Aug  1 12:35 truststore

Step 4: Now login into the Openfire Admin Panel and Do the Rest:

http://<server-ip>:9090
User: admin
Pass: password

Click on TLS/SSL Certificates --> Give the Password that has been Used in the Script to Every Password Section Here one by one --> Save Settings (one by one) --> Done.

Step 5: Login to the Server via SSH and Shutdown Openffire Properly and then Start again:

# service openfire stop
# ps -ef |grep java

## Kill all the Processes that are running for Java

# kill -9 <PID>

Then statr the Openfire Again

# service openfire start

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

Tuesday, 19 April 2016

How to Install SVN With WebSVN (Web Panel) in Centos/RHEL 6.X

Install SVN With WebSVN on CentOS/RHEL 6.X

What is SVN?

Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed as free software under the Apache License. Software developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.

What is WebSVN?

WebSVN offers a view onto your subversion repositories that’s been designed to reflect the Subversion methodology. You can view the log of any file or directory and see a list of all the files changed, added or deleted in any given revision. You can also view the differences between two versions of a file so as to see exactly what was changed in a particular revision.

Requirements:

1. Apache
2. Subversion
3. php
4. WebSVN

Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Server :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Install & Configure SVN/Subversion with Apache :

A. Install Required Packages:

# yum install -y mod_dav_svn subversion svn httpd httpd-devel php

B. Create subversion.conf file:

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

### add these lines ###

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 "Authorization Realm"
AuthUserFile /var/www/svn/secure/svn-users
AuthzSVNAccessFile /var/www/svn/secure/svn-access-control
Require valid-user

</location>

--- save & quit (:wq) ---

C. Create SVN Directory Tree:

# mkdir -p /var/www/svn/{Repos,secure}
# touch /var/www/svn/secure/svn-access-control
# touch /var/www/svn/secure/svn-users
# service httpd restart

Step 3: Configure some Test Repo & create User for SVN :

A. Create Repo and User:

# cd /var/www/svn/Repos
# svnadmin create testrepo
# chmod -Rf 777 testrepo
# htpasswd -cm /var/www/svn/secure/svn-users testuser (after that give password for "testuser" twice)

B. Modify svn-access-control for Repos Permisions:

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

### add these lines
[groups]

admin = testuser
testrepo = testuser

[/]
@admin = rw

[testrepo:/]
@testrepo = rw

--- save & quit (:wq) ---

# service svnserve restart

### Check the Svn repo with the url: http://<ip-of-server>/repos/testrepo
username: testuser
password: (Password)

C. update the Repo to Revision 1

# mkdir -p /mnt/svn-structure-template/{trunk,branches,tags}
# svn import -m 'Initial import' /mnt/svn-structure-template/ http://localhost/repos/testrepo

Step 4: Install and Configure WebSVN :

# cd /var/www/html
# wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip
# unzip websvn-2.3.3.zip
# mv websvn-2.3.3 websvn
# cd /var/www/html/websvn/include
# cp distconfig.php config.php
# vi config.php

### add these lines

// Configure these lines if your commands aren't on your path.
//
$config->setSVNCommandPath('/usr/bin'); // e.g. c:\\program files\\subversion\\bin
$config->setDiffPath('/usr/bin');
// For syntax colouring, if option enabled...
$config->setEnscriptPath('/usr/bin');
$config->setSedPath('/bin');
// For delivered tarballs, if option enabled...
$config->setTarPath('/bin');
// For delivered GZIP'd files and tarballs, if option enabled...
$config->setGZipPath('/bin');
//
$config->parentPath('/svn/');
$extEnscript[".pl"] = "perl";
$extEnscript[".py"] = "python";
$extEnscript[".sql"] = "sql";
$extEnscript[".java"] = "java";
$extEnscript[".html"] = "html";
$extEnscript[".xml"] = "html";
$extEnscript[".thtml"] = "html";
$extEnscript[".tpl"] = "html";
$extEnscript[".sh"] = "bash";

## $config->addRepository('Repo_Path', 'Repo_Url', NULL, 'Repo_User', 'Repo_Pass'); If more Repo added just copy the below Line and Modify it for the New Repo to Access on WebSVN

$config->addRepository('/var/www/svn/testrepo', 'http://192.168.72.243/repos/testrepo', NULL, 'testuser', 'redhat');

--- save & quit (:wq) ---

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

### After line number 312 add these lines

<Directory "/var/www/html/websvn">
DirectoryIndex index.html index.php index.cgi index.pl
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

--- save & quit (:wq) ---

# service httpd restart

### Check the WebSVN Now on url: http://<ip-of-server>/websvn

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

Friday, 22 January 2016

How to Install zen-cart on centos 6


Install ZenCart on Centos/RHEL 6.X

Step 1: Configure LAMP

A. Install LAMP 


Step 2: Download the latest version of Zen Cart and Install

# wget http://nchc.dl.sourceforge.net/project/zencart/CURRENT%20-%20Zen%20Cart%201.5.x

%20Series/zen-cart-v1.5.4-12302014.zip
# unzip zen-cart-*.zip -d /var/www/html/
# mv /var/www/html/zen-cart-* /var/www/html/zen-cart/

Step 3: Create Database

# mysql -u root -predhat

mysql> CREATE DATABASE zencart;
mysql> CREATE USER 'zencartuser'@'localhost' IDENTIFIED BY 'your-password-here';
mysql> GRANT ALL PRIVILEGES ON zencart.* TO 'zencartuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> \q

Step 4: Also, create a new virtual host in Apache, for example

# vi /etc/httpd/conf.d/zen-cart.conf

<VirtualHost *:80>
ServerAdmin admin@your-domain.com
DocumentRoot /var/www/html/zen-cart/
ServerName your-domain.com
ServerAlias www.your-domain.com
ErrorLog logs/your-domain.com-error_log
CustomLog logs/your-domain.com-access_log common
</VirtualHost>

-- save and quit (:wq) --

Step 5: Set the permissions for these files and directories to 777 using the following commands

# cd /var/www/html/zen-cart/
# mv admin/includes/dist-configure.php admin/includes/configure.php
# mv includes/dist-configure.php includes/configure.php
# chmod 777 admin/includes/configure.php
# chmod 777 includes/configure.php
# chmod 777 cache
# chmod 777 includes/languages/english/html_includes
# chmod 777 logs
# chmod 777 media
# chmod 777 pub
# chmod 777 images/
# chmod 777 admin/backups
# chmod 777 admin/images/graphs

Step 6: Open the following and follow the instructions

http://Your-IP-Address/zen-cart/zc_install/index.php


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

How to Install PHP 7 on Centos



Install PHP 7 on Centos


Step 1: you must add the Webtatic EL yum repository information corresponding to your CentOS/RHEL version to yum


CentOS/RHEL 7.x:


# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:


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

Step 2: Now you can install PHP 7.0 (along with an opcode cache) by doing

# yum install -y --enablerepo=webtatic-testing php70w php70w-opcache php70w-bcmath php70w-cli
php70w-common php70w-dba php70w-devel php70w-embedded php70w-enchant php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-mysqlnd php70w-odbc php70w-pdo php70w-pdo_dblib php70w-pgsql php70w-process php70w-pspell php70w-recode php70w-snmp php70w-soap php70w-tidy php70w-xml php70w-xmlrpc

Step 3: Changes on the Module File for Php

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

-- Line number 6 and 10 replace with these Lines

LoadModule php7_module modules/libphp7.s (replace with line nuber 6)
LoadModule php7_module modules/libphp7-zts.so (replace with line number 10)
AddHandler php7-script .php (replace with line number 16)

-- save and quit (:wq) --

Step 4: Create a php info file and check

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

<?php
phpinfo();
?>

-- save and quit (:wq) --

# service httpd restart

Step 5: check in browser http://IP-Address/info.php or check through CLI

# php -v

PHP 7.0.0RC2 (cli) (built: Sep  4 2015 21:04:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

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

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

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 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 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 -------------