Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Tuesday, 29 March 2016

Install & Configure AWS API Tool on EC2 Instance

Install & Configure AWS API Tool on EC2 Instance
Q. What is AWS API Tool ?


 Ans: The API tools serve as the client interface to the Amazon EC2 web service. You can use the CLI tools to manage your Amazon EC2 resources (such as instances, security groups, and volumes) and your Amazon VPC resources (such as VPCs, subnets, route tables, and Internet gateways).

Step: 1. Install Java :

# yum -y install java-1.7.0-openjdk
# export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
# java -version

Step: 2. Download & Unzip Amazon EC2 CLI Tools :

# yum -y install wget zip unzip
# cd /tmp
# wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
# unzip ec2-api-tools.zip

Step: 3. Install the Amazon EC2 CLI Tools :

# mkdir /usr/local/ec2
# mv ec2-api-tools-1.7.5.0 /usr/local/ec2/apitools/

Step: 4. Set Variables :

# export EC2_HOME=/usr/local/ec2/apitools
# export PATH=$PATH:$EC2_HOME/bin

Step: 5. Add variables to Startup Script :

# cd /etc/profile.d/
# vi aws.sh

export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
export EC2_HOME=/usr/local/ec2/apitools
export PATH=$PATH:$EC2_HOME/bin

-- Save & Quit (:wq)


# chmod +x aws.sh
# source aws.sh

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

Thursday, 17 March 2016

Take Backup of Windows Web Server Using Batch Script

Take Backup of Windows Web Server Using Batch Script

One of the most common, and well suited, applications for a command line script is data backup. Command line scripts can be automated to run at any time without any human interaction.

Requirements:

Windows 2000/XP/2003/Win7/2008/2012
7-Zip (it’s free).

Open Notepad or Notepad++ & Paste the Bellow Code :

set TIMESTAMP=%DATE:~7,2%-%DATE:~4,2%-%DATE:~10,4%-%TIME:~0,2%%TIME:~3,2%%TIME
:~6,2%
cd C:\WebBackup\www_backup\
md "%TIMESTAMP%"
ECHO %TIMESTAMP% > "C:\WebBackup\backuplog\www_%TIMESTAMP%.log"
ECHO "Backup of My Websites" >> "C:\WebBackup\backuplog\www_%TIMESTAMP%.log"
cd C:\www\
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.7z" "%%X\" >> "C:\WebBackup\backuplog\www_%TIMESTAMP%.log"
move C:\www\*.7z C:\WebBackup\www_backup\%TIMESTAMP%\ >> "C:\WebBackup\backuplog\www_%TIMESTAMP%.log"
exit

-- Save the File with .bat Extension. (Ex: MyScript.bat)

Here, My Web File Location is "C:\www\" & My Web File Backup Location is "
C:\WebBackup\www_backup\"


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


Tuesday, 15 March 2016

How To Install & Configure Zpanel on Centos/RHEL 6x

How To Install & Configure Zpanel on Centos/RHEL 6x

Q. What is Zpanel ?

Ans: ZPanel is a free and complete web hosting control panel for Microsoft® Windows™ and POSIX (Linux, UNIX and MacOSX) based servers. ZPanel is written in PHP and uses several open-source (or freely available) software packages to provide a secure, web hosting system.

Step: 1. Disable Selinux & Iptables :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

# service iptables stop
# chkconfig iptables off

Step: 2. Download the correct Installer for your System :

# cd /tmp
# wget http://www.zvps.co.uk/downloads/centos/10-1-0/updater-10-1-0-centos-64.sh.x.tar.gz
# tar -xf updater-10-1-0-centos-64.sh.x.tar.gz

Step: 3. Install pre-required Packages :

# yum -y install ld-linux.so.2 curl

Step: 4. Change the Script to be Executable :

# chmod +x updater-10-1-0-centos-64.sh.x
# ./installer-10-1-0-centos-64.sh.x

Set Time Zone : Asia/Kolkata
Enter -> Enter -> Enter.

Note: The Zadmin, MySQL root & postfix passwords are all stored in /root/passwords.txt after installation.

Lastly run the following command to fix the zpanel stored IP (broken api call) REPLACE 0's with your actual public IP:

# setso --set server_ip 000.000.000.000

Step: 5. Open Your Web Browser & Type :

http://192.168.72.140

MySQL Root Password    : 0lENKKZ4zOKO4qcD
MySQL Postfix Password : eyiF5v0emD5tYDnB
ZPanelX Username       : zadmin        
ZPanelX Password       : L6XOGulJj1JeoqYR

Step: 6. To Change Zpanel Admin Password :

Go to Account Information -> Change Password -> Type Current Password & New Password -> Change.

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

Sunday, 13 March 2016

How to Install Bitcoin XT node on Ubuntu Server 14.04 LTS

How to Install Bitcoin XT node on Ubuntu Server 14.04 LTS

Q. What is Bitcoin ?

Ans: Bitcoin is digital currency in which encryption techniques are used to regulate the generation of units of currency. In 2009 by an unknown person using the alias Satoshi Nakamoto. It is the first decentralized peer-to-peer payment network that is powered by its users with no central authority or middlemen – meaning, no banks! No one controls it. There are no transaction fees and no need to give your real name.

