forked from whatsopdahl/apc_interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSETUP.txt
109 lines (72 loc) · 5.61 KB
/
SETUP.txt
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
################################################################################
Instructions for project setup
################################################################################
The LutherCourseProposal project structure is designed for use with NetBeans IDE. The following instructions detail how to set up the development environment using the NetBeans IDE.
This setup file describes how to set up your environment to run the project either through NetBeans, or by deploying the war file directly to the Tomcat server.
================================================================================
INSTALLING MONGODB
To run the project, you need to install mongodb. Follow the instructions at https://www.mongodb.com/download-center to install the community edition of MongoDB.
================================================================================
STARTING MONGO SERVICE
To allow the database to run, you first need to start the mongod service. Run the command
sudo service mongod start
If this doesn't work, run
sudo systemctl start mongod
================================================================================
INITIALIZING DATABASE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Getting a data dump from the registrar +
+ If you get a data dump from the registrar, you should put the csv file in the +
+ src/main/webapp/bin directory then run the csvToJson.py python file to +
+ generate the json data used in the population script. Otherwise, you will use +
+ the old data we have already parsed in the project. +
+ +
+ NOTE : This will delete all the current courses in the database. If you wish +
+ to keep certain courses and merge data, a custom script will have to be +
+ written and used. +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
To initialize an empty database, in your repo directory, navigate to src/main/webapp/bin folder and run
./populate_db.sh
If you wish to have some mock data (if it is a test db), run
./populate_mock_db.sh
These will intialize the database for you so you're ready to go!
================================================================================
INSTALLING PROJECT IN NETBEANS
1. Clone git repo into desired location on local machine (recommened is NetBeansProjects folder)
- git clone https://github.com/whatsopdahl/whatsopdahl.github.io.git
2. Click 'File' -> 'Open Project' and select the root project directory
================================================================================
RUNNING WITH NETBEANS
1. Ensure you have Java8 or higher JRE installed.
- the project was developed using Java 8. If you use a different version, you may run into errors.
2. Download and install the Apache Tomcat 8.5.12 server. Follow the given instructions to complete the install. You can download the binary source code here:
- http://tomcat.apache.org/download-80.cgi#8.5.12
- download the tar.gz
- open an terminal window and navigate to the directory you want to install the tomcat server in
- extract the server from the zip file:
>> tar -xf <tomcat zip file>
- set your CATALINA_HOME environment variable in your .profile or .bashrc to point to your tomcat installation root folder: this will default to the apache-tomcat-8.5.12 in the directory where you unzipped the tar file
3. After you have set up your tomcat server, open the ${CATALINA_HOME}/conf/tomcat-users.xml file. In this file, make sure you include the following:
<role rolename="manager-script"/>
<user username="<your username of choice>" password="<your password>" roles="manager-script"/>
These entries allow you to run the application from NetBeans, a highly recommended feature. Without these entries, you will need to manually deploy the application everytime you build a new .war file.
4. Once you have added your user, you can add the server to your NetBeans installation.
i. Open NetBeans
ii. Click on Tools > Servers in the top menu bar
iii.Click "Add Server"
iv. Select "Apache Tomcat or TomEE" and click next
v. Enter the location of you tomcat installation and the username and password of the user you created in the tomcat-users.xml file
vi. Click finish to add the server
5. Next, in a terminal window, navigate to the directory that houses the local repository for the remote repo
- if you do not have a local copy, make a git repo, getting the url from here: https://github.com/whatsopdahl/apc_interface
6. Pull the changes from the repository
7. You will now have all the necessary components to run the application via NetBeans, or by manually deploying the latest war in the /target/ directoryto your tomcat server. To see how this is done, move on to the next section.
8. Go to the NetBeans "File" menu, selecting the "Open Project..." option
9. Go to the directory where your repo is located, select it and click ok
10. This should add the project to your IDE.
11. To run the project, right click on the project name, and click "run". The webpage should pop up in your default browser and you're good to go!
================================================================================
DEPLOYING THE WAR FILE MANUALLY
1. Copy the .war file from the target/ directory and place it in the ${CATALINA_HOME}/webapps directory
2. run ${CATALINA_HOME}/bin/startup.sh to start the tomcat server
3. Navigate to http://localhost:8080/LutherCourseProposal to use the application.