Skip to content

shaunharker/minimalflaskexample

Repository files navigation

minimalflaskexample

Installation

Here are roughly the instructions that worked for me on Ubuntu 20.04 on 2022-04-10 (though I'm hand-waving a bit on prerequisites, I think I got it right though):

# Install prerequisites
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi-py3
sudo apt-get install python-dev-is-python3
sudo apt install certbot python3-certbot-apache
sudo pip install flask # some recommend virtualenv

# Download this repository
cd /var/www/html
sudo git clone https://github.com/shaunharker/minimalflaskexample
cd minimalflaskexample

# Fix the permissions so group is www-data with same
# privileges as user
bash ./permissions.sh

# Set up apache2
sudo ufw allow 'Apache Full'
sudo a2enmod ssl
sudo certbot --apache # and handle matters according to https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04
sudo a2enmod wsgi
sudo cp site.conf /etc/apache2/sites-available/site.conf
sudo emacs /etc/apache2/sites-available/site.conf # fix domain name with search and replace, adjust server alias, RTFM if confused ;)
sudo a2dissite 000-default
sudo a2ensite site
sudo systemctl restart apache2

Acknowledgments

About

An example calling python scripts from javascript

Resources

Stars

Watchers

Forks

Packages

No packages published