Thursday 10 March 2016

How to Install WAMP Server on Windows Server 2008/2012 R2


What is WAMP?

WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your Database


Requirement:

A. Apache Server (httpd-2.2.22-win32-x86-no_ssl.msi)
B. PHP (php-5.x.x-Win32-VC9-x86.zip)
C. DotNet Framework 4.0 (dotNetFx40_Full_x86_x64.exe)
D. Mysql Installer Community (mysql-installer-community-5.6.10.1.msi)
E. PhpMyAdmin (phpMyAdmin-4.5.5-english.zip)

Step 1. Install & Configure Apache Server (httpd-2.2.22-win32) :

Download Link:

http://a.mbbsindia.com//httpd/httpd-2.4.18.tar.gz

Next->I Acceept->Next->Give Network Domain (ex:- deb.com)-> Server Name (ex:- apache)-> Administrator email Address(ex:- ddas@kminfosystems.com)->Next-> Choose Custom-> Next->Click on Change & select the Directory (ex-c:\webserver\apche)->Next->Install->Finish.

N.B: ex-c:\webserver\apache make this structure if using this structure

Step 2. Go to Web Browser & type :

http://localhost or http://Your-IP-Address

Step 3. Install & Configure PHP :

Download Latest Version of Php:

http://windows.php.net/downloads/releases/

Extract php-5.x.x-Win32-VC9-x86.zip-> Rename 'php-5.x.x-Win32-VC9-x86' to 'php'-> Cut The php folder-> Open C:\webserver-> Paste.

Open 'php' Folder->find the file named 'php.ini-development'->Rename 'php.ini-development' to 'php.ini'-> Open httpd.conf (Location: C:\webserver\apache\conf\httpd.conf)-> Find

<IfModule !mpm_netware_moudle> & Paste the following Lines-

LoadModule php5_module "C:\webserver\php\php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\webserver\php"

Open the Directory 'htdocs' (C:\webserver\apache\htdocs)-> and make a .php file named info.php-> type:

<?php
phpinfo();
?>

--Save the file.

--Restart the Apache Service.

Step 4. Open the Browser & type :

http://localhost/info.php or http://Your-IP-Adress/info.php

Step 5. Install DotNet Framework 4.0. :

Download .NET:

https://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_setup.exe

Step 6. Install Mysql Installer Community :

Download The Latest Version:

http://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-5.6.28.0.msi

Install Mysql Product-> I Accept-> Next-> Skip-> Next-> Choose 'Server Only'-> Next-> Next-> Execute->
Next-> Check on Advance Configuration-> Next-> Type Mysql Root Password (redhat)->Next->Next->
Check on General Log-> Next-> Next-> Finish.

Go to Start->All Programs->MySQL->MySQL Server 5.6->MySQL 5.6 Command Line Client
Password : redhat

-show databases;
-exit;

Step 7. Install & Configure phpMyAdmin :

Download The Latest Version:
https://www.phpmyadmin.net/downloads/

Extract phpMyAdmin-4.5.5-english.zip-> Rename 'phpMyAdmin-4.5.5-english.zip' to 'pma'-> Cut The pma folder-> Open C:\webserver\apache\htdocs-> Paste.

Open the 'pma' folder-> find the file named 'config.sample.inc.php'-> Rename the file
'config.sample.inc.php' to 'config.inc.php'

Step 8. Go to C:\webserver\php :

Open 'php.ini' file-> Find those three lines

;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll

Uncomment those Lines & modify look like this :

extension="c:\webserver\php\ext\php_mbstring.dll"
extension="c:\webserver\php\ext\php_mysql.dll"
extension="c:\webserver\php\ext\php_mysqli.dll"

--Save the File.

Open httpd.conf (Location: C:\webserver\apache\conf\httpd.conf)-> Find

<IfModule dir_module> Just add index.php after index.html

index.html index.php

--Save the File

--Restart the Apache Service.

Step 9. Open the Browser & type :

http://localhost/pma or http://Your-IP-Address/pma
User Name : root
Enter The Mysql Password : redhat

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

Wednesday 2 March 2016

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



Install Tomcat 9 With Java 9 On Centos/RHEL 6

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

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

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

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

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

Step 2: 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
# export JAVA_HOME=/opt/jdk-9/
# export PATH=PATH:/opt/jdk-9/bin

* 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 3: Download and 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

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

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

### Add these lines in between "<tomcat-users>" Tag. Change the Password and Username.

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

# service tomcat restart
# chkconfig tomcat on

*** Check on Browser: http://<IP_Address>:8080
Click on Manager App and Login with Manager Creds
Click on Host manager and Login with Admin Creds

Step 4: Configure Virtual Host on Tomcat 9 :

N.B: There is some problem with Apache Solr and Railo with Java 9. Seems Java 9 doesn't Work properly for Apache Solr & Railo. So for now Here doing with a sample war file Virtual Hosting. Virtual Host Name test.com (For Example).

# vi /etc/hosts

### add the virtual to hosts file

192.x.x.x test.com

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

## Download sample.war file

# cd /opt
# wget https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
# cd /usr/local/tomcat9
# cp -r webapps/ test.com
# mv test.com/ROOT test.com/ROOT.bak
# cp /opt/sample.war /usr/local/tomcat/test.com/ROOT.war

### Configure the server.xml file for virtual Hosting

# vi /usr/local/tomcat9/conf/server.xml

### add this line

<Host name="test.com"  appBase="test.com" unpackWARs="true" autoDeploy="true"/>

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

# service tomcat restart

*** Check on Browser: http://test.com:8080

Step 5: Apache Reverse Proxy for Tomcat Virtual Hosts :

# yum -y install httpd httpd-devel

# vi /etc/httpd/conf.d/test.com.conf

### Add these Lines

<VirtualHost *:80>
    ServerAdmin email-address
    ServerName test.com
    ServerAlias www.test.com


    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
       Order allow,deny
       Allow from all
    </Proxy>


    ProxyPass / http://test.com:8080/
    ProxyPassReverse / http://test.com:8080/


    ErrorLog /logs/test.com-error_log
    CustomLog /logs/test.com-access_log common

</VirtualHost>

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

# mkdir /logs
# service tomcat restart
# service httpd restart

*** Check on Browser: http://test.com

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