/WebTool

Primary LanguageJava

1.Background
When building our group chat website we need to be able to monitor the service from business perspectives. Business monitoring collects and measure important metrics that help to determine if the website does the right thing. It is NOT operational monitoring where one check if the site is available or something is broken.
2.Sumarry
My project is implemented by JavaEE, use MySQL as database, follow the MVC design pattern. Users could “sign up”, “login”, “send chat message”, “check online user” and “view the hit number” with my website.
3. Environment and Programming language
JDK1.8, Tomcat8, MySQL, Java, JSP, HTML, JavaScript and CSS.
4.Build server 
•	Create a new instance on GCP.
•	Install JDK1.8
sudo apt-get update;
sudo apt-get install default-jdk;

Or download jdk-8uversion-linux-x64.tar.gz
  % tar zxvf jdk-8uversion-linux-x64.tar.gz

•	Install tomcat8
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat;
wget http://mirror.sdunix.com/apache/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz;
mv apache-tomcat-8.0.9 /opt/tomcat;
$CATALINA_HOME/bin/startup.sh
You should get a result similar to:
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-7-openjdk-amd64/
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Tomcat started;
Check http://127.0.0.1:8080
•	Install MySQL
yum repolist all | grep mysql;
yum repolist enabled | grep mysql;
sudo yum install mysql-community-server;
sudo service mysqld start
sudo service mysqld status



•	Create table in MySQL
create database test;
show tables;
use test;
create table UserTb 
		(UserId INT not null primary key auto_increment,
        UserName varchar(255),
        Password varchar(255));

create table MsgTb 
		(MsgId INT not null primary key auto_increment,
        Time datetime,
        message varchar(512),
        UserId INT,
        FOREIGN KEY (UserId) REFERENCES UserTb(UserId) );

create table VisitRecordTb 
		(VisitId INT not null primary key auto_increment,
        SessionId varchar(255),
        StartTime datetime,
        EndTime datetime,
        UserId INT,
        FOREIGN KEY (UserId) REFERENCES UserTb(UserId) );

create table RequestRecordTb 
		(RequestId INT not null primary key auto_increment,
        RequestTime datetime,
        RequestURI varchar(255)
        );