I’ve been trying to setup my Flask app on DigitalOcean but keep getting a 404 error:
Not Found The requested URL / was not found on this server. Apache/2.4.12 (Ubuntu) Server at recomeal.com Port 80
I’ve set up the site on Ubuntu 15.10 with apache2 and put my flask application in the /var/www/recomeal/Recomeal directory. I’ve been following this tutorial and don’t know what went wrong. I’ve also pointed my domain name (recomeal.com) at the virtual machine and I know that part at least is working, I just can’t get rid of the 404 error. Thanks so much for your help.
/etc/apache2/sites-available/recomeal.conf
<VirtualHost *:80>
ServerName recomeal.com
ServerAdmin jackbrucesimpson@gmail.com
WSGIScriptAlias / /var/www/recomeal/recomeal.wsgi
<Directory /var/www/recomeal/Recomeal/>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/recomeal/Recomeal/static
<Directory /var/www/recomeal/Recomeal/static/>
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
/var/www/recomeal/recomeal.wsgi
#!/usr/bin/python3
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/recomeal/")
from Recomeal import app as application
application.secret_key = 'my key'
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.