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

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

 

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

 

Saturday, 4 February 2017

How To Configure Pen-Load Balancer on Centos/RHEL 6x

How To Configure Pen-Load Balancer on Centos/RHEL 6x


Q. What is PEN ?

-- Install Pen to configure Load Balance server. Pen is a light weight simple load balancer. This example shows to configure on the environment like follows.

Scenario:
=======
192.168.100.229    ser5.domain.com     ser5 - PEN Server
192.168.100.220    ser1.domain.com     ser1 - Web Server1
192.168.100.221    ser2.domain.com     ser2 - Web Server2

Step: 1. Bind Hosts File (All Servers) :

# vi /etc/hosts

192.168.100.229    ser5.domain.com     ser5
192.168.100.220    ser1.domain.com     ser1
192.168.100.221    ser2.domain.com     ser2

-- Save & Quit (:wq)

Step: 2. Install and Configure Pen (192.168.100.229-ser5.domain.com) :

# cd /tmp
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

# yum -y install pen

# vi /etc/pen.conf

-- Paste the Following Lines :

# log file
LOGFILE=/var/log/pen.log

# output file of status
WEBFILE=/var/www/pen/webstats.html

# control port
CONTROL=127.0.0.1:10080

# max connections
MAX_CONNECTIONS=500

# listen port
PORT=80

# number of backend servers
BACKEND=2

# IP address of a backend webserver
SERVER1=192.168.100.220:80

# IP address of a backend webserver
SERVER2=192.168.100.221:80

-- Save & Quit (:wq)

Step: 3. Create init Script for Pen :

# vi /etc/rc.d/init.d/pend

#!/bin/bash

# pend: Start/Stop Pend
# chkconfig: - 90 10
# description: Pen is a light weight simple load balancer.
# pidfile: /var/run/pen.pid

. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
. /etc/pen.conf

LOCKFILE="/var/lock/subsys/pen"
PID=/var/run/pen.pid
PROG=/usr/bin/pen

RETVAL=0
start() {
   echo -n $"Starting Pend: "
   SERVER=`grep "^SERVER" /etc/pen.conf | cut -d= -f2`
   daemon $PROG -w $WEBFILE -x $MAX_CONNECTIONS -p $PID -l $LOGFILE -C $CONTROL -S $BACKEND -r $PORT $SERVER
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && touch $LOCKFILE
   return $RETVAL
}
stop() {
   echo -n $"Stopping Pend: "
   killproc $PROG
   RETVAL=$?
   echo
   [ $RETVAL -eq 0 ] && rm -f $PID $LOCKFILE
   return $RETVAL
}
case "$1" in
   start)
      start
      ;;
   stop)
      stop
      ;;
   status)
      status pend
      ;;
   restart)
      stop
      start
      ;;
   *)
      echo $"Usage: $0 {start|stop|status|restart}"
      exit 1
esac
exit $?

-- Save & Quit (:wq)

Step: 4. Setting up Log Rotation :

# vi /etc/logrotate.d/pen

/var/log/pen.log {
   daily
   copytruncate
   compress
   notifempty
   missingok
   postrotate
     /etc/rc.d/init.d/pend restart 2>&1 > /dev/null || true
   endscript
}

-- Save & Quit (:wq)

# chmod 755 /etc/rc.d/init.d/pend
# service pend start
# chkconfig --add pend
# chkconfig pend on

Step: 5. Install & Configure Backend Web Server (Web-Server1 & Web-Server2) :

# yum -y install httpd httpd-devel
# cd /var/www/html
# vi index.html

<html>
<body bgcolor="black">
<marquee><font size="8" color="yellow"> This is Web-Server1...!!!</font></marquee>
</body>
</html>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on

On Web-Server2 :

# yum -y install httpd httpd-devel
# cd /var/www/html
# vi index.html

<html>
<body bgcolor="black">
<marquee><font size="8" color="yellow"> This is Web-Server2...!!!</font></marquee>
</body>
</html>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on

