Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Saturday, 27 May 2017

How To Configure PredictionIO on CentOS/RHEL 6x

How To Configure PredictionIO on CentOS/RHEL 6x


What is PredictionIO ?

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


Step: 1. Set Host Name :

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

HOSTNAME=predictionio.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

192.168.72.140    predictionio.domain.com        predictionio

-- Save & Quit (:wq)

Step: 3. Stop Firewall & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 4. Install NTP Server For Time Synchronization :

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

Step: 5. Reboot the System :

# init 6

Step: 6. Download Oracle JAVA :

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

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

Step: 7. Install JAVA using Alternatives :

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


There are 3 programs which provide 'java'.

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

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

Step: 8. Check Version of JAVA :

# java -version

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

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

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

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

Setup JRE_HOME Variable:

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

Setup PATH Variable:

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

# cd
# vi .bash_profile

-- Add the following lines :

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

-- Save & Quit (:wq)

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

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

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

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

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

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

Step: 15. Afterwards, Start all PredictionIO Services :

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

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

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

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

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

http://192.168.72.140:9000

Step: 18. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 19. Restart Apache Server :

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

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

<VirtualHost *:80>

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


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


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

</VirtualHost>

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

-- Save & Quit (:wq)

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

-- Find the Line & Uncomment :

NameVirtualHost *:80

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

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

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

Saturday, 13 May 2017

How To Configure CodeIgniter PHP Framework on CentOS/RHEL 6x

How To Configure CodeIgniter PHP Framework on CentOS/RHEL 6x


What is CodeIgniter ?

-- CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications.

Step: 1. Set Host Name :

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

HOSTNAME=mysite.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

10.100.97.38    mysite.domain.com        mysite

-- Save & Quit (:wq)

Step: 3. Stop Firewall & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 4. Install NTP Server For Time Synchronization :

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

Step: 5. Reboot the System :

# init 6

Step: 6. Install EPEL & Remi Repository :

# yum -y install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step: 7. Install Apache Server :


# yum -y install --enablerepo=remi,epel httpd httpd-devel mod_ssl

Step: 8. Remove MySQL 5.1 & Install MySQL 5.6 :

# yum -y remove mysql mysql-*

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

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

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 10. Install PHP 5.6 :

# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# yum -y install php56w php56w-common php56w-cli php56w-devel php56w-gd \
    php56w-mysql php56w-mcrypt php56w-mbstring php56w-imap php56w-snmp \
    php56w-xml php56w-xmlrpc php56w-ldap php56w-pdo php56w-json php56w-dom \
    wget unzip curl git openssl
 
Step: 11. Create Database for CodeIgniter :

# mysql -u root -p
Enter Password: redhat

MySQL> create database codedb;
MySQL> grant all privileges on codedb.* to code@'localhost' identified by 'password';
MySQL> grant all privileges on codedb.* to code@'%' identified by 'password';
MySQL> flush privileges;
MySQL> exit

Step: 12. Install Composer :

Note: Composer is required for installing CodeIgniter Dependencies.

# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/local/bin/composer
# chmod +x /usr/local/bin/composer

Step: 13. Download & Install CodeIgniter Code from Git :

# cd /var/www/html
# git clone https://github.com/bcit-ci/CodeIgniter.git mysite
# cd mysite
# composer install
# chown -Rf apache:apache /var/www/html/mysite
# chmod -Rf 775 /var/www/html/mysite

Step: 14. Set Base URL & Database Connection :

# vi /var/www/html/mysite/application/config/config.php

$config['base_url'] = 'http://mysite.domain.com';

-- Save & Quit (:wq)

# vi /var/www/html/mysite/application/config/database.php

$db['default'] = array(
        'dsn'   => '',
        'hostname' => 'localhost',
        'username' => 'code',
        'password' => 'password',
        'database' => 'codedb',
        'dbdriver' => 'mysqli',
       
-- Save & Quit (:wq)

Step: 15. Create Apache Virtual Host :


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

-- Add these Lines at Line no 313 :

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

-- Uncomment Line 996 :

NameVirtualHost *:80

-- Add this Line at the End of the File :

RewriteEngine on

-- Save & Quit (:wq)

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

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin techsupport@domain.com
  ServerName 10.100.97.38


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


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

</VirtualHost>

-- Save & Quit (:wq)

# vi /etc/httpd/conf.d/mysite.domain.com.conf

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin techsupport@domain.com
  ServerName mysite.domain.com
  ServerAlias www.mysite.domain.com


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


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

</VirtualHost>

-- Save & Quit (:wq)

# mkdir /logs

Step: 16. Start Apache Server :


# service httpd restart
# chkconfig httpd on

http://mysite.domain.com

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

 
Copyright © 2016 Kousik Chatterjee's Blog