WebFaction
Community site: login faq

I have gone throught httpd.conf a dozen times and I cannot figure out how to get rid of the index.py. The app works but if I set an Alias o WSGI Alias it will still redirect to index.py and return a http 404.

I couldn't find any .ht... file anywhere in the webapp. When I stop the apache I get a http 502 - Bad Gateway but get still redirected to index.py.

  • Application: mod_wsgi 4.5.24/Python 3.6
  • virtual environment: NO

httpd.conf:

ServerRoot "/home/markusbarth/webapps/edf_checker/apache2"

LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so
LoadModule unixd_module      modules/mod_unixd.so
LoadModule alias_module      modules/mod_alias.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/markusbarth/logs/user/access_edf_checker.log combined
ErrorLog /home/markusbarth/logs/user/error_edf_checker.log

DirectoryIndex index.py
DocumentRoot /home/markusbarth/webapps/edf_checker/htdocs

Listen 12554
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5

WSGIDaemonProcess edf_checker processes=2 threads=12 python-path=/home/markusbarth/webapps/edf_checker/lib/python3.6
WSGIProcessGroup edf_checker
WSGIRestrictEmbedded On
WSGILazyInitialization On

<Directory /home/markusbarth/webapps/edf_checker/htdocs>
    Options +ExecCGI
    AddHandler wsgi-script .py
    RewriteEngine On
    RewriteBase /
    WSGIScriptReloading On
</Directory>

WSGIScriptAlias / /home/markusbarth/webapps/edf_checker/htdocs/index.py/

index.py

import sys
sys.path.insert(0,'/home/markusbarth/webapps/edf_checker/htdocs/')
from edf_checker import app as application

asked 06 Feb, 09:10

markusbarth
1115
accept rate: 0%

edited 06 Feb, 10:48


It seems to be something built into flask, there is a good suggestion on stackoverflow to change it to init.py,

permanent link

answered 06 Feb, 22:20

johns ♦♦
5.1k211
accept rate: 22%

The issue on stackoverflow actually refers to a different problem caused by a wrong name for the package initializer init.py

(13 Feb, 13:17) markusbarth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×62
×44
×1

question asked: 06 Feb, 09:10

question was seen: 255 times

last updated: 13 Feb, 13:17

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM