Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday 15 October 2017

Mount S3 Bucket using IAM Role on Ubuntu 16.04

Mount S3 Bucket using IAM Role on Ubuntu 16.04


Q. What Is Amazon S3?

-- Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.

Step: 1. Create a new Policy to Access the target S3 Bucket : 

1















-- Enter Policy Name, Description and the Policy Document as given below :

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListAllMyBuckets"
      ],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": ["s3:ListBucket"],
      "Resource": ["arn:aws:s3:::bucket-name"]
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": ["arn:aws:s3:::bucket-name/*"]
    }
  ]
}

2



















Step: 2. Create a New Role using "Amazon EC2" Service Role Type :

-- Click on “Create new Role” and Select Role Type as Amazon EC2.

3
















-- Next select “s3access” policies to Attach.

4










-- Enter Role Name, Description as given below and click on “Create Role” button.

5



















-- The Attach Policy of the new Role should look like below:

6



















Step: 3. Attach IAM Role to the running Instance or Launching new Instance :

7
















-- Select Role name from drop-down box and click on “Apply” button.

8









9








Step: 4. Mount S3 Bucket to an Instance :

-- Login to instance using console and follow the steps below :

# apt-get update -y
# apt-get install build-essential libfuse-dev libcurl4-openssl-dev libxml2-dev \
    mime-support automake libtool git
# cd /tmp
# git clone https://github.com/s3fs-fuse/s3fs-fuse.git
# cd s3fs-fuse/
# ./autogen.sh
# ./configure
# make
# make install
# mkdir /s3backups
# chmod 755 /s3backups

-- Now Mount the S3 Bucket using IAM Role :

# s3fs -o iam_role="EC2RoleForS3Access" bucket-name /s3backups
# df -Th

[OUTPUT]
Filesystem     Type         Size       Used  Avail   Use%  Mounted on
s3fs                 fuse.s3fs  256T     0         256T   0%      /s3backups

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



Sunday 27 August 2017

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

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


Q. What is SVN (Subversion)?

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

Step: 1. Install Apache Server :

# yum -y install httpd httpd-devel mod_ssl

Step: 2. Configure Apache Server :

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

-- Uncomment :

NameVirtualHost *:80

-- Add the following Lines at the End :

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

-- Save & Quit (:wq)

Step: 3. Install SVN Packages :

# yum -y install mod_dav_svn subversion

Step: 4. Modify Subversion config file :

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

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

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

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

-- Save & Quit (:wq)

Step: 5. Restart the httpd Service :

# service httpd restart
# chkconfig httpd on

Step: 6. Add SVN (Subversion) Users :

-- At First Create User Directory :

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

-- For 1st User :

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

-- For 2nd User :

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

Step: 7. Create SVN Access Control List :

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

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

[/]
@admin = rw

[testrepo:/]
@testrepo = rw

[prodrepo:/]
@prodrepo = rw

-- Save & Quit (:wq)

Step: 8. Create and configure SVN Repository :

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

# svnadmin create testrepo
# chmod -Rf 777 testrepo

# svnadmin create prodrepo
# chmod -Rf 777 prodrepo

Step: 9. Restart Apache Server :

# service httpd restart

Step: 10. Point Your Web Browser :

http://192.168.72.140/repos/testrepo/

User: koushik
Pass: redhat

Step: 11. Configure Repository (Optional) :

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

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

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

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

-- Save & Quit (:wq)

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

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

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

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

Password for 'root': (Just Press Enter)

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

Username: user1
Password for 'user1': redhat

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

Store password unencrypted (yes/no)? yes

Committed revision 1.

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

http://192.168.72.140/repos/testrepo

User: user2, user3
Pass: redhat

http://192.168.72.140/repos/prodrepo

User: user1 (only user1)
Pass: redhat

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


Sunday 30 July 2017

How To Configure Password Protected Directory in IIS 7

How To Configure Password Protected Directory in IIS 7


Step: 1. Install IIS on Windows Server 2008/2012 :

-- Go To "Server Management"
-- Click on "Roles"
-- Add Roles
-- Click on "Next".
-- Select Web Server (IIS)
-- Add Required Features.
-- Click on "Next"
-- Click on "Next"
-- Select Windows Authentication, ASP.Net, CGI
-- Click on "Next"
-- Finally, Click on "Install".
-- Close.

Note: If you have already Install IIS then open Server Management and follow these steps.

-- Expand "Roles"
-- Click on "Web Server (IIS)"
-- Scroll Down the Page & Click on Add Role Services
-- Then Select "Windows Authentication"
-- Click on "Next"
-- Finally, Click on "Install"
-- Close.

Step: 2. Configure IIS Server :

Go To C:\inetpub\wwwroot and Create a "index.html" File & also Create a Directory called "Secret" under Secret Directory create a html file called "sectet.html"

index.html code

<html>
<body bgcolor="black">
<h1><center><font size="8" color="white">This is My Home Page...</center></font></h1>
<BR>
<a href="secret/secret.html"><font size="4" color="yellow">secret.html</a></font></BR>
</body>
</html>


-- Save the File.

secret.html code

<html>
<h1><font size="6" color="black">This is My secret Doc...</font></h1>
</html>


-- Save the File.

After created .html files follow these steps.

-- Open IIS Manager.
-- Expand Server Name.
-- Expand Sites
-- Right Click on "Sites"
-- Add Web Site
-- Give Site Name (secret)
-- Select Path (C:\inetpub\wwwroot) Give Hostname (localhost)
-- Click on "OK".

-- Click on Newly created site.
-- Double Click on Default Document.
-- Move Up "index.html".

-- Click on Newly Create site
-- Double Click on Directory Browsing
-- Click on "Enable".

Step: 3. Create A System User :

-- Click on "Start"
-- Administrative Tools
-- Computer Management
-- Expand Local Users & Groups
-- Click on "Users"
-- Right Click on Blank Space.
-- New User.
-- Give Username & Password
-- Click on "Create".
-- Click on "Close".

Step: 4. Security Setup for IIS :

-- Go To C:\inetpub\wwwroot
-- Right Click on Secret Directory
-- Click on Properties.
-- Security (Tab)
-- Click on Advanced
-- Change Permissions.
-- Select Users.
-- Uncheck Include Inheritable Permissions from this object's parent.
-- Click on "Add/Copy"
-- Again Select Users
-- Remove
-- Click on "OK"
-- Again Click on "OK"
-- Click on "Edit" button.
-- Click on "Add"
-- Click on "Advanced"
-- Find Now
-- Select User 'secret'
-- Click on "OK"
-- Click on "OK"
-- Check on "Full Control"
-- Click on "OK"
-- Finally, Click on "OK".

-- After that Go To IIS Manager
-- Expand Server Name.
-- Expand Sites.
-- Right Click on Newly Created Site
-- Double Click on Authentication
-- Right Click on Windows Authentication
-- Click on "Enable"
-- Right Click on Anonymous Authentication
-- Click on "Disabled".

-- Right click on Newly created Site.
-- Edit Permission
-- Security (tab)
-- Click on "Edit"
-- Click on "Add" button.
-- Type 'everyone'
-- Click on "Check Names"
-- Click on "OK"
-- OK
-- Finally, Click on "OK".

Step: 5. Testing through web Browser :


http://Server_ip_address - Page Opening

Click on secrect.html -> It Show Restricted Access.

Give Username & Password.

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

 

Sunday 18 June 2017

How To Install and Configure HAProxy on RHEL/CentOS 6x


How To Install and Configure HAProxy on RHEL/Centos 6x


-- HAProxy (High Availability Proxy) is an open-source load-balancer which can load balance any TCP service. HAProxy is a free, very fast and reliable solution that offers load-balancing, high-availability, and proxying for TCP and HTTP-based applications.

Step: 1. Set Hostname (On All Servers) :

# vi /etc/sysconfig/network

server1.kousik.com

-- Save & Quit (:wq)

# hostname server1.kousik.com

Step: 2. Bind Hosts File (On All Servers) :

# vi /etc/hosts

## IP's of HaProxy ##
192.168.72.181    server1.kousik.com    server1

## IP's of Web Servers ##
192.168.72.182    www1.kousik.com        www1
192.168.72.183    www2.kousik.com        www2

-- Save & Quit (:wq)

 Step: 3. Stop Firewall & Disable Selinux (On All Servers) :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 4. Install NTP Server For Time Synchronization (On All Servers) :

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

Step: 5. Reboot the System (On All Servers) :

# init 6

Step: 6. Copy hosts file to Other Server :

# scp /etc/hosts www1:/etc/
# scp /etc/hosts www2:/etc/

Step: 7. Web Server Configurations :

-- On Both Web Servers :

# yum -y install httpd
# service httpd start
# chkconfig httpd on

-- On Web1 :

# echo "<h1>www1.kousik.com</h1>" > /var/www/html/index.html

-- On Web2 :

# echo "<h1>www2.kousik.com</h1>" > /var/www/html/index.html

-- On LB (HAP) :

# yum -y install epel-release
# yum -y install haproxy
# yum -y remove httpd

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

#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------

global

    log 127.0.0.1    local0
    log 127.0.0.1    local1 notice
    #log loghost    local0 info
    maxconn 4096
    #debug
    #quiet
    user haproxy
    group haproxy

#---------------------------------------------------------------------
# Defaults that are optimized for a Cloud Servers based
# Infrastructure.
#---------------------------------------------------------------------

defaults

    log global
    mode http
    option httplog
    option dontlognull
    retries 3
    option    redispatch
    maxconn        20000
    contimeout   5000
    clitimeout      50000
    srvtimeout     50000

#---------------------------------------------------------------------
# HTTP Default Webfarm
#---------------------------------------------------------------------

listen webfarm 0.0.0.0:80

    mode http
    stats enable
    stats uri /haproxy?stats
    stats realm Haproxy\ Statistics
    stats auth admin:redhat            # Username is 'admin' & Password is 'redhat'
    balance roundrobin
    cookie JSESSIONID prefix
    option httpclose
    option forwardfor
    option httpchk HEAD /check.txt HTTP/1.0
    server Web01 192.168.72.182:80 cookie A weight 50 check            # Webserver1 IP Address.
    server Web02 192.168.72.183:80 cookie B weight 50 check            # Webserver2 IP Address.

-- Save & Quit (:wq)

# chkconfig haproxy on
# service haproxy start

Step: 8. Open Browser & Type for Statistics :

http://192.168.72.181/haproxy?stats
User: admin
Pass: redhat

Step: 9. Open Web Browser & Check Load Balancing :

http://192.168.72.181


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

 

Saturday 27 May 2017

How To Configure PredictionIO on CentOS/RHEL 6x

How To Configure PredictionIO on CentOS/RHEL 6x


What is PredictionIO ?

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


Step: 1. Set Host Name :

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

HOSTNAME=predictionio.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

192.168.72.140    predictionio.domain.com        predictionio

-- Save & Quit (:wq)

Step: 3. Stop Firewall & Disable Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 4. Install NTP Server For Time Synchronization :

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

Step: 5. Reboot the System :

# init 6

Step: 6. Download Oracle JAVA :

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

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

Step: 7. Install JAVA using Alternatives :

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


There are 3 programs which provide 'java'.

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

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

Step: 8. Check Version of JAVA :

# java -version

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

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

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

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

Setup JRE_HOME Variable:

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

Setup PATH Variable:

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

# cd
# vi .bash_profile

-- Add the following lines :

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

-- Save & Quit (:wq)

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

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

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

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

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

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

Step: 15. Afterwards, Start all PredictionIO Services :

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

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

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

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

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

http://192.168.72.140:9000

Step: 18. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 19. Restart Apache Server :

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

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

<VirtualHost *:80>

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


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


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

</VirtualHost>

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

-- Save & Quit (:wq)

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

-- Find the Line & Uncomment :

NameVirtualHost *:80

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

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

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

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

 

Saturday 22 April 2017

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

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


What is Laravel PHP Framework ?

-- Laravel is a free, open-source PHP Web Framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern.

Installation Step :

Step: 1. Set Host Name :

# hostname laravel.oit.com
# vi /etc/sysconfig/network

HOSTNAME=laravel.oit.com

-- Save & Quit (:wq)

Step: 2. Bind Host File :

# vi /etc/hosts

10.100.97.38    laravel.domain.com        laravel

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

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. Install Composer :

Note: Composer is required for installing Laravel Dependencies.

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

Step: 12. Install Laravel Framework :

Note: To download latest version of Laravel, Use below command to clone master repo of laravel
               from github.

# cd /var/www/html
# git clone https://github.com/laravel/laravel.git
# cd /var/www/html/laravel
# composer install
# chown -Rf apache.apache /var/www/html/laravel
# chmod -Rf 755 /var/www/html/laravel

Step: 13. Set Encryption Key :

-- Now set the 32 bit long random number encryption key, which used by the Illuminate
      encryption service.

# cd /var/www/html/laravel
# mv .env.example .env
# chown -Rf apache.apache /var/www/html/laravel
# php artisan key:generate

[OUTPUT]
Application key [base64:lNOx1cxl0JWAWX56/Ql6o7/mcw7AVairy1Uqs2XplFo=] set successfully.

-- Update the above Generated Application key into the config/app.php configuration file.
     Also make sure that cipher is set properly.

# vi /var/www/html/laravel/config/app.php

'key' => env('APP_KEY', 'base64:IZ+g3FU+OF1nO4j/4y4EHDdUq4gyJZcJ+weClk3B5Qo='),
'cipher' => 'AES-256-CBC',

-- Save & Quit (:wq)

Step: 14. Create Apache Virtual Host :

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

-- Add these Lines at Line no 313 :

<Directory /var/www/html/laravel/public>
     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/laravel.domain.com.conf

<VirtualHost *:80>

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


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


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

</VirtualHost>

-- Save & Quit (:wq)

# mkdir /logs

Step: 15. Start Apache Server :

# service httpd restart
# chkconfig httpd on

http://laravel.domain.com


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

 

Sunday 9 April 2017

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

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



What is OpenX Ad Server?

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

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.97.40    ad.domain.com     ad

-- Save & Quit (:wq)

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

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Rebbot the System :

# init 6

Step: 4. Install Apache Server :


# yum -y install httpd httpd-devel wget

Step: 5. Edit httpd.conf file :

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

#ServerName www.example.com:80

-- Add this Line:

ServerName ip_address_of_server:80

-- Save & Quit (:wq)

Step: 6. Download & Extract Ad Server Package :
 
# cd /var/www/html
# wget http://download.revive-adserver.com/revive-adserver-3.0.2.zip
# unzip revive-adserver-3.0.2.zip
# mv revive-adserver-3.0.2 adserver
# chmod -Rf 775 adserver

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

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

Add those Lines :

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

-- Save & Quit (:wq)

Step: 8. Install MySQL Database Server :

# yum -y install mysql mysql-server

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

# service mysqld start
# chkconfig mysqld on

# mysql_secure_installation

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

Step: 10. Create Database for Openx :

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

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

Step: 11. Install EPEL Repository :

# yum -y install epel-release

Step: 12. Install PHP5 Scripting Language :

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

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

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

<?php
  phpinfo();
?>

-- Save & Quit (:wq)

Step: 14. Restart Apache to load php :

# service httpd restart
# chkconfig httpd on

Step: 15. Then point your Web Browser & Check php :

Ex- http://server_ip_address/info.php

Step: 16. Configure Openx AD Server :

Go to http://server_ip/adserver

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

Step: 17. OpenX Memcached Configuration from Web Interface :

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

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

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

-- Click on "Save Changes"



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

 

Sunday 2 April 2017

How To Configure SuPHP on CentOS/RHEL 6x

How To Configure SuPHP on CentOS/RHEL 6x


Q. What is SuPHP ?

-- SuPHP is an apache module that allows PHP to under a different Linux user than the apache user. This improves the security of hosted websites as you can run the PHP scripts of each website under a different user.

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.97.40    ser4.domain.com     ser4

-- Save & Quit (:wq)

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

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Rebbot the System :

# init 6

Step: 4. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 5. Install PHP :

# yum -y install epel-release
# yum -y install php php-cli php-devel php-common php-mbstring php-gd php-xml \
    php-mcrypt php-mysql php-imap php-pdo php-snmp php-soap php-xmlrpc \
    php-opcache php-ldap php-pear php-zip php-curl php-cgi php-fpm wget curl
 
Step: 6. Start Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 7. Install SuPHP & Dependencies :

# yum -y groupinstall 'Development Tools'
# cd /usr/local/src
# wget http://suphp.org/download/suphp-0.7.2.tar.gz
# tar zxvf suphp-0.7.2.tar.gz
# wget -O suphp.patch https://lists.marsching.com/pipermail/suphp/attachments/20130520/74f3ac02/attachment.patch
# patch -Np1 -d suphp-0.7.2 < suphp.patch
# cd suphp-0.7.2
# autoreconf -if
# ./configure --prefix=/usr/ --sysconfdir=/etc/ --with-apr=/usr/bin/apr-1-config \
--with-apache-user=apache --with-setid-mode=owner --with-logfile=/var/log/httpd/suphp_log
# make
# make install

Step: 8. Enabling SuPHP Module in Apache :

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

-- Add This Line in "LoadModule" Section :

LoadModule suphp_module modules/mod_suphp.so

-- Save & Quit (:wq)

Step: 9. Create SuPHP Config File :


# vi /etc/suphp.conf

[global]
;Path to logfile
logfile=/var/log/httpd/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100

[handlers]
;Handler for php-scripts
x-httpd-suphp="php:/usr/bin/php-cgi"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"

-- Save & Quit (:wq)

Step: 10. Start Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 11. Configure an Apache Vhost with SuPHP :


# useradd -s /sbin/nologin web1
# mkdir /var/www/html/example.com
# vi /var/www/html/example.com/info.php

<?php
phpinfo();
?>

-- Save & Quit (:wq)

# chown -Rf web1:web1 /var/www/html/example.com
# vi /etc/httpd/conf.d/example.com.conf

<VirtualHost *:80>
 DocumentRoot /var/www/html/example.com
 ServerName example.com
 ServerAlias www.example.com
 ServerAdmin webmaster@example.com

 <FilesMatch ".+\.ph(p[345]?|t|tml)$">
 SetHandler None
 </FilesMatch>

 <IfModule mod_suphp.c>
 suPHP_Engine on
 <FilesMatch "\.php[345]?$">
 SetHandler x-httpd-suphp
 </FilesMatch>
 suPHP_AddHandler x-httpd-suphp
 </IfModule>
</VirtualHost>

-- Save & Quit (:wq)

# service httpd restart

Step: 12. Test the SuPHP Setup :

http://example.com/info.php

Note: Important is the ServerAPI line which shows CGI/FastCGI. which shows that PHP is run through SuPHP & not mod_php.

# vi /var/www/html/example.com/testuser.php

<?php
echo get_current_user();
?>

-- Save & Quit (:wq)

# chown -Rf web1:web1 /var/www/html/example.com/testuser.php

http://example.com/testuser.php


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


Sunday 26 March 2017

Install & Configure Lighttpd with SSL on CentOS/RHEL 6x

Install & Configure Lighttpd with SSL on CentOS/RHEL 6x


Q. What is Lighttpd ?

-- Lighttpd is a Web Server for UNIX/Linux and Windows operating systems. It is an alternative to Apache Web Server. It is also called Lighty. It is designed to be Secure, fast, standards-compliant, and flexible while being optimized for speed-critical environments.

Step: 1. Bind Host File :

# vi /etc/hosts

10.100.97.40    ser4.domain.com     ser4

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Iptables :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Rebbot the System :

# init 6

Step: 4. Install Lighttpd Server :

# yum -y install epel-release
# yum -y install lighttpd openssl

Step: 5. Disable IPv6 Support :

# vi /etc/lighttpd/lighttpd.conf

server.use-ipv6 = "disable"
server.max-fds = 2048

-- Save & Quit (:wq)

Step: 6. Start Lighttpd Server :

# service lighttpd restart
# chkconfig lighttpd on

Step: 7. Create Certificate Signing Request (CSR) :

# mkdir /etc/lighttpd/ssl/
# cd /etc/lighttpd/ssl/

# openssl req -new -newkey rsa:2048 -nodes -keyout ser4.domain.com.key -out ser4.domain.com.csr

Country Name (2 letter code) [XX]: IN
State or Province Name (full name) []: WB
Locality Name (eg, city) [Default City]: Kolkata
Organization Name (eg, company) [Default Company Ltd]: Organization_Name
Organizational Unit Name (eg, section) []: IT
Common Name (eg, your name or your server's hostname) []: ser4.domain.com
Email Address []: admin@domain.com

A challenge password []: Just Press Enter.
An optional company name []: Just Press Enter.

Step: 8. Request Certificate from CA :

# openssl x509 -req -days 365 -in ser4.domain.com.csr -signkey ser4.domain.com.key -out ser4.domain.com.crt
# cat ser4.domain.com.key ser4.domain.com.crt > ser4.domain.com.pem

Step: 9. Lighttpd Virtual Hosting :

# mkdir -p /var/www/domain.com/http
# mkdir /var/log/lighttpd/domain.com
# chown lighttpd:lighttpd /var/www/domain.com/http
# chown lighttpd:lighttpd /var/log/lighttpd/domain.com

# vi /etc/lighttpd/lighttpd.conf

$SERVER["socket"] == ":443" {
        ssl.engine = "enable"
        ssl.pemfile = "/etc/lighttpd/ssl/ser4.domain.com.pem" 
}

$HTTP["host"] =~ "(^|\.)domain\.com$" {
server.name = "ser4.domain.com"
server.document-root = "/var/www/domain.com/http"
accesslog.filename = "/var/log/lighttpd/domain.com/access.log"
server.error-handler-404 = "/e404.php"
}

-- Save & Quit (:wq)

Step: 10. Verify Configuration & Restart Lighttpd :

# lighttpd -t -f /etc/lighttpd/lighttpd.conf
Syntax OK

# service lighttpd restart

# netstat -tulpn | grep lighttpd
tcp        0      0 0.0.0.0:80                    0.0.0.0:*                   LISTEN      3426/lighttpd      
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      3426/lighttpd



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

 

Saturday 18 March 2017

How To Configure Magento2 with Nginx on Ubuntu 14.04

How To Configure Magento2 with Nginx on Ubuntu 14.04


Q. What is Magento :

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

Step: 1. Set Host Name :

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

magento.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Hosts File :

# vi /etc/hosts

10.100.97.37    magento.domain.com        magento

-- Save & Quit (:wq)

Step: 3. Update the System :

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

Step: 4. Install NTP Server For Time Synchronization :

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

Step: 5. Install Nginx Server :

# apt-get -y install nginx

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

# netstat -plntu | grep 80

Step: 6. Install PHP7 with PHP7-FPM :

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

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

Step: 7. Modify PHP Settings For Magento :

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

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

-- Save & Quit (:wq)

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

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

-- Save & Quit (:wq)

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

Step: 9. Install MySQL Server :

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

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

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

# mysql -u root -p
Enter the Password:

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

Step: 11. Install PHP Composer :

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

-- Now Verify that Composer Command is Working :

# composer -v

Step: 12. Download & Extract Magento 2 :

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

Step: 13. Configure the Magento Key :

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

http://repo.magento.com/

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

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

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

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

Step: 15. Configure the Nginx Virtualhost :

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

-- Paste the below Configuration :

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

server {

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

-- Save & Quit (:wq)

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

Step: 16. Install Magento Through Command Line :

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

IMPORTANT Note:

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

Step: 17. Set Appropriate Permission for Magento :

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

Step: 18. Restart the Nginx Server :

# service nginx restart

Step: 19. Access the Site & Admin Panel :

http://magento.domain.com

-- For Admin Access :

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

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

# crontab -u www-data -e

-- Add the Following Lines:

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

-- Save & Quit (:wq)

# service cron restart

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


Sunday 5 March 2017

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

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


Q. What is Chamilo?

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

-- Some of the important features of Chamilo are:

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

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Firewall :


# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP :

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

Step: 4. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 5. Install MySQL Database Server :

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

Step: 6. Install Epel Repo :

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

Step: 7. Install PHP :

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

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

# service httpd restart
# chkconfig httpd on

Step: 9. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 10. Create Database and User for Chamilo :

# mysql -u root -predhat

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

Step: 11. Install Some Prerequired Packages :

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

Step: 12. Modify php.ini :


# vi /etc/php.ini

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

-- Save & Quit (:wq)

Step: 13. Enable Internationalization Support in PHP :

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

Step: 13. Download latest Version of Chamilo :

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

Step: 14. Restart the Apache Service :

# service httpd restart

Step: 15. Install Chamilo Through Web Browser :

http://192.168.72.220/chamilo

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

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

 

Sunday 26 February 2017

Setup Chat Support On Your Website With Mibew Messenger on CentOS 6x

Mibew Messenger on CentOS 6x


Q. What is 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.

Features:

– Visitors can do real-time chat without page refresh.
– Unlimited operators, chats, and users.
– Unlimited departments (groups of operators).
– Priority queue of visitors.
– Localized to 10+ languages, unicode support.
– Runs on your server and domain.
– Complete free and Open source.

Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.domain.com ser1

-- Save & Quit (:wq)

Step: 2. Disabled Firewall & Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Install Apache Server :

# yum -y install httpd httpd-devel wget unzip

Step: 4. Install MySQL Server :

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

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

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 6. Install PHP5 Scripting Language :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
    php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap \
    mod_ssl php-cli
 
Step: 7. Start Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 8. Create Database For Mibew :

# mysql -u root -p
Enter Password:

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

Step: 9. Download & Install Mibew :

# mkdir /var/www/html/mibew
# cd /var/www/html/mibew
# wget https://netix.dl.sourceforge.net/project/mibew/core/2.2.0/mibew-2.2.0.zip
# unzip mibew-2.2.0.zip
# rm -rf mibew-2.2.0.zip

Step: 10. Set Privileges to Mibew Directory :

# chown -Rf root:apache /var/www/html/mibew/
# chmod -Rf 755 /var/www/html/mibew/

Step: 11. Set your Mibew Application Path & DB Settings :

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

$webimroot = "/mibew";

*  MySQL Database parameters
 */
