All of my components are 64 bit. Running the simple server from wsgiref using the application declared in wsgi.py works, and using the test hello world application in wsgi.py instead of the django application also works (apache renders successfully).
When I put the two together, however, I can't even establish a connection
on telnet:
Microsoft Telnet> o randev02 80
Connecting To randev02...
Connection to host lost.
Apache version information:
c:\Apache24\bin>httpd.exe -V
Server version: Apache/2.4.16 (Win64)
Apache Lounge VC10 Server built: Jul 12 2015 14:53:37
Servers Module Magic Number: 20120211:47
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: WinNT
threaded: yes (fixed thread count)
forked: no
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/apache"
-D SUEXEC_BIN="/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error.log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Python version & architecture
>>> import struct
>>> print(8 * struct.calcsize("P"))
64
>>> import sys; print("Python version: {}\nPython Prefix: {}".format(sys.
version
, sys.prefix))
Python version: 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (
AMD64
)]
Python Prefix: C:\Python27
Python is installed for all users (User S-1-5-18):
c:\Apache24\bin>REG QUERY HKLM\Software\Microsoft\Windows\CurrentVersion\
Install
er\UserData\S-1-5-18\Products\5FD4CC3C5A9372041B63B2E3F1A56B3E\
InstallProperties
/v DisplayName
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\
UserData\
S-1-5-18\Products\5FD4CC3C5A9372041B63B2E3F1A56B3E\InstallProperties
DisplayName REG_SZ Python 2.7.6 (64-bit)
I have attached access.log, error.log, additional header logging from
wsgi.py, my httpd.conf and my wsgi.py files. I would greatly appreciate
some help with tracking this down.
Dan
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.
1439496569.41-3428-1.icontent
Description: Binary data
1439496569.41-3428-1.iheaders
Description: Binary data
access.log
Description: Binary data
error.log
Description: Binary data
# # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). # If a drive letter is omitted, the drive on which httpd.exe is located # will be used by default. It is recommended that you always supply # an explicit drive letter in absolute paths to avoid confusion. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used. If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "c:/Apache24" Listen 80 LoadModule wsgi_module modules/mod_wsgi.so LoadModule access_compat_module modules/mod_access_compat.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule cgi_module modules/mod_cgi.so LoadModule deflate_module modules/mod_deflate.so LoadModule env_module modules/mod_env.so LoadModule expires_module modules/mod_expires.so LoadModule include_module modules/mod_include.so LoadModule isapi_module modules/mod_isapi.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule setenvif_module modules/mod_setenvif.so WSGIRestrictStdout Off AllowEncodedSlashes On WSGIPassAuthorization Off AddDefaultCharset utf-8 SetEnv LC_ALL en_US.UTF-8 SetOutputFilter DEFLATE ExpiresActive Off ServerAdmin xxxxxxxxxxxxxxxxxxxxx ServerName randev02.xxxxxxxxxxxxx:80 <Directory /> AllowOverride none Require all granted </Directory> DocumentRoot "c:/sensei/development" <Directory "c:/sensei/devleopment"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> Alias /site_static/ "C:/sensei/development/sensei_web/media/static" Alias /site_media/ "C:/sensei/development/sensei_web/media" <Directory "C:/sensei/development/sensei_web/media"> Require all granted ExpiresActive On ExpiresDefault "access plus 60 days" Options Indexes IndexOptions FancyIndexing </Directory> WSGIScriptAlias / "C:/sensei/development/sensei_web/wsgi.py" WSGIPythonPath "C:/sensei/development" <Directory "C:/sensei/development/sensei_web"> <Files wsgi.py> Require all granted </Files> </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error.log" LogLevel Info <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access.log" common </IfModule> <IfModule mime_module> TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz </IfModule> Timeout 60 KeepAlive Off UseCanonicalName Off AccessFileName .htaccess ServerTokens Full ServerSignature Off HostnameLookups Off <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule>
import os
import sys
os.chdir("C:\sensei\development")
sys.path.insert(0, "C:\sensei\development\sensei_web")
sys.path.insert(0, "c:\sensei\development")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sensei_web.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
import threading
import pprint
import time
import os
class LoggingInstance:
def __init__(self, start_response, oheaders, ocontent):
self.__start_response = start_response
self.__oheaders = oheaders
self.__ocontent = ocontent
def __call__(self, status, headers, *args):
pprint.pprint(((status, headers)+args), stream=self.__oheaders)
self.__oheaders.close()
self.__write = self.__start_response(status, headers, *args)
return self.write
def __iter__(self):
return self
def write(self, data):
self.__ocontent.write(data)
self.__ocontent.flush()
return self.__write(data)
def next(self):
data = self.__iterable.next()
self.__ocontent.write(data)
self.__ocontent.flush()
return data
def close(self):
if hasattr(self.__iterable, 'close'):
self.__iterable.close()
self.__ocontent.close()
def link(self, iterable):
self.__iterable = iter(iterable)
class LoggingMiddleware:
def __init__(self, application, savedir):
self.__application = application
self.__savedir = savedir
self.__lock = threading.Lock()
self.__pid = os.getpid()
self.__count = 0
def __call__(self, environ, start_response):
self.__lock.acquire()
self.__count += 1
count = self.__count
self.__lock.release()
key = "%s-%s-%s" % (time.time(), self.__pid, count)
iheaders = os.path.join(self.__savedir, key + ".iheaders")
iheaders_fp = file(iheaders, 'w')
icontent = os.path.join(self.__savedir, key + ".icontent")
icontent_fp = file(icontent, 'w+b')
oheaders = os.path.join(self.__savedir, key + ".oheaders")
oheaders_fp = file(oheaders, 'w')
ocontent = os.path.join(self.__savedir, key + ".ocontent")
ocontent_fp = file(ocontent, 'w+b')
errors = environ['wsgi.errors']
pprint.pprint(environ, stream=iheaders_fp)
iheaders_fp.close()
length = int(environ.get('CONTENT_LENGTH', '0'))
input = environ['wsgi.input']
while length != 0:
data = input.read(min(4096, length))
if data:
icontent_fp.write(data)
length -= len(data)
else:
length = 0
icontent_fp.flush()
icontent_fp.seek(0, os.SEEK_SET)
environ['wsgi.input'] = icontent_fp
iterable = LoggingInstance(start_response, oheaders_fp, ocontent_fp)
iterable.link(self.__application(environ, iterable))
return iterable
application = LoggingMiddleware(application, 'C:\Apache24\logs\wsgi')
