-
Notifications
You must be signed in to change notification settings - Fork 16
/
lab
91 lines (68 loc) · 2.22 KB
/
lab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#to change hostname
servername=lab
echo "you are going to set hostname is $servername"
echo "$servername" >/etc/hostname
#privateip=$((ifconfig eth0 | grep -w 'inet' | awk '{print $2}'))
privateip=$(hostname -I)
echo "$privateip $servername" >>/etc/hosts
hostname -F /etc/hostname
echo "your servername is :`hostname` "
echo "your servername is :$HOSTNAME "
cd /tmp/
yum install wget unzip -y
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
rpm -ivh jdk-8u131-linux-x64.rpm
wget http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.32/bin/apache-tomcat-8.5.32-windows-x64.zip
unzip apache-tomcat-8.5.32-windows-x64.zip
mv apache-tomcat-8.5.32 /opt/tomcat
chmod -R 755 /opt/tomcat/
rm -rf /opt/tomcat/webapps/*
sed -i 's/8080/80/g' /opt/tomcat/conf/server.xml
/opt/tomcat/bin/startup.sh
# Install Mysql Database.
#install the mysql
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
rpm -ivh mysql57-community-release-el7-7.noarch.rpm
yum install mysql-server*
#Start mysql
service mysqld start
ps -ef | grep mysql
#the it will creat log in /var/log/mysqld.log
vim /var/log/mysqld.log
#search :/temporary password
#Copy Password
GeX?UriH=7fi
#to reset Password
mysql_secure_installation
#(optional)
#if failure
SET GLOBAL validate_password.policy = 0;
#To Login database
mysql -h localhost -u root -p
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'cggrL@123';
#check show database
show databases;
CREATE DATABASE petclinic;
show databases;
show tables;
use petclinic;
exit
#Then Download package
wget http://cliqr-appstore.s3.amazonaws.com/petclinic/petclinic.war
after deploy check in browser will get 404 error
then goto
cd /opt/tomcat/webapps/petclinic/WEB-INF/classes/db/mysql
then backup initdb.sql
then open initdb.sql
give user root and password
Then goto /opt/tomcat/webapps/petclinic/WEB-INF/classes/spring
then download jar
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.12.zip
#unzip file
#then go into unziped disectory
#Copy this in /opt/tomcat/lib
then give 755 permission to jar file
Then reatart tomcat
then see in brouser