Step: 6. Now, Point Your Web Browser & Type :

http://192.168.100.229  # Pen Server IP Address.

Step: 7. Configure the tool that it's possible to watch Pen's Status :

# cp /usr/share/doc/pen-*/penstats /var/www/pen
# vi /var/www/pen/penstats

# Line No. 4: Change to:

PIDFILE=/var/run/pen.pid

# Line No. 5: Change to:

WEBFILE=/var/www/pen/webstats.html

-- Save & Quit (:wq)

Step: 8. Install Apache Server for See Pen Status :

# yum -y install httpd httpd-devel

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

Chenge Listen Port to:

Listen 8080

-- Save & Quit (:wq)

# mv /etc/httpd/conf.d/pen.conf /etc/httpd/conf.d/pen.conf.bak
# vi /etc/httpd/conf.d/pen.conf

Alias /pen/ /var/www/pen/
<Directory /var/www/pen/>
   DirectoryIndex penctl.cgi
   Options ExecCGI
   order deny,allow
   deny from all
   allow from 127.0.0.1 192.168.100.0/24   # IP address you permit
</Directory>

-- Save & Quit (:wq)

# service httpd restart
# chkconfig httpd on
# service pend restart

Step: 10. Run the Following Command :

# chmod 755 /var/www/pen/penstats
# /var/www/pen/penstats > /dev/null

Step: 10. Schedule in Crontab (Update by 1 minutes) :

# crontab -e

*/1 * * * * /var/www/pen/penstats > /dev/null

-- Save & Quit (:wq)

# service crond restart

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


Sunday, 8 January 2017

Install Maven3 on Ubuntu Server 14.04

Install Maven3 on Ubuntu Server 14.04


Q. What is Apache Maven?

-- Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Step: 1. Add the following line in sources.list file :

# vi /etc/apt/sources.list

deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main
deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main

-- Save & Quit (:wq)
       
Step: 2. Update the Systems & Install Maven3 :

# apt-get update --fix-missing
# apt-get install maven3
   
Step: 3. Create a Symbolic link :

# ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn

Step: 4. Check mvn is Working :
   
# mvn -version

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-44-generic", arch: "amd64", family: "unix"

Step: 5. Running Maven Tools :

-- These are the most Common default lifecycle phases executed.



# mvn validate: Validate the project is correct & all necessary information is available.

# mvn compile: Compile the source code of the project.

# mvn test: test the compiled source code using a suitable unit testing framework.

# mvn package: take the compiled code & package it in its distributable format, such as a JAR.

# mvn integration-test: Process & Deploy the Package if necessary into an environment where
integration tests can be run.

# mvn verify: Run any checks to verify the package is valid and meets quality criteria.

# mvn install: Install the package into the local repository, for use as a dependency in other projects locally.

# mvn deploy: Done in an integration or release environment, copies the final package to the rem.


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

 

Saturday, 10 December 2016

Install & Configure Drupal 7 with MongoDB on CentOS/RHEL 6x

Install & Configure Drupal 7 with MongoDB on CentOS/RHEL 6x


Q. What is Drupal?

-- Drupal is content management software. The application includes a content management platform and a development framework. It's used to make many of the websites and applications you use every day. Drupal has great standard features, like easy content authoring, reliable performance, and excellent security.

Step: 1. Bind Hosts File :

# vi /etc/hosts

10.100.99.214           drupal.domain.com    drupal

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP Server (for Time Syncronization) :

# 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 PHP 5.6 :

# yum -y install epel-release
# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# yum -y install php56w php56w-cli php56w-devel php56w-common php56w-mbstring \
    php56w-gd php56w-xml php56w-mcrypt php56w-mysqlnd php56w-imap php56w-pdo \
    php56w-snmp php56w-soap php56w-xmlrpc php56w-opcache php56w-iconv \
    php56w-ldap php56w-pear mod_ssl wget

Step: 6. Install MySQL Server 5.6 :

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

Step: 7. Finally Restart the Apache Service :

