Tuesday, April 10, 2018
Apache2 configuration to run both django and flask in one server.
# Under /etc/apache2/sites-available/ add a file say multi_sites.conf with the following contents
project name of django is DP and project name of flask is FP:
<VirtualHost *>
Alias /static /../DP/static
<Directory /.../DP/static>
Require all granted
</Directory>
<Directory /../DP/DP>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess python-path=/../DP/
WSGIProcessGroup DP
WSGIScriptAlias / /../DP/DP/wsgi.py
</VirtualHost>
<VirtualHost *>
Alias /static /../FP/static
<Directory /../FP/static>
Require all granted
</Directory>
<Directory /../FP/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess ocean python-path=/../FP/
WSGIScriptAlias / /../FP/wsgi.py
</VirtualHost>
3. Enable sites:
sudo a2ensite multi_sites.conf
sudo a2dissite 000-default.conf
sudo apache2ctl restart
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment