-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTechWithTimSteps.txt
73 lines (43 loc) · 1.47 KB
/
TechWithTimSteps.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
https://www.youtube.com/watch?v=YFBRVJPhDGY
**Procedure (refer to video for missing details)**
Step 1: Setup a server on linode
Step 2: Download Putty and SSH in
Step 3: Download and Install Apache
- sudo apt update
- sudo apt install apache2
- apache2 -version
Step 4: Configure Firewall
- sudo ufw app list
- sudo ufw allow ‘Apache’
Step 5: Configure apache
- sudo systemctl status apache 2
Step 6: Install and enable mod_wsgi
- sudo apt-get install libapache2-mod-wsgi python-dev
Step 7: Creating flask app
- cd /var/www
- sudo mkdir webApp
- cd webApp
Step 8: Install flask
- sudo apt-get install python-pip
- sudo pip install Flask
- sudo pip install flask_sqlalchemy
Step 9: Use winSCP to transfer python files to server
Step 10: configure and enable virtual host
- sudo nano /etc/apache2/sites-available/webApp.conf
CLICK TO DOWNLOAD THE CODE TO PUT IN webApp.conf
https://techwithtim.net/wp-content/up...
- sudo a2ensite webApp
- systemctl reload apache2
Step 11: Create .wsgi file
- sudo nano webapp.wsgi
Place the below code in the wsgi file
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/webApp/")
from webApp import app as application
application.secret_key = 'Add your secret key'
Step 12: Restart apache
- sudo service apache2 restart
Step 13: Visit the ip address of your server in the browser to access your website!