# service httpd restart
# chkconfig httpd on

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

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation

Step: 9. Create Database for Drupal :

# mysql -u root -p
Enter Password:

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

Step: 10. Download & Extract Drupal Source Code :

# cd /var/www/html/
# wget http://ftp.drupal.org/files/projects/drupal-7.50.tar.gz
# tar -zxvf drupal-7.50.tar.gz
# mv drupal-7.50 drupal
# chown -Rf apache:apache /var/www/html/drupal

Step: 11. We need to Create Settings file from the default.settings.php File :

# cd /var/www/html/drupal/sites/default/
# cp -p default.settings.php settings.php
# chmod a+w /var/www/html/drupal/sites/default/settings.php
# chmod a+w /var/www/html/drupal/sites/default/

Step: 12. Enable Apache mod_rewrite Module & Set Date-Time In php.ini :

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

Line No: 338

AllowOverride None To AllowOverride All

At the End, Add this Line :

RewriteEngine on

-- Save & Quit (:wq)

# vi /etc/php.ini

date.timezone = "Asia/Kolkata"

-- Save & Quit (:wq)

# service httpd restart

Step: 13. Install Drupal Through Web Browser :

http://10.100.99.214/drupal/core/install.php

-- Choose Profile: Standard & Clcik on "Save & Continue"
-- Choose Language: English & Click on "Save & Continue"
-- Database Configuration:
     Database Type: Select "MySQL, MariaDB, Percona Server, or equivalent"
     Database Name: drupaldb
     Database Username: drupal
     Database Password: password
  
-- Clcik on "Save & Continue".
-- SITE INFORMATION:
     Site Name: drupal.domain.com
     Site Email Address: koushik@domain.com
-- SITE MAINTENANCE ACCOUNT:
     Username: admin
     Password: Passw0rd
     Confirm Password: Passw0rd
-- REGIONAL SETTINGS:
     Default Country: India
-- Click on "Save & Continue"
-- Click on "View Your New Site."

Step: 14. Install & Configure MongoDB :

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

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

-- Save & Quit (:wq)

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

# vi /etc/mongod.conf

## Change Line Number 19 "bind_ip"

bind_ip=0.0.0.0

-- Save & Quit (:wq)

# service mongod restart
# chkconfig mongod on

Step: 15. Install MongoDB Driver :

# yum -y install gcc openssl-devel
# pecl install mongo

Build with Cyrus SASL (MongoDB Enterprise Authentication) support? [no] : Just Press Enter.

Step: 16. Add the Extension in php.ini File :

# vi /etc/php.d/mongo.ini

extension=mongo.so

-- Save & Quit (:wq)

Step: 17. Finally Restart the Apache Service & Verify :

# service httpd restart

# php -i | grep mongo

Step: 18. Install MongoDB Module in Drupal :

# cd /opt
# wget http://ftp.drupal.org/files/projects/mongodb-7.x-1.x-dev.tar.gz
# tar -zxvf mongodb-7.x-1.x-dev.tar.gz
# mv mongodb /var/www/html/drupal/sites/all/modules/
# chown -Rf apache:apache /var/www/html/drupal/sites/all/modules/mongodb
# cd /var/www/html/drupal/sites/default
# vi local.settings.php

<?php
# MongoDB
$conf['mongodb_connections'] = array(
     'default' => array(
       'host' => 'localhost',                   
       'db' => 'drupal', // Database name. Mongodb will automatically create the database.
       'connection_options' => array( 'replicaSet' => 'my_mongodb_0' ),
      ),
   );

