Apache无法找到Flask应用程序路径

时间:2019-04-18 13:27:13

标签: python apache flask wsgi

我在/var/www/html/中有四个烧瓶应用程序。在这3个中,表现出色。

我最后添加的第4个摘要应用程序无法正常工作。出现错误:

Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

我检查了/var/log/apache2/error.log

但那里也没有错误消息。

                ServerName Open JDK (Every Java Version)                 ServerAlias IP                 ServerAdmin admin@mywebsite.com

            WSGIScriptAlias /app1 /var/www/html/flaskapp1/flaskapp1.wsgi
            <Directory /var/www/html/flaskapp1>
                    Order allow,deny
                    Allow from all
            </Directory>

            WSGIScriptAlias /app2 /var/www/html/flaskapp2/flaskapp2.wsgi
            <Directory /var/www/html/flaskapp2>
                    Order allow,deny
                    Allow from all
            </Directory>

            WSGIScriptAlias / /var/www/html/datainsighto_site/app_website.wsgi
            <Directory /var/www/html/datainsighto_site>
                    Order allow,deny
                    Allow from all
            </Directory>

            WSGIScriptAlias /summary /var/www/html/TextSummarization/app.wsgi
            <Directory /var/www/html/TextSummarization>
                    Order allow,deny
                    Allow from all
           </Directory>

            ErrorLog ${APACHE_LOG_DIR}/error.log
            LogLevel warn
            CustomLog ${APACHE_LOG_DIR}/access.log combined

app.py

from flask import Flask, render_template, request, jsonify,flash,redirect,url_for
import urllib.request
from bs4 import BeautifulSoup
from flask_restful import Resource,Api
from NLP2novratio import summarize
from newspaper import Article
from werkzeug import secure_filename
import textract




app = Flask(__name__)
sumrapi = Api(app)

app.config['SECRET_KEY'] = 'b58f1ad3ab27a913c64246143682ebf5'

@app.route('/')
def index():
        return render_template('text-summarizer.html')
@app.route('/view', methods=['POST','GET'])
def view():
    content = ''
    try:
....

app.wsgi

import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/html/TextSummarization/")

from app import app as application

任何错误提示?

0 个答案:

没有答案