httpd.conf - Writing a mod-wsgi script on Amazon linux -
i using httpd2.4
mod-wsgi
installed on amazon linux.
my wsgi
script looks this:
/projects/mv2/test/test.wsgi
import sys import os sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) test import *
/projects/mv2/test/test.py
from flask import flask app = flask(__name__) @app.route('/test') def hello_world(): return 'hello, world!'
apache conf file
<virtualhost *:80> servername test-algo.com wsgidaemonprocess algos_app user=mv2 group=mv2 threads=1 wsgiscriptalias / /projects/mv2/test/test.wsgi <directory /projects/mv2/test/test> wsgiprocessgroup algos_app wsgiapplicationgroup %{global} options multiviews followsymlinks allowoverride require granted </directory> </virtualhost>
when hit url http://test-algo.com/test
, 403 response , following httpd error file
[authz_core:error] [pid 27555] [client 153.156.225.142:65083] ah01630: client denied server configuration: /projects/mv2/test/test.wgi
i not able find wrong wsgi
script.
the directory
blog should start with:
<directory /projects/mv2/test>
you have test
@ end of path.
that cause 403 error.
the wsgi script should use:
from test import app application
the name of wsgi entry point expected application
not app
flask file uses.
if don't fix different error after fixing first.
Comments
Post a Comment