Following this tutorial in December of 2023 - The command at 8:30 did not work for me on Windowsx86 64bit. This command worked instead "sudo apt-get install libapache2-mod-wsgi-py3 python-dev-is-python3"
I've followed the series in this and learned quite a bit about flask. Just a quick note that if you are "root" you don't need to type sudo. A security tutorial would be great because there are many things that can be improved on this section. Otherwise, great work, great explanations!
Thanks @Tim. very helpful guide! however cmd: sudo apt-get install libapache2-mod-wsgi python-dev didnt work for me because of python3 I guess. so did cmd: sudo apt-get install libapache2-mod-wsgi-py3 instead and it did work. Thanks. you are the best
Tim, you're doing a great job! There is a lot of valuable/helpful content on this channel. Keep it up. Hint: -y when using apt-get install. But this is for experienced users who know they want to say YES to the prompt.
This series is great. One comment, at around 16:00, you mention that for nano the exit command for Macs can be Ctrl+X or Cmd+X, which isn't correct. You have to use Ctrl+X. Same with all nano commands, need to use Ctrl. I've learned a lot from your series! Keep it up.
A few tips from a Linux Engineer... - You're logged in as root, no need to use sudo (sudo = run as root). - Use tab completion when entering paths to avoid typos. - Ubuntu is pronounced "oo-boon-too". - Apache is pronounced "uh-patch-ee". - Set up public key authentication if you want to secure your Linux VM. Once it's working, disable root login with password.
Hi Tim, I'm so glad I came across with your channel I was looking for this for a couple of days with barely any success. Thank you very much you have my like!
In case you are facing the issue that the "Apache2 Debian Default Page" displays do: sudo a2dissite 000-default.conf to disable the default configuration for apache
thanks Tim, I have a secure apache home server and I've been struggling to get my django and flask apps running online. I will give it a shot with your configs!
I'm not sure what you're talking about but if you mean the contents of "/var/www/webApp/webApp" folder that's the flask app. this video was about running a flask app on Apache remember? so you need to have an app to run. that's the one.
@@mohammadfallah.rasoulnejad5379 In his past tutorials he didn't go over the __init__.py or setup.py files, just his main flask file so I was wondering about that part of the setup. This video is a part of a series he did as he mentions at the beginning of the video :)
Wow great series for a noob in the Python. Currently working with Akamai(formerly Linode) as you have referenced in this final great video. Why didn't you select the LAMP setup? Any particular reason? I set my stuff up using your recommendations, but a service ticket reply from Akamai asked if I knew they had it. Again, appreciate your help!
In the previous tutorials we had a file named 'main.py' in the root folder with __init__.py blank in the admin folder to make it a package. Where has this init file come from?
Hi Tim , I was following your flask tutorial , the last video where you host the side , is it valid for Django apps as well or is it limited for only flask apps?
Actually I did not get why you may need all these Apache sfuff. Flask can work as without. Just need to change the default port from 5000 to 80 and take care of all static files in your application (which Apache take care about usually).
Because "Do not use the development server when deploying to production. It is intended for use only during local development. It is not designed to be particularly secure, stable, or efficient."
I like what you are doing but id like to know the cli way all the way through. Copy Pasta in gui to get files on ur server is not as useful as knowing how to pull from git for instance. Anyways thanks for the vids, they are helpful. I have been digging youtube for weeks for good ubuntu server vids. Good ones are rare. Most I find are one off vids on how to install ubuntu server or terminal basics. I really hope you fill the niche. Ive only found two other playlists that get beyond basics helpful. But this is the only one ive seen touch flask. I managed to deploy a flask app to my server with gunicorn but dont know the diff between what I did n using apache. Or how to set up postgres locally on the server and connect to it. I guess I will just read what I need to know when the time comes but would much rather learn about it by watching a dope youtube lecture!!!
Hi Tim! Thanks for that video, that was very helpful, but I have one question. Must I create a folder called 'static' or not? If yes, what should I put inside of it? I have my Flask app, but I have only a 'template' folder and this is enough for me. Is it correct or should I reconfigure it somehow? Thanks for your help!
Tim, Do you have any videos on how to configure a linode server? I added the certificate from letsencrypt and browser works great, but mobile is being blocked. It has something to do with the IPV4 vs IPV6 connection. IPV6 is being blocked. Letsencrypt only has forums, and no one is giving an answer. Please help! Thank you,
I have been getting an Internal Server Error... the page instructs me to find more information about the error in the server error log, but I'm not sure how to access it so that I can see what needs to be fixed. Anybody have any tips?
Hi Tim. I have followed your video. However, I only see "Index of/ Name Last Modified Size Description" when I visit my IP Address in the browser. It is as though I do not have an html file, yet I know I have one. Please assist. Thanks for the awesome video.
I keep getting this error: "No supporting authentication methods available (server sent: publickey)" . Any ideas on why I'm getting this and how to fix it?
Hi Tech, my script give me problem with Flask Session. The server response with a PermissionError: Permission Denied "/flask_session". I've tried all but nothing
If you want to run from a virtual environment add to top of webapp.wsgi (from wsgi docs): import os import sys import logging # ensure venv is in same dir as 'webapp.wsgi' activate_this = os.path.dirname(__file__) + '/venv/bin/activate_this.py' with open(activate_this, 'r') as f: data = f.read() exec(data, {'__file__': activate_this})
so is anyone else not able to get the page to show html files from the template folder? it is running from the thml folder in the first webApp folder, even though i did everything exaclty the same as tim.
Hi, thanks for your video. It really helped me set it up in my 1st generation iPad air. However, I would like to set up openssh's SFTP. How can I do this?
Great tutorial - I ran into an issue on the winSCP part of moving files to the directory. Reason : lack of privileges and needing root. winSCP can inject a shell command at the point of connection under the Advanced setting within the session configuration. click Advanced then under the Environment > SCP/Shell option add the command to the shell: field in this case 'sudo su -' (this elevates the user id to root privileges at point of connection.)
@@muhie You have to go into WinSCP on the files u need to write in, click on them individual once, then look for the properties option near the top right(not all the way top right). After you hit that in the permissions section, make sure all the W boxes are check marked. This files leading to that file have to have the permission to write as well(webApp file if that’s what u called it).
Does anybody know if this will work if I deploy my flask app (which is a simple REST API to handle incoming POST requests only) using this method but then reference the server IP from my front end which is on a separate server? Meaning I have a single page html/JS page which enables an AJAX post request that successfully is handled by flask on a separate server? In practice I have it working putting my flask app on loaclhost port 5000 and my front end on port 5500. The only part that concerns me is how the templates folder is required, yet I won't be displaying any html from this server.
So, if we use Flask (Python), we will always need to have APACHE (which is manly to run PHP) to run Flask? Does not exist a server for Python, like Apache for PHP or Node for JavaScript??
The more common approach would be to use gunicorn as a webserver and nginx as a reverse proxy. Miguel Grinberg has a good guide on this in his Flask Mega Tutorial (Chapter 17).
Hey Tim, generally i enjoy your content but this is very dangerous since it seems you have not a lot of experience using Linux. Especially since this is targeted towards people setting up their first web server with most likely bad/insecure websites. -You are not showing how to properly set up the firewall (e.g. disallow all incoming connections besides ssh/http/https) -You are doing everything as the root user. This is a HUGE nono on Linux. I understand you want to help people get their stuff up and running but when we put resources out in the WWW we should at least have a minimum in terms of security.
Thanks for pointing that out! You are correct I do not use Linux frequently. The security is definitely an issue and the objective of this is to show people how to get very basic Hobby websites up that they can mess with themselves. I did not mean to imply that this would be ok to do for proper websites. I appreciate the feedback and will be more careful in the future!!
I really dislike how this guy tends to name multiple different files and folders the same name! How about webApp_server and webApp_root. That would be so much better and way less confusing. Then same was when he named the blueprints on another flask vid he has.
When typing the command: sudo apt-get install libapache2-mod-wsgi python-dev I get the following message: "Note, selecting 'python-dev-is-python2' instead of 'python-dev' Package libapache2-mod-wsgi is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source" Does it need to be: apt-get install libapache2-mod-wsgi-py3 ?
this is such an underrated channel
definetely..
more important than other people think
it is! fo sure.
It same with use hosting :)), so bad!
@Rizwan Mustafa Why?
Following this tutorial in December of 2023 - The command at 8:30 did not work for me on Windowsx86 64bit. This command worked instead "sudo apt-get install libapache2-mod-wsgi-py3 python-dev-is-python3"
Madman typing sudo while root. True sigma grindset.
I've followed the series in this and learned quite a bit about flask. Just a quick note that if you are "root" you don't need to type sudo. A security tutorial would be great because there are many things that can be improved on this section. Otherwise, great work, great explanations!
Thanks @Tim. very helpful guide! however cmd: sudo apt-get install libapache2-mod-wsgi python-dev didnt work for me because of python3 I guess. so did cmd: sudo apt-get install libapache2-mod-wsgi-py3 instead and it did work. Thanks. you are the best
Needed this, thank you
thanks
needed this as well
Ty
THIS was SO helpful. Thanks you! I have come back and referenced it, like, a hundred times!
The best simple and powerful tutorial I found yet for deploying flask in ubuntu. Thank you very much for sharing this.
Tim, you're doing a great job! There is a lot of valuable/helpful content on this channel. Keep it up.
Hint: -y when using apt-get install. But this is for experienced users who know they want to say YES to the prompt.
also he was already logged in as root
I can't wait to see what you've got for us next!
Nice username
Thnx Tim, these videos really helped me understand the setup of a Ubuntu server!
This series is great. One comment, at around 16:00, you mention that for nano the exit command for Macs can be Ctrl+X or Cmd+X, which isn't correct. You have to use Ctrl+X. Same with all nano commands, need to use Ctrl. I've learned a lot from your series! Keep it up.
Great stuff 👍, you just saved me bro for office project deployment
That was very pleasurable, thank you.
A few tips from a Linux Engineer...
- You're logged in as root, no need to use sudo (sudo = run as root).
- Use tab completion when entering paths to avoid typos.
- Ubuntu is pronounced "oo-boon-too".
- Apache is pronounced "uh-patch-ee".
- Set up public key authentication if you want to secure your Linux VM. Once it's working, disable root login with password.
Hi Tim,
I'm so glad I came across with your channel I was looking for this for a couple of days with barely any success.
Thank you very much you have my like!
This is the best Flask tutorial available on youtube.
Thanks Tim!!
Thank you, man! After going through sh**tton of articles, I made it to work with your video!
thanks for the tuto men !
you're better than most of my teatchers haha
Thanks tim for your video series . It is very helpful
In case you are facing the issue that the "Apache2 Debian Default Page" displays do:
sudo a2dissite 000-default.conf
to disable the default configuration for apache
thanks Tim, I have a secure apache home server and I've been struggling to get my django and flask apps running online. I will give it a shot with your configs!
> cannot import name app
Doesn't work, any tips?
I'm confused, where did the __init__.py files come from, where did the views folder come from, and is there a setup.py that's needed?
I'm not sure what you're talking about but if you mean the contents of "/var/www/webApp/webApp" folder that's the flask app. this video was about running a flask app on Apache remember? so you need to have an app to run. that's the one.
@@mohammadfallah.rasoulnejad5379 In his past tutorials he didn't go over the __init__.py or setup.py files, just his main flask file so I was wondering about that part of the setup. This video is a part of a series he did as he mentions at the beginning of the video :)
Did you manage to figure that up? I have the same problem
very detailed explain by example! specially the details about the mistakes that we might get ourselves into.
ty tim great content as always
Wow great series for a noob in the Python. Currently working with Akamai(formerly Linode) as you have referenced in this final great video.
Why didn't you select the LAMP setup? Any particular reason? I set my stuff up using your recommendations, but a service ticket reply from Akamai asked if I knew they had it.
Again, appreciate your help!
I have been thinking about it over a years :D Now I got ) Thanks
In the previous tutorials we had a file named 'main.py' in the root folder with __init__.py blank in the admin folder to make it a package. Where has this init file come from?
Thank you! Your tutorial is great!
Thank's Sheldon Cooper.
fantastic tutorial!!
I want to kiss you computer server man, you have helped me greatly, keep up the helpful videos!
I’ll take likes instead ;)
Amazing playlist, thank you Tim. I hope to see the update version - Or comments about what has changed. Thank you very much.
this case python base on run 2.7.5
pls how to run python 3.6 base on
in your webapp.wsgi file, change the top line from #!/usr/bin/python to #!/usr/bin/python3 (given that you have python3 installed on your server.
Linode is one of America’s greatest companies IMO
Very cool man!!
Really helpfull man, thanks!
Great tuto !! Thanks
THANK YOU SO MUCH!!!! 🐐
Hi Tim , I was following your flask tutorial , the last video where you host the side , is it valid for Django apps as well or is it limited for only flask apps?
Could you recommend any tutorial for setting up the custom domain?
Actually I did not get why you may need all these Apache sfuff.
Flask can work as without. Just need to change the default port from 5000 to 80 and take care of all static files in your application (which Apache take care about usually).
Because "Do not use the development server when deploying to production. It is intended for use only during local development. It is not designed to be particularly secure, stable, or efficient."
video description:
step 5:
err:
sudo systemctl status apache 2 -> sudo systemctl status apache2
Awesome! Thanks.
Thanks!
Thank you so much!
I like what you are doing but id like to know the cli way all the way through. Copy Pasta in gui to get files on ur server is not as useful as knowing how to pull from git for instance. Anyways thanks for the vids, they are helpful.
I have been digging youtube for weeks for good ubuntu server vids. Good ones are rare. Most I find are one off vids on how to install ubuntu server or terminal basics. I really hope you fill the niche. Ive only found two other playlists that get beyond basics helpful. But this is the only one ive seen touch flask.
I managed to deploy a flask app to my server with gunicorn but dont know the diff between what I did n using apache. Or how to set up postgres locally on the server and connect to it. I guess I will just read what I need to know when the time comes but would much rather learn about it by watching a dope youtube lecture!!!
TIM UR A REAL G 4 LIFGE
00:00
Hello people. (lol)
I don't know what Linux is, but I'll watch this video!
Thank you!
Please a crud tutorial in Django ✌️
For anyone else getting the error:
E: Unable to locate package python-pip
-
try doing:
sudo apt-get install python3-pip
anyone else getting a 500 Internal Service Error?
Hi Tim!
Thanks for that video, that was very helpful, but I have one question. Must I create a folder called 'static' or not? If yes, what should I put inside of it? I have my Flask app, but I have only a 'template' folder and this is enough for me. Is it correct or should I reconfigure it somehow?
Thanks for your help!
static is for stuff like css and images
Tim, Can you also tell us how to deploy using docker containers - Flask app + DB and deploy on Cloud if possible
What if we need to run more than one app on a server and/or on different ports? Thanks!
PLEASE HELP ME!!!
I follow all the steps but at the end I see the apache2 page and not my flask application
sudo a2dissite 000-default.conf
to disable the default configuration for apache
i think linode changed. apache error says "no module named flask" which is a python2 error
Please make a video on flask-sijax. I actually understand your tutorial and I am having a problem with understanding sijax.
Thank you!!!
Can you create a short video or a blog post about how to deploy with a virtualenv on apache with concreate examples?
how do you change ip address to domain name?
+
That's very very nice since I am a Linux user...
Tim,
Do you have any videos on how to configure a linode server? I added the certificate from letsencrypt and browser works great, but mobile is being blocked. It has something to do with the IPV4 vs IPV6 connection. IPV6 is being blocked. Letsencrypt only has forums, and no one is giving an answer. Please help!
Thank you,
Hi, great video. Thank you very much! Does this also work for Dash (Plotly Dash) Apps? Dash is based on Flask.
I have been getting an Internal Server Error... the page instructs me to find more information about the error in the server error log, but I'm not sure how to access it so that I can see what needs to be fixed. Anybody have any tips?
u found any fix ?
Great video... If I have a flask rest api, Can I use the same deploy process?
big thanks for you..
Thank you.
Why do you use Putty instead of just sshing in through command prompt?
I had hosted my site using this Apache but I am getting Hello World program instead of my actual web site ... Could you help me ?
Hi Tim. I have followed your video. However, I only see "Index of/ Name Last Modified Size Description" when I visit my IP Address in the browser. It is as though I do not have an html file, yet I know I have one. Please assist. Thanks for the awesome video.
did you figure this out? I have the same issue.
I keep getting this error: "No supporting authentication methods available (server sent: publickey)" . Any ideas on why I'm getting this and how to fix it?
on advanced add ur private key
Hi Tech, my script give me problem with Flask Session. The server response with a PermissionError: Permission Denied "/flask_session". I've tried all but nothing
sudo is not necessary if you work under superuser, isn't?
It's a lot better and easier to do it with Heroku but anyway a very good video like always
If you want to run from a virtual environment add to top of webapp.wsgi (from wsgi docs):
import os
import sys
import logging
# ensure venv is in same dir as 'webapp.wsgi'
activate_this = os.path.dirname(__file__) + '/venv/bin/activate_this.py'
with open(activate_this, 'r') as f:
data = f.read()
exec(data, {'__file__': activate_this})
so is anyone else not able to get the page to show html files from the template folder? it is running from the thml folder in the first webApp folder, even though i did everything exaclty the same as tim.
Is this get all dependencies of your app?
Hi, thanks for your video. It really helped me set it up in my 1st generation iPad air. However, I would like to set up openssh's SFTP. How can I do this?
why when I try to write my sqlite3 database it says "attempt to write a readonly database"?
I'm unfortunately getting an Internal Server Error when deploying to an Ubuntu server on AWS (EC2).
Great tutorial either way, keep it up!
I also got this error on an RaspberryPi 3 b...
I have an homeserver but just have the local IP, how can i get the right Ip ? because it wont work with the local ip
Great tutorial - I ran into an issue on the winSCP part of moving files to the directory.
Reason : lack of privileges and needing root.
winSCP can inject a shell command at the point of connection under the Advanced setting within the session configuration.
click Advanced then under the Environment > SCP/Shell option add the command to the shell: field in this case 'sudo su -'
(this elevates the user id to root privileges at point of connection.)
i cant get the sql data base to work when its deployed it works on host but not on the server
@@braydenuber3603 yes i can read the database but not write to it, do you have the same issue/do you have a fix
@@muhie You have to go into WinSCP on the files u need to write in, click on them individual once, then look for the properties option near the top right(not all the way top right). After you hit that in the permissions section, make sure all the W boxes are check marked. This files leading to that file have to have the permission to write as well(webApp file if that’s what u called it).
@@WireNut88 do you have to modify any of the wsgi file
@@WireNut88it works now thank you!!!!!
is this will work in machine learning to deploy it like this?
Does anybody know if this will work if I deploy my flask app (which is a simple REST API to handle incoming POST requests only) using this method but then reference the server IP from my front end which is on a separate server?
Meaning I have a single page html/JS page which enables an AJAX post request that successfully is handled by flask on a separate server? In practice I have it working putting my flask app on loaclhost port 5000 and my front end on port 5500. The only part that concerns me is how the templates folder is required, yet I won't be displaying any html from this server.
Can I do everything same on own Ubuntu when I've static IP?
How to handle multithreading in flask app on production server?
Now I've fixed it, but Flask SQLAlchemy fails to open my database file because it doesn't have permission.
Does anyone know what I am supposed to do?
So, if we use Flask (Python), we will always need to have APACHE (which is manly to run PHP) to run Flask? Does not exist a server for Python, like Apache for PHP or Node for JavaScript??
The more common approach would be to use gunicorn as a webserver and nginx as a reverse proxy. Miguel Grinberg has a good guide on this in his Flask Mega Tutorial (Chapter 17).
very nice
Hey Tim, generally i enjoy your content but this is very dangerous since it seems you have not a lot of experience using Linux. Especially since this is targeted towards people setting up their first web server with most likely bad/insecure websites.
-You are not showing how to properly set up the firewall (e.g. disallow all incoming connections besides ssh/http/https)
-You are doing everything as the root user. This is a HUGE nono on Linux.
I understand you want to help people get their stuff up and running but when we put resources out in the WWW we should at least have a minimum in terms of security.
Thanks for pointing that out! You are correct I do not use Linux frequently. The security is definitely an issue and the objective of this is to show people how to get very basic Hobby websites up that they can mess with themselves. I did not mean to imply that this would be ok to do for proper websites. I appreciate the feedback and will be more careful in the future!!
can you tell me where I can find tutorials to do that?
ya lo tengo desplegado pero no me muestra la pagina cuando me redirecciona\
error
Not Found
The requested URL was not found on this server.
I really dislike how this guy tends to name multiple different files and folders the same name! How about webApp_server and webApp_root. That would be so much better and way less confusing. Then same was when he named the blueprints on another flask vid he has.
i did the exact same steps until the end i got a 500 error
Hello sir, can you teach us
how to build API using neo4j...
Hi... Please tell me, how to do deploy flask web application in windows IIS... please help me on this... You help is highly appreciated 🙏😊❤
Now how can I see that website you made?
When typing the command:
sudo apt-get install libapache2-mod-wsgi python-dev
I get the following message:
"Note, selecting 'python-dev-is-python2' instead of 'python-dev'
Package libapache2-mod-wsgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source"
Does it need to be:
apt-get install libapache2-mod-wsgi-py3
?
did you find out the answer to this because i have this problem to ?
@@thomaseardley2900 i think I eventually put in the command i wrote below and it worked
hello...can you give me a video to how i can change the ip to my domain name !!