include_once('./includes/cache.inc');

   # -- Configure Cache
   $conf['cache_backends'][] = 'sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc';
   $conf['cache_class_cache'] = 'DrupalMongoDBCache';
   $conf['cache_class_cache_bootstrap'] = 'DrupalMongoDBCache';
   $conf['cache_default_class'] = 'DrupalMongoDBCache';

   # -- Don't touch SQL if in Cache
   $conf['page_cache_without_database'] = TRUE;
   $conf['page_cache_invoke_hooks'] = FALSE;

   # Session Caching
   $conf['session_inc'] = 'sites/all/modules/mongodb/mongodb_session/mongodb_session.inc';
   $conf['cache_session'] = 'DrupalMongoDBCache';

   # Field Storage
   $conf['field_storage_default'] = 'mongodb_field_storage';

   # Message Queue
   $conf['queue_default_class'] = 'MongoDBQueue';
?>

-- Save & Quit (:wq)

# chown apache:apache local.settings.php
# chmod 644 local.settings.php

# sed -i 's|localhost|10.100.99.214|g' /var/www/html/drupal/sites/all/modules/mongodb/mongodb.module
# sed -i 's|localhost|10.100.99.214|g' /var/www/html/drupal/sites/all/modules/mongodb/mongodb.drush.inc

http://10.100.99.214/drupal/admin/modules

Note: Now Open the Admin Panel of Drupal & Uncheck the "Block" & "Dashboard" from the Modules & Check all the Modules of MongoDB Section except "MongoDB Cache" & "MongoDB Migrate".

-- Click on "Save Configuration."

# mongo
mongo> show dbs
admin   (empty)
drupal  0.078GB
local   0.078GB

mongo> use drupal
mongo> show collections

session
system.indexes
watchdog
watchdog_event_3f71fc116d395612bd0b3dd8e022dc09
watchdog_event_782ddf217853242a4f40f642a4792b9e
watchdog_event_d29d18b2c99dc1af6e22838feee53c62

mongo> exit

** That mean the MongoDB has been Successfully Integrated with the Drupal.

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


Saturday, 5 November 2016

Install & Configure Joomla on CentOS/RHEL 6x

Install & Configure Joomla on CentOS/RHEL 6x


Q. What is Joomla?

-- Joomla is a popular Open Source Content Management System (CMS) tool which allows us to easily build dynamic website and manage online applications. It also manage & publish your website contents like video, pictures, articles on the website. Joomla is freely available, which supports huge third party plug-ins and themes. With the help of Content Management System (CMS), you can set up websites in the World Wide Web (WWW) without having knowledge of programming.

Step: 1. Set Host Name :

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

HOSTNAME=joomla.domain.com

-- Save & Quit (:wq)

Step: 2. Bind Hosts File :


# vi /etc/hosts

10.100.99.214           joomla.domain.com    joomla

-- Save & Quit (:wq)

Step: 3. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

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. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 6. 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 Joomla Package :

# cd /var/www/html
# wget http://joomlacode.org/gf/download/frsrelease/18323/80367/Joomla_3.1.1-Stable-Full_Package.tar.gz
# mkdir joomla
# tar zxvf Joomla_3.1.1-Stable-Full_Package.tar.gz -C joomla/

# chmod -Rf 775 joomla

Step: 7. Edit the 'httpd.conf' File :

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

-- Add those Lines :

<Directory /var/www/html/joomla>
    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 mysql-devel

Step: 9. Start MySQL Service :

# service mysqld start
# chkconfig mysqld on

Step: 10. Setup MySQL Root Password :

# mysql_secure_installation

Step: 11. Create Database & User for Joomla :

# mysql -u root -p

-- Give root Password.

Mysql> create database joomladb character set utf8;
Mysql> grant all privileges on joomla.* to joomla@'localhost' identified by 'password';
Mysql> grant all privileges on joomla.* to joomla@'%' identified by 'password';
Mysql> flush privileges;
Mysql> exit

Step: 12. Install PHP5 Scripting Language :

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

Step: 13. Check php Configuration :

# 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 Browser to http://ip_address/info.php :

Ex- http://10.100.99.214/info.php

Step: 16. Configure Joomla Server through Web Browser :

Go to http://10.100.99.214/joomla

-- Select Language: English
-- Site Name: Koushik's World
     Admin Email: kchatterjee@domain.com
-- Admin Username: admin
     Admin Password: Passw0rd
     Confirm Admin Password: Passw0rd
  
-- Click Next
-- Database Type: MySQL
     Hostname: localhost
     Username: joomla
     Password: password
     Database Name: joomladb
  
-- Click Next.
-- Just Skip Ftp Configuration.
-- Click Next.
-- Select Blog English Sample Data.
-- Click Install.
-- Click on Remove Installation Folder.
-- Click on Site.

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

Sunday, 30 October 2016

Install & Configure GlassFish on CentOS/RHEL 6x

Install & Configure GlassFish on CentOS/RHEL 6x


-- GlassFish is an Application Server which can also be used as a Web Server (Http Server). GlassFish Server is the world's first implementation of the Java Platform.

Step: 1. Bind Hosts File :

# vi /etc/hosts

10.100.97.39           ser3.domain.com    ser3

-- Save & Quit (:wq)

Step: 2. Disable Selinux & Stop Firewall :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 3. Install NTP Server (for Time Synchronization) :

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

# init 6

Step: 4. Installing the Java :

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

Step: 5. Setup JAVA_HOME Variable :

# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME

Step: 6. Edit the Java Profile :

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

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

-- Save & Quit (:wq)

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

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

Step: 8. Download & Extract Glassfish :

# yum -y install unzip
# cd /opt
# wget http://download.java.net/glassfish/4.1.1/release/glassfish-4.1.1.zip
# wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip
# unzip glassfish-4.1.1.zip

Step: 9. Start the GlassFish Server :

# /opt/glassfish4/bin/asadmin start-domain

Waiting for domain1 to start .........
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

Step: 10. Set GlassFish Admin Password (By Default Password is Blank) :

# cd /opt/glassfish4/bin/
# ./asadmin
asadmin> change-admin-password

Enter admin user name [default: admin]> Just Press Enter.
Enter the admin password> Just Press Enter.
Enter the new admin password> Passw0rd (Press Enter.)
Enter the new admin password again> Passw0rd (Press Enter.)
Command change-admin-password executed successfully.

Step: 11. Enabled to Access the DAS Remotely on GlassFish :

asadmin> enable-secure-admin

Enter admin user name>  admin
Enter admin password for user "admin"> Passw0rd

You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

asadmin> stop-domain

Waiting for the domain to stop .
Command stop-domain executed successfully.

asadmin> start-domain

Waiting for domain1 to start .......
Successfully started the domain : domain1
domain  Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

asadmin> exit
Command multimode executed successfully.

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

 

Saturday, 30 April 2016

How to Install & Configure LAMP Server On Ubuntu 14.04


How to Install & Configure LAMP Server On Ubuntu 14.04
Step: 1. Bind Hosts File :

# vi /etc/hosts

192.168.1.250 ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Install Apache2 Server :

# apt-get update
# apt-get -y install apache2 apache2-utils

<<<<<<How to Find your Server’s IP address>>>>>

# ifconfig eth0 | grep inet | awk '{ print $2 }'

Step: 3. Install MySQL Server :

# apt-get -y install mysql-server libapache2-mod-auth-mysql

Note: Once you have installed MySQL, we should activate it with this command :

# mysql_install_db

Step: 4. Set MySQL Root Password :

# mysql_secure_installation

# service mysql restart

Step: 5. Install PHP 5.5 :

# apt-get -y install php5 php5-dev libapache2-mod-php5 php5-mcrypt php5-mysql php5-cli \
   php5-common php5-curl php5-gd php5-imap php5-imagick php5-intl php5-ldap  \
   php5-memcache php5-memcached  php5-snmp php5-xcache php5-xmlrpc

# vi /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>
          DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

-- Save & Quit (:wq)

Step: 6. Search PHP Modules (Optional) :

# apt-cache search php5-
# apt-get -y install php5-json

Step: 7. See PHP on your Server :

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

<?php
phpinfo();
?>

-- Save & Quit (:wq)

http://ip_address/info.php

Or

# php -v

