forked from whatsopdahl/apc_interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSERVER.txt
71 lines (51 loc) · 2.84 KB
/
SERVER.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
LutherCourseProposal is hosted at https://apc-2017-cs.luther.edu. The following is a list of instructions to update/ manage this server.
========================================================
Server specifics
========================================================
Luther Course Proposal runs on an apache-tomcat (verson 8.5.12) web server which interfaces with a mongodb database. On the host server (apc-2017-cs.luther.edu), there apache2 is also installed. This cannot be running in order for the webserver to run. So, we include instructions to start and stop this server, the tomcat server, and the mongod daemon.
========================================================
Running mongod
========================================================
For the application to work, mongod must be running. If this process stops, as is the case if the server shuts down/ restarts, you must run this command to start it again:
sudo systemctl start mongod
To stop mongod, run
sudo systemctl stop mongod
=======================================================
Starting and Stopping apache2
=======================================================
Apache2 will take up the ports tomcat needs to run if it is running.
To stop apache2, run this command:
sudo service apache2 stop
To Start apache2, run this:
sudo service apache2 start
=======================================================
Starting/Stopping Tomcat
=======================================================
The tomcat server is installed at /opt/apache-tomcat-8.5.12. To stop and start it, you must invoke the startup and shutdown scripts in the bin folder. Remember to execute these as sudo.
So, in /opt/apache-tomcat-8.5.12/bin folder, run
sudo ./startup.sh
or
sudo ./shutdown.sh
========================================================
Updating the application
========================================================
1. locally package the .war file using netbeans
2. scp the new .war file into your home directory on apc-2017-cs.luther.edu
- scp apc_interface/target/ROOT.war <your user>@apc-2017-cs.luther.edu:~
3. ssh into apc-2017-cs.luther.edu
4. if not done already, stop the tomcat server (See above)
5. navigate to the tomcat installation (see above section)
6. cd into the webapps folder (/opt/apache-tomcat-8.5.12/webapps)
7. remove the previod ROOT directory and the ROOT.war file with the following commands
- sudo rm -r ROOT
- sudo rm ROOT.war
8. copy the new war file into the webapps folder
- sudo cp ~/ROOT.war .
9. start the tomcat server
=======================================================
Manually updating database (for error purposes)
=======================================================
If for some reason, the database becomes unstable, you may need to try and restore a stable state. To do this, try
sudo mongod --repair
To connect to the database via terminal, use
sudo mongo apcdata