在MACOSX Apache 2.4

时间:2017-08-27 20:08:33

标签: python apache flask mod-wsgi

我正在尝试在我的本地mac(10.10.2)上设置测试Web应用程序。我正在运行apache 2.4,当我尝试访问该网站时,我收到了权限问题。 http://testwebapp。文件系统的权限完全打开。

apache错误日志打印出来:

AH01630: client denied by server configuration: /var/www/testwebapp/wsgi/testwebapp.wsgi, referer: http://testwebapp/

/etc/apache2/vhosts/testwebapp.conf

<VirtualHost *:80>
ServerName testwebapp

WSGIDaemonProcess testwebapp
WSGIScriptAlias "/" "/var/www/testwebapp/wsgi/testwebapp.wsgi"

<Directory "/var/www/testwebapp">
    Options All
    Require local
    AllowOverride All
    WSGIProcessGroup testwebapp
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptReloading On
    Require all granted
</Directory>

/var/www/testwebapp/wsgi/testwebapp.wsgi

from testwebapp.api import testwebapp as application

目录结构/ var / www / testwebapp / testwebapp

api/testwebapp.py
static
template

testwebapp.py

from flask import Flask
from flask import jsonify
from flask import request
from flask import render_template
from flask_pymongo import PyMongo

app = Flask(__name__)

app.config['MONGO_DBNAME'] = 'sampledb'
app.config['MONGO_URI'] = 'mongodb://localhost:27017/sampledb'

mongo = PyMongo(app)

@app.route('/')
def hello_world():
    return render_template('base.html')

if __name__ == '__main__':
    app.run()

我怀疑我的原始apache http.conf可能有问题,但我无法在线找到解决方案。感谢您提前提供任何帮助。

0 个答案:

没有答案