Step: 8. Download & Install phpMyAdmin (To Access MySQL Server Graphically) :

# cd /var/www/html
# wget http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.10/phpMyAdmin-4.0.10-english.tar.gz
# tar -zxvf phpMyAdmin-4.0.10-english.tar.gz
# mv phpMyAdmin-4.0.10-english pma
# rm -rf phpMyAdmin-4.0.10-english.tar.gz
# cd pma/
# mv config.sample.inc.php config.inc.php

# service apache2 restart
# service mysql restart

Step: 9. Configure phpMyAdmin with MD5 Password Protected :

# vi /etc/apache2/sites-available/pma.domain.com.conf

<VirtualHost *:80>
  DocumentRoot /var/www/html/pma
  ServerName pma.anything.com
  # ServerAlias www.pma.domain.com

# Authorize for setup
<Directory /var/www/html/pma/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /home/secure/.htpasswd
    </IfModule>
    Require valid-user
</Directory>

<Directory /var/www/html/pma>
   Options All Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

-- Save & Quit (:wq)

# mkdir /home/secure/
# htpasswd -c /home/secure/.htpasswd pmaadmin

# cd /etc/apache2/sites-enabled/
# ln -s /etc/apache2/sites-available/pma.domain.com.conf pma.domain.com.conf
Or
# a2ensite  pma.domain.com

# service apache2 restart

http://pma.domain.com

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

Saturday, 23 April 2016

Easy Way to Install the MongoDB PHP Driver on CentOS/RHEL 6x & Ubuntu 14.04

Install the MongoDB PHP Driver on CentOS/RHEL 6x & Ubuntu 14.04

Step: 1. Install Apache Server :

For CentOS Users :

# yum -y install httpd httpd-devel

For Ubuntu Users :

# apt-get -y install apache2

Step: 2. Install PHP :

For CentOS Users :

# yum -y install epel-release
# yum -y install php php-cli 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-intl mod_ssl
 
For Ubuntu Users :

# apt-get -y install php5 php5-cli libapache2-mod-php5 php-pear php5-dev

Step: 3. Install Mongo Driver :

For CentOS Users :

# yum -y install openssl-devel
# pecl install mongo

For Ubuntu Users :

# pecl install mongo

Step: 4. Add the Extension in php.ini File :

For CentOS Users :

# vi /etc/php.d/mongo.ini

extension=mongo.so

-- Save & Quit (:wq)

For Ubuntu Users :

# vi /etc/php5/conf.d/mongo.ini

extension=mongo.so

-- Save & Quit (:wq)

Step: 5. Finally Restart the Apache Service :

For CentOS Users :

# service httpd restart

For Ubuntu Users :

# service apache2 restart

Step: 6. Now Create a info.php File Under /var/www/html & Check the Mongo Driver :

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

<?php
    phpinfo ();
?>

-- Save & Quit (:wq)

http://ip_address/info.php

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

Thursday, 14 April 2016

How To Install PHP 7 on CentOS/RHEL 6x

Install PHP 7 on CentOS/RHEL 6x


Step: 1. You must add the Webtatic & EPEL yum Repository :

For 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 --skip-broken

Step: 3. Changes on the Module File for Php :

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

-- Line no. 6 & 10 replace with these Lines.

