Search This Blog

Lets go..




Manage your Inventory | Grow your restaurant business | Manage your Employee | Control your accounts
Showing posts with label Apache Tomcat. Show all posts
Showing posts with label Apache Tomcat. Show all posts

Thursday

How to install MySQL in CentOS 6

Just run these commands ::
[root@db-tom ~]# yum install wget
[root@db-tom ~]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
[root@db-tom ~]# yum localinstall mysql57-community-release-el6-7.noarch.rpm
[root@db-tom ~]# yum repolist enabled | grep "mysql.*-community.*"
[root@db-tom ~]# yum install mysql-community-server
[root@db-tom ~]# service mysqld start
[root@db-tom ~]# grep 'temporary password' /var/log/mysqld.log
[root@db-tom ~]# mysql_secure_installation

Note : New password must have one capital letter+one special character+one number+one small letter

MySQL start/stop ::
[root@db-tom ~]# /etc/init.d/mysqld stop
[root@db-tom ~]# /etc/init.d/mysqld start
[root@db-tom ~]# /etc/init.d/mysqld restart
[root@db-tom ~]# /etc/init.d/mysqld status

How to install latest Apache Tomcat

Ubuntu ::
Download latest apache tomcat server apache-tomcat.tar.gz file from here:: https://tomcat.apache.org
Give permission to /opt/tomcat :: chmod 777 /opt/tomcat
Move this apache-tomcat.tar.gz to /opt/tomcat directory :: mv apache-tomcat.tar.gz /opt/tomcat
Unpack apache-tomcat.tar.gz :: tar xvzf apache-tomcat-8.0.28.tar.gz
Give proper permission ::
chmod 777 /opt/tomcat/apache-tomcat-8.0.28
chmod 777 /opt/tomcat/apache-tomcat-8.0.28/*
chmod 777 /opt/tomcat/apache-tomcat-8.0.28/conf/*
chmod 777 /opt/tomcat/apache-tomcat-8.0.28/logs/*

vim ~/.bashrc
Add  below two lines end of the file in ~/.bashrc
Press i to edit ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export CATALINA_HOME=/opt/tomcat/apache-tomcat-8.0.28
After adding above two line
Press Esc button then write :wq and press Enter button

Increase tomcat heap memory
Add JAVA_OPTS="-Xms128m -Xmx128m"
in apache-tomcat/bin/catalina.sh at 5th line

Test tomcat server has been installed successfully ::
How to start or stop tomcat server
$CATALINA_HOME/bin/startup.sh
$CATALINA_HOME/bin/shutdown.sh
Open a browser and type localhost:8080 in address bar and you will get a tomcat server page.


CentOS 6.7 ::

Download latest apache tomcat server apache-tomcat.tar.gz file from here https://tomcat.apache.org
Execute these commands ::
[root@db-tom]# mv apache-tomcat-8.0.28.tar.gz  /usr/share
[root@db-tom]# cd /usr/share
[root@db-tom share]# tar -xzf apache-tomcat-8.0.28.tar.gz
This will create the directory /usr/share/apache-tomcat-8.0.28
[root@db-tom share]# cd /etc/init.d
[root@db-tom init.d]# vim tomcat

Press i and copy and paste below script

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_72
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat-8.0.28
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

Press Esc and type :wq and again press Enter button
[root@db-tom init.d]# chmod 755 tomcat



Increase tomcat heap memory ::
Add JAVA_OPTS="-Xms128m -Xmx128m"
in apache-tomcat/bin/catalina.sh
at 5th line

Tomcat Service manipulation ::
[root@db-tom]# service tomcat start
[root@db-tom]# service tomcat stop
[root@db-tom]# service tomcat restart

Open a browser and type localhost:8080 in address bar and you will get a tomcat server page