Тёмный

Flask app behind Apache on your Raspberry Pi + Another Pi giveaway 

Nazmus Nasir
Подписаться 10 тыс.
Просмотров 11 тыс.
50% 1

Welcome to another Raspberry Pi tutorial and another giveaway!
Update: venv removed activate_this.py for some reason, you can still get it here:
wget raw.githubuser...
In today's tutorial, we will learn how to run a flask app behind Apache. Although there ways to bypass CORS restrictions on both the browser side and server-side, I think it's worth knowing how to run your back end and front end from the same origin.
Please also see the following link at EasyProgramming.net for more information on the project itself: www.easyprogra...
The next video will be my 10th Raspberry Pi tutorial, and to celebrate, I will give away at least 2 Raspberry Pi Zero Ws! I will try to get my hands on a third. This is the fourth giveaway and I will do more so make sure you subscribe for updates!
Entry rules:
1. Must be from the continental United States (sorry, I will try to open it up internationally in a future giveaway).
2. Comment anywhere in this video or on the video posted on EasyProgramming.net - unlike the first giveaway, I want to hear a little more about what you want to do with the Pi. Do you have a project in mind? Do you just want to learn?
3. Optional: Mention what state you are from.
4. I will stop taking entries on May 30, 2019 11:59:59 PM EST
5. That's all!
Have questions? Ask below or on EasyProgramming.net!
#RaspberryPi #Flask #Apache
-----------
Visit my website: www.easyprogra...
Subscribe on RU-vid: / nazmusnasir
Support me on Patreon: / nazmus
Follow me on Twitter: / nazteroid
Like me on Facebook: / easyprogrammingnet
Check out my Github: github.com/naz...

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 94   
@qzorn4440
@qzorn4440 4 года назад
the greatest thing for the diy pi's is all the support, things move-on so fast thanks nice video :) ps i have several pis they are cheap
@naztronaut
@naztronaut 4 года назад
Agreed, that's why I love open source products! Even if there's no company behind it, there's always a great community.
@albanasinia9
@albanasinia9 5 лет назад
This video just popped up on my recommended list. I've been watching coding and how to program the pi videos. I am going to go back and watch the previous videos. Sometimes you learn something that opens up a lot more avenues of thinking and I've gotten a few ideas from this. Keep up the good work.
@naztronaut
@naztronaut 5 лет назад
Thanks :) I agree, watching something can open up a lot of possibilities, I feel the same way and hope that sharing my experience will help others.
@phillip4833
@phillip4833 4 года назад
Thank you for taking the time to post these tutorials
@naztronaut
@naztronaut 4 года назад
Happy to :)
@phillip4833
@phillip4833 4 года назад
@@naztronaut Do I have to use a virtual environment to run Flask this way on Apache? If not what changes about the piapp.config file?
@naztronaut
@naztronaut 4 года назад
@@phillip4833 You don't have to use a virtual environment. It's just recommended to keep things contained. Makes deploying multiple apps much easier. If you don't want to use a venv and want to do everything in your global Python, then the piapp.conf shouldn't change, but your piapp.wsgi should. You just have to get rid of the files about "activate_this.py" so the file should just have this: import sys sys.path.insert(0, '/var/www/piapp') from piapp import app as application Apache still needs something but WSGI doesn't need to be it. Check out the official Flask docs, it goes over other deployment options: flask.palletsprojects.com/en/1.1.x/deploying/ Good luck!
@stonynotdusty
@stonynotdusty 3 года назад
Thank you for creating this. Exactly what I was looking for.
@naztronaut
@naztronaut 3 года назад
Glad this was helpful!
@TheRhysBenj
@TheRhysBenj 4 года назад
Hi, great video but the link to activate_this from pypa seems to be broken or old. I am trying to find it on github without success. Could you please advise? Thank you
@naztronaut
@naztronaut 4 года назад
For some reason they removed it. I updated the written tutorial with a new link in my repo: www.easyprogramming.net/raspberrypi/pi_flask_apache.php The file itself is located here: raw.githubusercontent.com/naztronaut/RaspberryPi-RGBW-Control/master/utils/activate_this.py Can't change the info in the video though :(
@TheRhysBenj
@TheRhysBenj 4 года назад
@@naztronaut Wow thank you for the amazingly quick response. I will continue to work through your tutorial now. I am new to both Linux and Python, so it has been a steep learning curve for me but I am struggling along. Great tutorials like yours are making my life so much easier.
@naztronaut
@naztronaut 4 года назад
@@TheRhysBenj I've been there! It gets easier the more you do it, so keep it up. Take it slow and learn one thing at a time and then start to connect them. And if you have questions, I'm usually responsive in my videos and on EasyProgramming.net. Best of luck learning!
@larspreussheglund1834
@larspreussheglund1834 4 года назад
hi... it seems the activate_this.py is no long in the location above?
@naztronaut
@naztronaut 4 года назад
For some reason they removed it. I added a copy to my repos, you can use this command to get it: wget raw.githubusercontent.com/naztronaut/RaspberryPi-RGBW-Control/master/utils/activate_this.py I also updated the written tutorial here to reflect that: www.easyprogramming.net/raspberrypi/pi_flask_apache.php
@larspreussheglund1834
@larspreussheglund1834 4 года назад
@@naztronaut Great... thanks for a very quick responds
@fernandocani
@fernandocani 5 месяцев назад
@@naztronaut maybe add this information in the video description. so how ever get's here now have the updated information right away.
@naztronaut
@naztronaut 5 месяцев назад
@@fernandocani Good idea, just added it.
@ishcabittle
@ishcabittle 5 лет назад
I've been wanting a Zero for a Altoids tin portable gaming build, but I just haven't gotten off my duff and just started. Maybe this will be the kick in the pants i need?
@naztronaut
@naztronaut 5 лет назад
I hope so! Good luck!
@cem_kaya
@cem_kaya 4 года назад
dude thanks this video helped know i know what to learn
@naztronaut
@naztronaut 4 года назад
Glad it was helpful :)
@JoeyTaraCollard
@JoeyTaraCollard 3 года назад
is there an upload without the background music?
@naztronaut
@naztronaut 3 года назад
There's a written tutorial here: www.easyprogramming.net/raspberrypi/pi_flask_apache.php
@ujjaldas9179
@ujjaldas9179 3 года назад
Really Helpful. Thanks
@qual1481
@qual1481 Год назад
Would this make my flask app available to anyone with the link? Even outside of my local network. Thanks
@naztronaut
@naztronaut Год назад
No, it's only available internally. You CAN make it available to the internet but I would not recommend doing that because it'll open up your entire network to hackers. If you need to access this from the outside, look into installing PiVPN. I have a video on that as well.
@robertthurman8412
@robertthurman8412 4 года назад
Hey again, thanks for the video. I've been trying to understand the relationship between Flask and Apache and how to get them to communicate with each other. I'm trying to make a Dash Plotly dash board and this was essentially the only thing I needed to figure out. So, where did you get this information? It must be written on a site somewhere, right? I've seen other sites try to explain Dash with flask and apache and they get it working but don't explain it enough. I was wondering if you'd do a Dash apache and flask vid?
@naztronaut
@naztronaut 4 года назад
Hi Robert, Most of this information is from the Flask documentation here: flask.palletsprojects.com/en/1.1.x/ And the thing about deploying flask to Apache specifically is here: flask.palletsprojects.com/en/1.1.x/deploying/mod_wsgi/ And of course, I get a ton of information from the official Apache docs here: httpd.apache.org/docs/ I have previous experience managing a web hosting company where we used Apache as our main Web Server, so I usually combine my own experiences with official documentation. My tutorials are usually a mix of knowledge and I try to stick to official documentation as much as possible and I try to create my own step-by-step guide that may help others: www.easyprogramming.net/raspberrypi/pi_flask_apache.php As for Dash on Apache, I will look into it and see what I can do. I added that topic to my backlog. I don't have any experience with Dash/Plotly so I'll start at square zero and go from there :)
@robertthurman8412
@robertthurman8412 4 года назад
@@naztronaut I'm having an issue with running the site after I install the *.wsgi file. When I run the example using flask run --host-0.0.0.0 it works just fine but creating the piapp.wsgi file and then querying in a browser causes "Internal Server Error." I was wondering if you know what type of errors should I look for on my end? Could it be the *.conf file?
@robertthurman8412
@robertthurman8412 4 года назад
Hello Nazmus... never mind I found it. A mistake in the *.conf file
@naztronaut
@naztronaut 4 года назад
@@robertthurman8412 Awesome! Glad you were able to figure it out. When the app works directly but doesn't through Apache, it's usually a configuration issue 99% of the time. Looking at the Apache error logs would give you more information. For most Debian systems, it should be in /var/log/apache2/error.log.
@annikat.2244
@annikat.2244 4 года назад
Hey, I got a problem with this tutorial this time and seem to not be able figuring it out by myself. When I restart apache (~minute 9:40), I get this: 'Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.' I tried using the other code called for in 'ativate_this.py' like this: ... with open(activate_this) as file_: exec(open(this__file).read(), {'__file__':this_file})). import os import site import sys sys.path.insert(0, '/var/www/piapp') from piapp import app as application try: __file__ except NameError: raise AssertionError('...') i clearly just tried out a bunch of stuff without really knowing what I'm doing, but whatever^^ and yes, I checked spelling and naming and stuff. Hope you know what my problem might be or how to find that out. Have a nice day
@naztronaut
@naztronaut 4 года назад
You're importing "os" and "site" but aren't using them anywhere. Have you also declared "activate_this" at the top? Check out that piece of the code at www.easyprogramming.net/raspberrypi/pi_flask_apache.php and try it exactly as-is and see if it works.
@djtyros
@djtyros 3 года назад
@@naztronaut I have the same issue as described above. I am indeed using "activate_this = '/var/www/piapp/venv/bin/activate_this.py'" in piapp.wsgi. I've tried a few different things, and followed both the video, and checking against the web guide too. One other thing to note... I checked "nano /var/log/apache2/error.log" and found many errors saying that Flask isnt installed! So I ran "pip install flask" in both the venv and normal, just to make sure.. And still the flask import line is throwing an error. Any advice on this? Thanks
@naztronaut
@naztronaut 3 года назад
@@djtyros Is your activate_this.py file path correct in piapp.wsgi? And is Apache config pointing to the correct piapp.wsgi file? What you're seeing typically happens if there's some issue with a path declaration somewhere. Can you run Flask manually? If you have your files somewhere in GitHub, I can take a look at them.
@djtyros
@djtyros 3 года назад
@@naztronaut Hi, thank you for such a fast reply. I believe my file paths are ok, and I did get the activate_this.py in the correct place. I can confirm everything works ONLY if I'm running flask myself at the command line. I'm new to using venvs, and only just about able to wrap my head around it. I don't know how to use git hub properly lol. But I'm totally ok with you looking at my setup if you'd like? I feel like I'm so close to success? Feel free to tell me what I should do to get you the information needed to diagnose what's gone wrong. ...thanks again for such a prompt reply.
@naztronaut
@naztronaut 3 года назад
@@djtyros If it works without Apache then it's most definitely the configuration. It's either usually the path in the .wsgi file is wrong, the apache.conf is wrong, or the file names don't match, etc. If you don't use GitHub, you can paste the contents of your files in the comments section of the website: www.easyprogramming.net/raspberrypi/pi_flask_apache.php If you provide your .wsgi file and the apache configuration that you used, as well as the path of your flask app, I can take a look. And also paste the exact error codes from your error.log file and what command you are using to run Flask via command line.
@goranjosic
@goranjosic 3 года назад
This is great! Helpful!
@naztronaut
@naztronaut 3 года назад
Thank you :)
@sagevibe
@sagevibe 5 лет назад
Hello from California! I’m always following these videos, hope to maybe get one!
@naztronaut
@naztronaut 5 лет назад
Thanks for entering! Good luck, Sage!
@naztronaut
@naztronaut 5 лет назад
Congrats, you won the Giveaway! Winners are posted here: www.easyprogramming.net/raspberrypi/browser_control_led.php Can you email me your address at admin@easyprogramming.net. I'll ask you for some verification before shipping the Pi. Congrats!
@sagevibe
@sagevibe 5 лет назад
Awesome! I'll send you my info!
@sagevibe
@sagevibe 5 лет назад
Just sent it.
@sagevibe
@sagevibe 5 лет назад
EasyProgramming10
@noahliu684
@noahliu684 2 года назад
Thanks, it works!
@schlingelgen
@schlingelgen 4 года назад
My Apache Server needs to start a flask app which needs to get invoked with sudo, otherwise it throws errors. (With sudo everything works perfectly fine). How can i tell apache sudo the flask run?
@naztronaut
@naztronaut 4 года назад
Hi Jan, Are you seeing an error somewhere? If your flask app is in /var/www/, apache should have access to run things there without anything special (Unless all the files are owned by root or something). What you can do is change the ownership of all of the files in that directory to www-data. First go into the /var/www/ directory then run: sudo chown -R www-data:www-data /piapp Change "/piapp" to either "/www" or where ever your flask app is deployed. Good luck! Let me know if that doesn't work.
@schlingelgen
@schlingelgen 4 года назад
@@naztronaut thanks, im trying that asap
@marc_2_264
@marc_2_264 3 года назад
Hello there, I am from Germany and I tried your tutorial for a project for university. First of all, thank you for the tutorial, everything worked fine and i could manage to let the "hello" flask application run from apache with the " /piapp" in the url line. Anyway I got a question and i hope you may got an idea, how to solve my problem. I wanted to do the same thing you showed off in the video, just with another python application, written with flask. I copied all the necessary files to the position where the piapp.py file was laying before and changed the necessary linkings in the wsgi file so that it should refer to my file. (Later on I even tried to change the name of my file to piapp.py, so that I can be sure to not messed up the renaming in the wsgi or forgot it anywhere else... But it did not worked out either) My python file works if I run it in the environment and use the :5000 url . But if I try to access it with the apache server and the /piapp url, I get the error "Internal server error....", Another viewer posted here before. (That's why I assumed, that I may have messed something up with the configuration of the wsgi file while renaming ) I tried my own researches and did the whole tutorial again and again until I found out, that I wrote my python application in python3.9, But my raspberry pi only got python 3.7 installed (I installed python 3.9 only in the environment until there) Furthermore I looked up the error log Files from apache and it said me,that it can't find some modules that I installed in the environment for sure. I also found out in the error logs, that the apache server and especially ( I believe) the mod_wsgi runs on python 3.7 . I think that's the point, why my flask application is not able to run from the apache server, because he can't find the necessary modules, because he ist referring to a wrong python Version I did not installed the modules on. So what I want to do now, and where It comes to my question, is to update apache so that it uses python 3.9. But I just don't know how to set it up, so that it refers to the right python version. Is it possible to update the version that apache is using, so that it runs my flask application on python 3.9 and i can install the necessary modules in there ? I hope u understood the point of my question and may be able to help me out! Addition : I need python 3.9 for my application, so I can't just run my application in python 3.7 and just install the necessary modules in there.
@naztronaut
@naztronaut 3 года назад
Hi Marc, thanks for the kind words and I'm glad this tutorial was useful for you! And I'm really glad to hear that you were able to expand this into your own project! Did you install mod_wsgi before installing Python 3.9? If you did, I wonder if a previous version is installed and it's not compatible. You could try a few things to troubleshoot because as far as I know, mod_wsgi should work with Python 3.9. First disable the mod: sudo a2dismod mod_wsgi Then reenable" sudo a2enmod mod_wsgi That *may* force the module to update. If it's not as simple as that, then you can try to update it manually. Mod_wsgi has a quick install guide here: modwsgi.readthedocs.io/en/master/user-guides/quick-installation-guide.html That walks you through how to grab the latest mod-wsgi files and install it manually. Let me know if these don't work. I'm sure we'll find a solution, it's always usually something simple.
@jackburgdoerfer5955
@jackburgdoerfer5955 4 года назад
Hello, I appreciate the very helpful walk through. I made it to about 5:45 before encountering an error. When typing in "apachectl configtest" I get this " AH00543: apache2: bad user name user1 Action 'configtest' failed. The Apache error log may have more information." I enabled the .conf file, and this is what I put in it: " ServerName 119 WSGIDaemonProcess Automa user=user1 group=group1 threads=5 WSGIScriptAlias /Automa /var/www/Automa/Automa.wsgi WSGIProcessGroup Automa WSGIApplicationGroup %{GLOBAL} Require all grated " When servicing the apache2 server I get this: " ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: Active: failed (Result: exit-code) since Fri 2020-08-21 16:09:59 EDT; 13s ago Docs: httpd.apache.org/docs/2.4/ Process: 7473 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILU Aug 21 16:09:59 raspberrypi systemd[1]: Starting The Apache HTTP Server... Aug 21 16:09:59 raspberrypi apachectl[7473]: AH00543: apache2: bad user name use Aug 21 16:09:59 raspberrypi apachectl[7473]: Action 'start' failed. Aug 21 16:09:59 raspberrypi apachectl[7473]: The Apache error log may have more Aug 21 16:09:59 raspberrypi systemd[1]: apache2.service: Control process exited, Aug 21 16:09:59 raspberrypi systemd[1]: apache2.service: Failed with result 'exi Aug 21 16:09:59 raspberrypi systemd[1]: Failed to start The Apache HTTP Server." Thanks!
@naztronaut
@naztronaut 4 года назад
Hi Jack! You're using 'user1' and 'group1' in the user/group sections. Do those exist on the Pi? If not, you should switch the user to 'pi' and the group to 'www-data'. If they do exist then you need to give them their appropriate permissions. Check out the written tutorial for an example of the conf file: www.easyprogramming.net/raspberrypi/pi_flask_apache.php Hope this helps!
@jackburgdoerfer5955
@jackburgdoerfer5955 4 года назад
@@naztronaut you are the man! I am not that knowledgable about OSystems as of yet so I really appreciate the help. This worked and now I am up and running
@naztronaut
@naztronaut 4 года назад
@@jackburgdoerfer5955 Awesome! Glad I was able to help.
@richarddowdy4620
@richarddowdy4620 5 лет назад
Thank you!
@naztronaut
@naztronaut 5 лет назад
:)
@DeletedAccount385
@DeletedAccount385 2 года назад
what is this terninal u use
@naztronaut
@naztronaut 2 года назад
It's PuTTY. but any terminal should work.
@DeletedAccount385
@DeletedAccount385 2 года назад
@@naztronaut ok thx
@TheJelvo
@TheJelvo 5 лет назад
For real? I have been wanting a Raspberry pi for a long ass time...That's for the video btw..It's a nice tutorial.
@naztronaut
@naztronaut 5 лет назад
For real! And thank you :) Good luck in the contest!
@MAcroR99
@MAcroR99 5 лет назад
Washington here, wanted a pi to program a bot for minecraft :)
@naztronaut
@naztronaut 5 лет назад
That sounds like a fun project! Thanks for entering :)
@naztronaut
@naztronaut 5 лет назад
Congrats, you won the Giveaway! Winners are posted here: www.easyprogramming.net/raspberrypi/browser_control_led.php Can you email me your address at admin@easyprogramming.net. I'll ask you for some verification before shipping the Pi. Congrats!
@naztronaut
@naztronaut 5 лет назад
Hi David, I don't think I've gotten an email from you. Are you still interested in the Pi?
@naztronaut
@naztronaut 5 лет назад
Hi David, I still haven't gotten an email from you. Let me know whether or not you're still interested in receiving the Pi. I will give you until June 30th and then I will either choose someone else or put it back in the pool for my next giveaway. Hope to hear from you by the next 2 weeks!
@MAcroR99
@MAcroR99 5 лет назад
@@naztronaut Hi Nazmus, Sorry for the late reply. I have sent you an email. Thank you so much!!
@shyamshiv2k
@shyamshiv2k 3 года назад
Thanks a lot, very simple tutorial to set up an app that can be access from outside of the local network. I tried the same steps and got this to work but I tried adding an ssl certificate to run it as https instead of http and it doesn't seem to be working. I did look up other forums and everything and added the necessary entries in myapp,conf. I am able to access it locally using https on my pi but I am not able to access it from outside even after enabling portforwarding for 443. internal network access / - works /myapp - works external network access / - works /myapp - doesnt work. Do you have video where you have explained the steps for setting up a https website on raspberry pi ? Thanks in Advance.
@naztronaut
@naztronaut 3 года назад
What error do you get? It's strange that works but not /myapp. The domain is the same so I don't think the SSL set up is the issue. You can also look at your error logs to troubleshoot. The apache error logs can be found in /var/log/apache2 and they are access_log and error_log (names may be slightly different, I don't have access to a Pi at the moment). If you want to post screenshots or log data, feel free to do so on the website (www.easyprogramming.net/raspberrypi/pi_flask_apache.php) since RU-vid doesn't allow screenshots and log data is hard to read. I don't have a GitHub repo for this project since it was meant to be simple.
@pythonantole9892
@pythonantole9892 5 лет назад
RU-vidrs are funny, they welcome subscriptions and likes from anywhere but giveways are only for US. Mmmh.
@naztronaut
@naztronaut 5 лет назад
Hi there! Liking and subscribing aren't necessary to enter the giveaway. I also don't have any kind of sponsorships so shipping these internationally can cost a lot and it's not something I can do easily. But I do allow people outside of the US to enter if they are willing to either pay for the shipping. So if you are willing, I'm happy to put your name in the hat, let me know!
@cem_kaya
@cem_kaya 4 года назад
what does it mean to install flask behind Apache ?
@naztronaut
@naztronaut 4 года назад
The basic explanation is that it lets you access your flask app through a web server and allows Apache to start/stop the app. Apache is fairly easy to maintain and comes with a ton of rich features like logging and ability to bounce traffic to different app servers. Long answer if you don't know much about Apache: Apache is a web server that lets you serve web content in a way that most browsers and people can understand on port 80, which is the standard port. So here, RU-vid.com is on a web server running on port 80. Port 80 is the default so you don't need to do RU-vid.com:80. You can just do RU-vid.com. There are other types of web servers, Apache is just one of them and the one I'm most familiar with. Read more about it here: www.apache.org/ Flask apps normally run on another port like easyprogramming.net:5000 and putting Apache on front of it lets you access that as easyprogramming.net. Apache also lets you point users to different application servers from one web server. So if you want to do some load balancing, you could run your flask app on 3 different servers and have one Apache server sitting in front. This is a VERY small part of Apache and web servers in general. You can find a lot of information on line if you start searching down the rabbit hole. Good luck!
@cem_kaya
@cem_kaya 4 года назад
@@naztronaut thanks, it will be an interesting dive .
@noether9447
@noether9447 5 лет назад
Do you think I can enter the giveaway if I am not from US but can order from my countries Amazon?
@naztronaut
@naztronaut 5 лет назад
Hey Rohit, I'm not sending anything through Amazon but if you're willing to pay for the shipping cost, I'm happy to send it your way. I'll put your name on the list and if you win, I'll be in touch. Thanks!
@newsogn5148
@newsogn5148 5 лет назад
can you access it from outside of your personal network??
@naztronaut
@naztronaut 5 лет назад
You can if you set up port forwarding on your router and open up Port 80 (you can find a ton of info on how to port forward by looking up your router make/model). But it's not something I'd recommend doing on a home network unless you are sure you can make it a secure connection otherwise you'll open up your network to potential attackers. I'd recommend doing some research on port forwarding and what actions you can take to secure your connection. Good luck!
@newsogn5148
@newsogn5148 5 лет назад
@@naztronaut that is sage advice, in any case it is only for my use anyways so why not just use a VPN on the same pi. so I think i will try that now.
@naztronaut
@naztronaut 5 лет назад
@@newsogn5148 Good luck! My next RPi tutorial is actually on setting up PiVPN :)
@srkshpdmnbhn
@srkshpdmnbhn 3 года назад
@@naztronaut Hi, thanks for all the videos, do you have the link to PiVPN?
@naztronaut
@naztronaut 3 года назад
@@srkshpdmnbhn My PiVPN tutorial can be found here: www.easyprogramming.net/raspberrypi/pivpn_pihole.php That's the written + video. Just the video tutorial is here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jQHPIV9hBZ4.html There's also documentation on the PiVPN site here: www.pivpn.io/ There's been a few changes to PiVPN options since I made the video. I've been thinking about doing an update on it at some point but my tutorial should still be mostly relevant. There are just some extra config stuff now I believe. Good luck!
@janausis
@janausis 4 года назад
Works totally fine but i still get an 404 Error, it did run succesfully with flask run --host=0.0.0.0 and i would also like it to be able to handle ssl
@naztronaut
@naztronaut 4 года назад
I think you asked this on EasyProgramming.net as well - for more visibility in case it helps others, I'll paste my response here as well: Can you check your error logs? Something may not be configured correctly. The logs should be at /var/log/apache2 Make sure the path to piapp.wsgi is correct in your Apache.conf file. This is usually the most common issue with 404 in Flask apps. if you want to do SSL, check out the Apache-SSL docs here: httpd.apache.org/docs/2.4/ssl/ssl_howto.html You'll need to install the module and create another virtual host for port 443. It can probably have the same configuration as port 80 that I posted in this tutorial but it's untested. let me know if you run into issues. Good luck!
@janausis
@janausis 4 года назад
@@naztronaut Thanks for, the fast response, that was it. And i also got it working with SSL perfectly fine
@naztronaut
@naztronaut 4 года назад
@@janausis Perfect!
@zejunzhang3357
@zejunzhang3357 4 года назад
thx sir, great tut
@naztronaut
@naztronaut 4 года назад
Glad it was helpful!
Далее
Raspberry Pi - Control an LED from a browser
12:06
Просмотров 26 тыс.
How to turn your Raspberry Pi into a Flask App Server
12:47
11 ming dollarlik uzum
00:43
Просмотров 279 тыс.
Mining Magnetite
16:20
Просмотров 59 тыс.
10 Raspberry Pi Projects (All models, including Pico)
1:52:44
I Turned A Raspberry Pi Into A Node.js Web Server
7:50
Framework Cyberdeck - DIY Portable PC
17:31
Просмотров 1,2 млн
Deploy Flask Application on Ubuntu VPS using Nginx
16:19
Making Raspberry Pi Web Controls
4:36
Просмотров 189 тыс.