LoadModule php7_module modules/libphp7.so (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 & Quit (:wq)

Step: 4. Create a php info file & Check :

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

<?php
  phpinfo ();
?>

-- Save & Quit (:wq)

# service httpd restart

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

Friday, 25 March 2016

How to Install Tomcat 9 With Java 9 On CentOS/RHEL 6x


How to Install Tomcat 9 With Java 9 On CentOS/RHEL 6x

 
 Q. What is Apache Tomcat ?

Ans: Tomcat is an open source application server from the Apache Software Foundation that executes Java servlets and renders Web pages that include Java Server Page coding.

Step: 1. Bind the Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.kmi.com    ser1

-- Save & Quit (:wq)

Step: 2. Stop the IPTables & Selinux :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Update the Date Time on the Server :

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

Step: 4. Reboot the System :

# init 6

Step: 5. Download & Install Java 9 :

# cd /opt
# wget http://download.java.net/java/jdk9/archive/104/binaries/jdk-9-ea+104_linux-x64_bin.tar.gz
# tar -zxvf jdk-9-ea+104_linux-x64_bin.tar.gz
# cd jdk-9/
# alternatives --install /usr/bin/java java /opt/jdk-9/bin/java 2
# alternatives --config java

There may Be more that 1 programs which provide 'java'. Select the version Which is downloaded.

Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_45/bin/java
   3           /opt/jdk1.8.0_66/bin/java
   4           /opt/jdk-9/bin/java
  
Enter to keep the current selection[+], or type selection number: 4

# alternatives --install /usr/bin/jar jar /opt/jdk-9/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk-9/bin/javac 2
# alternatives --set jar /opt/jdk-9/bin/jar
# alternatives --set javac /opt/jdk-9/bin/javac

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

#!/bin/bash
JAVA_HOME=/opt/jdk-9/
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)
 
# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 6. Check the Installed Java Version :

# java -version

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+104-2016-02-03-214959.javare.4385.nc)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+104-2016-02-03-214959.javare.4385.nc, mixed mode)

Step: 7. Download & Install Tomcat 9 :

# cd /opt
# wget http://www.us.apache.org/dist/tomcat/tomcat-9/v9.0.0.M3/bin/apache-tomcat-9.0.0.M3.tar.gz
# tar -zxvf apache-tomcat-9.0.0.M3.tar.gz
# mv apache-tomcat-9.0.0.M3 /usr/local/tomcat9

Step: 8. Create a init Script for run the Tomcat as a Service :

# vi /etc/init.d/tomcat

#!/bin/bash
# description: Tomcat Start Stop Restart-SOM
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/opt/jdk-9
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/local/tomcat9

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

-- Save & Quit (:wq)

# chmod 755 /etc/init.d/tomcat

Step: 9. Manage Tomcat Manager & Admin Panel :

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

### Add these lines in between "<tomcat-users>" Tag. Change the Password & User Name.

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

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

-- Save & Quit (:wq)

Step: 10. Start the Tomcat Service :

# service tomcat restart
# chkconfig tomcat on

Step: 11. Check on Web Browser :

http://<IP_Address>:8080

Click on Manager App & Login with Manager Creds
Click on Host Manager & Login with Admin Creds

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

Wednesday, 10 February 2016

How to Install LAMP Server on CentOS/RHEL 6x

How to Install LAMP Server on CentOS/RHEL 6x

LAMP (Linux, Apache, MySQL, PHP)

LAMP is an open source Web development platform that uses Linux as the operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language. (Sometimes Perl or Python is used instead of PHP.)

Step: 1. Bind the Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 3. Edit httpd.conf file :

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

#ServerName www.example.com:80

Just Add this Line-

ServerName IP_Address_of_Server:80

-- Save & Quit (:wq)

Step: 4. Start httpd Service :

# service httpd restart
# chkconfig httpd on

Step: 5. Install MySQL Database Server :

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

Step: 6. Start MySQL Service :

# service mysqld restart
# chkconfig mysqld on

Step: 7. Changing MySQL Root Password :

# mysql_secure_installation

or

# mysql

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

Step: 8. Check loggin With New Password :

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

mysql> show databases;

+--------------------+
| Database                 |
+--------------------+
| information_schema |
| mysql                      |
+--------------------+
2 rows in set (0.00 sec)

mysql> exit

Step: 9. Install PHP5 Scripting Language :

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

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

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

<?php
  phpinfo ();
?>

-- Save & Quit (:wq)

Step: 11. Restart Apache to Load PHP :

# service httpd restart

Step: 12. Then point your browser to http://ip_add/info.php :

Ex- http://192.168.72.220/info.php

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


Copyright © 2016 Kousik Chatterjee's Blog