$mysqlhost = "localhost";
$mysqldb = "mibewdb";
$mysqllogin = "mibew";
$mysqlpass = "password";
$mysqlprefix = "";

-- Save & Quit (:wq)

Step: 12. Now, Point your Web Browser & Type :

http://192.168.72.220/mibew/install

-- Click on Create Required Tables link.

User: "admin" with blank Password.

-- Edit General Operator Settings:
     Login: admin
     Email: kchatterjee@domain.com
     Password: Passw0rd
     Confirmation: Passw0rd
     Name: Koushik Chatterjee
  
-- Click on Save.

Step: 13. For Security Reason Remove the /mibew/install/ folder :

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

Step: 14. Add the Chat Button on My Website :

-- Go to the Mibew Admin Console.
-- Click on Button Code.
-- Copy the HTML Code & you can Paste them in your Website at any place.
-- You can Change the Chat image using Choose image Button & can Change the Chat window Style as well.

Step: 15. To View the Emails :

-- Open Mibew Admin Panel (http://192.168.72.220/mibew)
-- Login into Admin User.
-- Click on Notification.

You can See the All Emails there.

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

 

Sunday 19 February 2017

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

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


Q. What is osCommerce ?

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

Step: 1. Bind Hosts File :


# vi /etc/hosts

192.168.72.221    ser2.domain.com    ser2

-- Save & Quit (:wq)

Step: 2. Stop Firewall :

For CentOS/RHEL Users :

# service iptables stop
# chkconfig iptables off

For Debian Users :

# service ufw stop

Step: 3. Disable Selinux :

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

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

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

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

Step: 4. Reboot the System :

# init 6

Step: 5. Install Apache Server :

For CentOS/RHEL Users :

# yum -y install httpd httpd-devel

For Debian Users :

# apt-get -y install apache2

Step: 6. Install PHP :

For CentOS/RHEL Users :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel \
    php-xml php-imap php-ldap php-mbstring php-odbc php-pear php-xmlrpc php-soap php-cli \
    php-pdo php-intl mod_ssl
 
For Debian Users :

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

Step: 7. Restart Apache Service :

For CentOS/RHEL Users :

# service httpd restart
# chkconfig httpd on

For Debian Users :

# service apache2 restart

Step: 8. Install MySQL Server :

For CentOS/RHEL Users :

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

For Debian Users :

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

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

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 10. Create Database For osCommerce :

# mysql -u root -predhat

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

Step: 11. Install Following System Utilities :

For CentOS/RHEL Users :

# yum -y install wget unzip

For Debian Users :

# apt-get -y install wget unzip

Step: 12. Download OsCommerce Online Shopping Package :

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

Step: 13. Give Appropriate Permission :

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

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

http://<ip_or_domain>/commerce/install

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

-- Click on "Continue"

Step: 15. Secure the osCommerce Online Shopping Store :

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

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

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

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

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

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

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

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

http://192.168.72.221/commerce/

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


Copyright © 2016 Kousik Chatterjee's Blog