0

I am trying to host flask webapp in virtualmin but for some reason it is not working....

I referred below links before hosting the site... but due to different folder structure in virtualmin got confused a bit.

Codementor link

Digital Ocean link

till now i configured upto here... apache2 -> sites available ->mysite.conf

<VirtualHost *:80>
        ServerName 10.12.15.20
        ServerAdmin admin@mywebsite.com
        WSGIScriptAlias / /home/user/public_html/FlaskApp/flaskapp.wsgi
        <Directory /home/user/public_html/FlaskApp/FlaskApp/>
            Order allow,deny
            Allow from all
        </Directory>
        Alias /static /home/user/public_html/FlaskApp/FlaskApp/static
        <Directory /home/user/public_html/FlaskApp/FlaskApp/static/>
            Order allow,deny
            Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

wsgi location /home/user/public_html/FlaskApp/flaskapp.wsgi

#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/home/user/public_html/FlaskApp/")

from FlaskApp import app as application
application.secret_key = '##abcdefghijkl@@#4'

my simple app file which is there in below location /home/user/public_html/FlaskApp/FlaskApp/init.py

from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
    return "Hello, testing flask app"
if __name__ == "__main__":
    app.run()

when i access my website with ip address nothing loads but if i put php test file it works....

also if i run app with python in terminal it works....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.