This is an example flask web application for ubuntu server
sudo apt-get -y install apache2 apache2-dev
Download mod_wsgi from here https://github.com/GrahamDumpleton/mod_wsgi
unzip mod_wsgi*.zip
cd mod_wsgi*
which python3
./configure --with-python='insert_python3_path_without_quote'
sudo make && sudo make install
Append these configuration after DocumentRoot line of /etc/apache2/sites-enabled/000-default.conf file
WSGIDaemonProcess flaskapp threads=5
WSGIScriptAlias / /var/www/html/rsbpi_flask/flaskapp.wsgi
<Directory flaskapp>
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
git clone https://github.com/chuuhtetnaing/rsbpi_flask.git
sudo ln -sT ./rsbpi_flask /var/www/html/rsbpi_flask
cd rsbpi_flask
virtualenv --python=python3 venv
source venv/bin/activate
pip install -r requirements.txt
sudo service apache2 restart