You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: linode/deploy_on_linode.md
+38-8Lines changed: 38 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -203,7 +203,7 @@ At the moment, we are logged in as the root user, who has unlimited priviledges
203
203
- If you are not sure if your are in your home directory ornot, simply run the command `pwd`in the terminal. `pwd` stands for`print working directory`. Another way to find out if you are in your home directory is to look at your terminal. If you can see a tilde character (`~`), then you are in your home directory.
204
204
<br>
205
205
206
-
- __Moving to your other terminal window running your local machine__, run the following command:
206
+
- __Moving to my other terminal window running your local machine__, run the following command:
207
207
<br>
208
208
209
209
```python
@@ -284,9 +284,9 @@ At the moment, we are logged in as the root user, who has unlimited priviledges
284
284
285
285
### Firewall
286
286
287
-
-Set up a firewall to monitor and control incoming and outgoing network traffic based on predetermined security rules. For your information, a firewall creates a barrier between a trusted network and an untrusted network. An example of an untrusted network can be the internet.
287
+
-I need to set up a firewall to monitor and control incoming and outgoing network traffic based on predetermined security rules. For your information, a firewall creates a barrier between a trusted network and an untrusted network. An example of an untrusted network can be the internet.
288
288
<br>
289
-
- Install `uncomplicated firewall`:
289
+
- Install `ufw` also known as"uncomplicated firewall":
290
290
<br>
291
291
292
292
```python
@@ -297,29 +297,59 @@ At the moment, we are logged in as the root user, who has unlimited priviledges
- We want to configure these allow rules to allow forSSH, HTTPandany other port that we may want to access from the outside of our server. Begin by running the commands below. I have provided a brief explanation of what each command does.
306
319
<br>
307
320
```python
308
-
gitauharrison@bolderlearner:~$ sudo ufw allow ssh
321
+
gitauharrison@bolderlearner:~$ sudo ufw allow ssh
322
+
323
+
324
+
# Output
325
+
Rules updated
326
+
Rules updated (v6)
309
327
```
310
328
311
329
- This will allow me to SSH into my server, without which our firewall will prevent its use.
- This will allow me to access port 5000 which will be used by our flask development server. Using this port will enable me to test my application before going live on a production server.
319
343
<br>
320
344
321
345
```python
322
346
gitauharrison@bolderlearner:~$ sudo ufw enable
347
+
348
+
349
+
# Output
350
+
351
+
Command may disrupt existing ssh connections. Proceed with operation (y|n)?# type "y" for "yes"
352
+
Firewall is active and enabled on system startup
323
353
```
324
354
325
355
- The command above basically enables all that we have setfor our SSHand port 5000. When prompted, type"y" to activate and enable firewall on system startup.
@@ -350,7 +380,7 @@ There are two ways that I can get my flask application onto my linux server. The
350
380
351
381
I will use the second method to show you how you can transfer your application files to your server. Kindly note that the project on GitHub does not show the `.env`file which contains all the secret keys needed by our project. For this reason, make sure that you create that filein your root directory and add your keys following the `.env-template`fileas a guide. However, since the project is on my local machine, I don't have to worry about "missing" files. I can proceed to copy my entire project folder onto my server.
352
382
353
-
### Copy Project Root Folder to Server
383
+
### Copy Project Folder to New Linode Server
354
384
355
385
I will run the command below on the __terminal window of my local machine__:
356
386
<br>
@@ -374,7 +404,7 @@ gitauharrison@bolderlearner$ ls
374
404
# Output
375
405
376
406
somasoma-elearning-app
377
-
# I can check this folder's contents by running the command cd and ls
407
+
# I can check this folder's contents by running the commands cd and ls
378
408
```
379
409
380
410
### Create and Activate a Virtual Environment
@@ -575,7 +605,7 @@ server {
575
605
listen 80;
576
606
server_name 139.162.221.92;
577
607
location /static {
578
-
alias /home/gitauharrison/somasoma-eLearning-app/app/static/css;
608
+
alias /home/gitauharrison/somasoma-eLearning-app/app/static;
Really restart the remote supervisord process y/N?# Answer "y" for "yes"
829
859
# You should see "Restarted supervisord"
830
-
# Exit serpvisor prompt using "ctrl + c"
860
+
# Exit supervisor prompt using "ctrl + c"
831
861
```
832
862
833
863
If I exit my server (by pressing `ctrl + Z` or type "exit") on my terminal, I should still be able to access my application on http://139.162.221.92/. Sometimes it can take a while for the supervisor to start up that process.
Copy file name to clipboardExpand all lines: linode/secure_domain_with_ssl.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -277,6 +277,6 @@ Scroll to the bottom of the file and add the following line:
277
277
278
278
`/tmp/crontab.SYULN5/crontab`: Auto-renewal
279
279
```python
280
-
3041** sudo certbot renw--quiet
280
+
3041** sudo certbot renew--quiet
281
281
```
282
282
To save, I will press `ctrl + X`, type`y`and hit `enter`. This basically autorenews the certificate at 4.30 am on the 1st of every month. The `--quiet` option tells the program to notprint out any messages or feedback.
0 commit comments