I have developed a Flask web app which I am now trying to host on Apache using the mod_wsgi documentation.
I created a appName.wsgi file in the /var/www/MyApp directory.
Then for configuring Apache I created a config file in the /etc/apache2/site-available/myApp.config with the below config
Code: Select all
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess yourapplication user=user1 group=group1 threads=5
WSGIScriptAlias / /var/www/yourapplication/yourapplication.wsgi
<Directory /var/www/yourapplication>
WSGIProcessGroup yourapplication
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>I tried the URL: http:localhost/example.com but keep getting 404 no page error!
Further when i removed the Virtual Host and servername and changed my config file in the /etc/apache2/site-available/myApp.config to below, it works, and my web app is available at http://localhost
Code: Select all
WSGIDaemonProcess yourapplication user=user1 group=group1 threads=5
WSGIScriptAlias / /var/www/yourapplication/yourapplication.wsgi
<Directory /var/www/yourapplication>
WSGIProcessGroup yourapplication
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>