Skip to content

Commit 7d1eb8a

Browse files
authored
Update server_setup_guide.sh
1 parent 1fdf7d6 commit 7d1eb8a

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

server_setup_guide.sh

+49-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,54 @@ docker run hello-world
3636

3737
#################################################################### STOP VIDEO 3
3838
#################################################################### START VIDEO 4 HERE
39+
40+
# Before getting started: Make sure that APACHE or on-VM NGINX aren't installed. Google cloud sometimes comes with apache installed by default.
41+
# Taken from: git clone https://github.com/geoace/certbot-nginx.git
42+
sudo systemctl stop apache2
43+
44+
sudo systemctl disable apache2
45+
46+
sudo apt remove --purge apache2 -y
47+
48+
sudo apt autoremove -y
49+
50+
#Git clone the repository
51+
git clone https://github.com/geoace/certbot-nginx.git
52+
53+
cd certbot-nginx
54+
55+
# make startup executable
56+
chmod +x start-nginx.sh
57+
58+
# Make conf directories
59+
mkdir conf
60+
61+
# Copy the env file
62+
cp .env.template .env
63+
64+
# Modify the environment variables to suit your deployment
65+
nano .env
66+
67+
docker compose up -d
68+
69+
# Visit the IP address of your virtual machine UNSECURED using HTTP and ensure your home page exists (e.g., http://niner.com)
70+
71+
# Once you've verified that you're up and running, then remove the containers
72+
docker rm $(docker ps -aq) -f
73+
74+
# Set up Domains between GCP and Registrar (Siteground is used in the video tutorial)
75+
# ONCE DNS Zones and Nameservers are linked between GCP and Siteground/registrar:
76+
77+
# Run docker compose to get the certificates
78+
docker compose up
79+
80+
# Exit the containers using Control + C, and then remove them (certificates have been received, but NGINX is still not running via SSL due to configuration file contents; certificates WILL persist)
81+
docker rm $(docker ps -aq) -f
82+
83+
# Run the docker containers
84+
docker compose up -d
85+
#################################################################### STOP VIDEO 4
86+
#################################################################### START VIDEO 5 HERE
3987
##### MERGIN MAPS.
4088
git clone https://github.com/MerginMaps/server.git
4189
mv server mergin
@@ -46,8 +94,7 @@ rm .prod.env
4694
# If using GMAIL account, then MAIL_PASSWORD should be generated at https://myaccount.google.com/apppasswords
4795
nano .prod.env
4896

49-
#################################################################### STOP VIDEO 4
50-
#################################################################### START VIDEO 5 HERE
97+
5198
rm nginx.conf
5299
nano nginx.conf
53100
# MODIFY AND PASTE CONTENT FROM https://github.com/geoace/mergin_tutorials/blob/main/nginx.conf

0 commit comments

Comments
 (0)