OS: Ubuntu Server 14.04 LTS
Minimum HDD Size: 120 GB
Minimum RAM:  3.5 GB
CPU: 2 Cores

Step: 1. Install Prerequisites :

# apt-get update
# apt-get -y install python-software-properties
# apt-get -y install build-essential libboost-all-dev automake libtool autoconf
# apt-get -y install libdb++-dev
# apt-get -y install libboost-all-dev
# apt-get -y install pkg-config
# apt-get -y install libssl-dev
# apt-get -y install libcurl4-openssl-dev
# apt-get -y install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
# apt-get -y install git

Step: 2. Install BitcoinXT :

# cd
# git clone https://github.com/bitcoinxt/bitcoinxt
# cd bitcoinxt
# ./autogen.sh
# ./configure --with-cli=yes --with-gui=no --disable-wallet
# make
# make install

Step: 3. We will Run bitcoind once so it Generates the proper Directories :

# bitcoind -server

Step: 4. Configure BitcoinXT :

# echo 'rpcuser=bitcoinrpc' > ~/.bitcoin/bitcoin.conf   (Default Bitcoin XT User)
# echo 'rpcpassword=6Q9k65HhrgA1ghY1chr2x4776AwEkkf1eH5eZ7Fh7dXk' >>  ~/.bitcoin/bitcoin.conf  (Default Bitcoin XT Password)
# echo 'server=1' >>  ~/.bitcoin/bitcoin.conf

Step: 5. Verify config-file Values are in the file :

# cat ~/.bitcoin/bitcoin.conf

Step: 6. To Check this has Worked perform the Following :

# cd ~/.bitcoin
# ls -al

"blocks" should be in a cyan colour and look like this: blocks -> /media/data/blocks Node that it's the current user, bitcoin, that has file access.

Step: 7. The Daemon should now be ready to Start :

# bitcoind -daemon

Step: 8. Type the Following to run a Small Test :

# bitcoin-cli getinfo

The output should be something like this :

{
    "version" : 110000,
    "protocolversion" : 70010,
    "blocks" : 90012,
    "timeoffset" : -1,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 3091.73689041,
    "testnet" : false,
    "relayfee" : 0.00001000,
    "errors" : ""
}

Step: 9. Also, go to https://getaddr.bitnodes.io/ & type in the node network address. ex: 192.168.72.10 & click "CHECK NODE".

Something like the following should show to verify you are running BitcoinXT:

192.168.72.10:8333 /Bitcoin XT:0.11.0/

Step: 10. To Check Block Chain :

https://blockchain.info/

# bitcoin-cli getblockcount

Step: 11. To Check BitcoinXT Version :

# bitcoind -version

Bitcoin XT Daemon version v0.11.0.0-fa6040a
Copyright (C) 2009-2015 The Bitcoin XT Developers

Step: 12. To Check Debug Log files :

# tail -100f ~/.bitcoin/debug.log

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

Wednesday, 9 March 2016

How to Install & Configure Prestashop On RHEL/Centos 6x

How to Install & Configure Prestashop On RHEL/Centos 6x


Q. What is Prestashop ?

Ans: PrestaShop is a free, open source e-commerce solution. It supports payment gateways such as DirecPayDirecPay,Google Checkout, Authorize.Net, Skrill, PayPal and PayPal Payments Pro via their respective APIs.


Step: 1. Install Apache Server & Dependency :


# yum -y install httpd httpd-devel zip unzip wget

Step: 2. 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: 3. Download & Configure PrestaShop :

# cd /var/www/html
# wget https://prestashop.googlecode.com/files/prestashop_1.5.6.2.zip
# unzip prestashop_1.5.6.2.zip

# chmod -Rf 777 /var/www/html/prestashop


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

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

Add those Lines :

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

-- Save & Quit (:wq)


Step: 5. Install MySQL Database Server :

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

Step: 6. Start MySQL Service :

# service mysqld start

Step: 7. Changing MySQL Root Password :

# mysql_secure_installation

Press Enter --> Y --> Give the Root Password --> Enter --> n --> Enter --> n --> Enter --> n --> Enter.

Step: 8. Create Database for PrestaShop :

# mysql -u root -p

-- Give root Password.

Mysql> create database prestashop character set utf8;
Mysql> grant all privileges on prestashop.* to 'presta'@'localhost' identified by 'password';
Mysql> grant all privileges on prestashop.* to 'presta'@'%' identified by 'password';
Mysql> flush privileges;
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

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
# chkconfig httpd on
# service mysqld restart
# chkconfig mysqld on

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

Ex- http://192.168.72.140/info.php

Step: 13. Configure PrestaShop Server :


Go to http://192.168.72.140/prestashop

Select Language: English -> Next -> I Agree -> Next -> Shop Name: server1.kmi.com, Main activity: Select anything, Country: Select Country, First Name: Koushik, Last Name: Chatterjee, Email Address: your-email@domain.com, Shop Password: Password, Re-type to confirm: Password -> Next -> Database Server Add: localhost, DB Name: prestashop, DB Login: presta, DB Password: password -> Next.

# cd /var/www/html/prestashop
# rm -rf install

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

Copyright © 2016 Kousik Chatterjee's Blog