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>
        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
        Alias /static /home/user/public_html/FlaskApp/FlaskApp/static
        <Directory /home/user/public_html/FlaskApp/FlaskApp/static/>
            Order allow,deny
            Allow from all
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined

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

import sys
import logging

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__)
def hello():
    return "Hello, testing flask app"
if __name__ == "__main__":

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.