-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstallation.html
executable file
·104 lines (94 loc) · 4.77 KB
/
installation.html
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
<!DOCTYPE html>
<html>
<head>
<title> CS 499 Group 7: Supreme Court </title>
<meta charset="UTF-8">
<!-- Put JS headers here -->
<!-- CSS Stylesheets -->
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<div id="main-page" class="container">
<div id="main-page-header" class="header">
<br>
<h1> Supreme Court Rulings Analysis </h1>
<h2>University of Kentucky</h2>
<h2>CS 499 Spring 2018</h2>
</div>
<br><br><br>
<div class="content">
<div class="links">
<a href="index.html">Home</a>
<br><br>
<a href="introduction.html">Introduction</a>
<br><br>
<a href="requirements.html">Requirements</a>
<br><br>
<a href="updates.html">Updates</a>
<br><br>
<a href="schedule.html">Schedule</a>
<br><br>
<a href="design.html">Design</a>
<br><br>
<a href="testing.html">Testing</a>
<br><br>
<a href="useCases.html"> Use Cases</a>
<br><br>
<a href="designAndImplementation.html">Design Considerations/Implementation Issues</a>
<br><br>
<a href="enhancementsMaintenance.html">Future Enhancements/Maintenance</a>
<br><br>
<a href="conclusions.html">Conclusions</a>
<br><br>
<a href="installation.html">Installation</a>
<br><br>
<a href="references.html"> References</a>
<br><br>
</div>
<div class="text">
<h2>"Cold" Installation</h2>
<ol>
<li>Prerequisites: Have a server running Linux Apache PHP MySQL stack. Python 3 is required as well. Also need a Google Cloud Account with Cloud vision and Cloud Language enabled.</li>
<li>In Google Cloud, Create a project, enable the Vision and Language API for said product, and obtain a service account key following this guide: <a href="https://cloud.google.com/storage/docs/authentication#generating-a-private-key">Google Credentials</a>.
<ul>
<li> This should result in a JSON file being downloaded to your machine
<li> Transfer this file to your server, and store it in a secure place on your server
<li> Copy the path of this JSON file, and store the path in an environment variable called GOOGLE_APPLICATION_CREDENTIALS
</ul>
</li>
<li>Copy contents of application zip file to directory /var/www/html/cs499SupremeCourt/</li>
<li>Using SCDB.sql file contained in application files, import this into MySQL</li>
<li>Python Packages: The following need to be installed using the following command: pip3 install PACKAGE_NAME
<ul>newspaper3k</ul>
<ul>beautifulsoup4</ul>
<ul>google-cloud</ul>
<ul>pillow</ul>
<ul>newsapi-python</ul>
<ul>nltk</ul>
</li>
<li>For the application to perform language analysis, in python, one must import and download a specific library with the following statements:
<ul><li>import nltk</li>
<li>nltk.download("punkt")</li>
</ul>
</li>
<li>Automating script
<ol>
<li>Script is automated using crontab, which allows for the regular execution of shell commands.</li>
<li>The shell command we need to execute regularly is "python3 /var/www/html/cs499SupremeCourt/source/article_collector/article_collector.py"</li>
<li>To edit tasks completed regularly, we need to run command "crontab -e".This opens an editor that we can use to add a job.</li>
<li>In editor, add line: "* * 0 0 0 python3 /var/www/html/cs499SupremeCourt/source/article_collector/article_collector.py" and save. This runs the collector daily at midnight.</li>
<li>More information on how to edit the frequency of jobs can be found here: <a href="https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/">Crontab FAQ</a></li>
</ol>
</li>
<li>With the script automated, libraries installed, and files in the right place on the server, one should be able to access the site from http://yourDomainOrIP/cs499SupremeCourt/webapp/</li>
</ol>
<h2>AWS Installation</h2>
<ol><li>To install for our customers, we have decided to take advantage of AWS's Amazon Machine Image (AMI) feature that allows one to take a snapshot of a server and all of its files.</li>
<li>We have a private AMI saved of our application, and will be able to transfer this to the customers whenever we get their personal AWS accounts set up</li>
<li>For non technical clients, this requires a lot fewer steps than a whole LAMP installation.</li>
<li>The process for doing this with a shared AMI is described <a href="https://aws.amazon.com/premiumsupport/knowledge-center/launch-instance-custom-ami/">here</a> in detail.</li>
<li>The instance should be acessible from anywhere on port 80. This is configurable in the settings.</li>
</ol>
</div>
</body>
</html>