Home | Night at Museum Final | Progress Updates | Sponsor Objectives | Coding Plan | Deployment(Hosting Plan) |
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install maven
$ sudo apt-get install git
$ sudo git clone https://github.com/zenxha/musicgacha.git
$ cd musicgacha
$ sudo mvn package
$ sudo java -jar /home/ubuntu/musicgacha/target/coders-0.0.1-SNAPSHOT.jar
- run “localhost:8080” in your browser of choice, IF ON YOU’RE ON YOUR DEPLOYMENT DEVICE
Inbound Rules
- Type: HTTP
- Port Range: 80
- Source: 0.0.0.0/0
- Type: HTTPS
- Port Range: 443
- Source: 0.0.0.0/0
Outbound Rules
- Type: HTTP
- Port Range: 80
- Source: 0.0.0.0/0
- Type: HTTPS
- Port Range: 443
- Source: 0.0.0.0/0
$ sudo apt-get install nginx
$ sudo nano /etc/nginx/sites-available/musicgacha
server {
listen 80;
server_name musicgacha.cf;
location / {
proxy_pass http://localhost:8080;
}
}
Test nginx file configuration
$ sudo ln -s /etc/nginx/sites-available/musicgacha /etc/nginx/sites-enabled
$ sudo nginx -t
If no errors occur when “sudo nginx -t” is checked, continue
$ sudo systemctl restart nginx
sudo apt-get install snapd
sudo certbot --nginx
If the certificate expires after the 3 month certificate period, do
sudo certbot renew
“sudo nano” into new service file in /etc/systemd/system/musicgacha.service
[Unit]
Description=Java
After=network.target
[Service]
User=ubuntu
Restart=always
ExecStart=java -jar /home/ubuntu/musicgacha/target/coders-0.0.1-SNAPSHOT.jar
[Install]
WantedBy=multi-user.target
Run and enable service file for the project
$ sudo systemctl start musicgacha
$ sudo systemctl status musicgacha
If running the service file is successful, make the service file persistent on the machine(always running whenever the machine starts up and is on)
$ sudo systemctl enable musicgacha