-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
127 lines (82 loc) · 3.12 KB
/
README
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
README
Test project for YouLook
The application natively deploying on Ubuntu 14.
For deploy the project you need install follow applications:
MySQL 5.7
OpenJDK Version 1.8
Tomcat 7
Tomcat 7 Admin
Apache Maven 3.3.9
git 2.7
When you will install MySQL server, you will be required for root password.
Set it as you wish, but remember it.
Install the requirements with follow commands,
if you still don't have it installed:
sudo apt-get install mysql-server
sudo apt-get install default-jdk
sudo apt-get install tomcat7
sudo apt-get install tomcat7-admin
sudo apt-get install maven
sudo apt-get install git
Clone the repository to any folder you decide to clone to and have
permissions for.
The repository will be cloned into the folder you are stay in:
git clone git@github.com:olgapshen/youlook.git
Navigate to newly created youlook directory.
Connect to mysql server with user root and password you set while installation:
mysql -uroot -ppassword
Run the DB installation script.
You just need to run the commands from the mysql shell:
source DB/schema.sql;
Create user for own the schema (choose user name and password).
CREATE USER 'youlook'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON youlook.* TO 'youlook'@'localhost';
FLUSH PRIVILEGES;
Create configuration directory with configuration file:
sudo mkdir -p /opt/youlook
Create file config.ini inside the folder with follow configuration,
substituting user name and password with those you chose to set:
[auth]
user=youlook
password=123456
Configure Tomcat7 for be able access the console.
Locate file /etc/tomcat7/tomcat-users.xml
Create follow records inside <tomcat-users> xml element:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script"/>
Choose user name and password you wish.
Restart tomcat7 server:
sudo service tomcat7 restart
Navigate to control panel from the browser:
http://localhost:8080/manager/html/
Provide user name and password you defined and previous step.
Here you will able to manage our YouLook application we will deploy soon.
Configure maven for autodeploy.
Locate file /etc/maven/settings.xml
Create follow records inside <servers> xml tag:
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>admin</password>
</server>
Provide user name and password from previous step.
Go back to the repository folder, locate pom.xml file and be in same directory
with the file.
Try to build, package and deploy the application:
mvn tomcat7:redeploy
(use redeploy instead of deploy, thus deploy not always works).
Open monitor for catch DB connection exceptions:
tail -f /var/log/tomcat7/catalina.out
Leave it open and see for errors.
If everything fine, navigate to follow url:
http://localhost:8080/youlook/listProcessedStrings
You will get empty set.
Now try to fill the DB:
http://localhost:8080/youlook/countDigits?str=test1string4
It will display 2, thus there are 2 digits in query string,
and write data to DB.
Check the DB again:
http://localhost:8080/youlook/listProcessedStrings
That it )