GrahamDumpleton / mod_wsgi-httpd

Installer for Apache httpd web server.
Apache License 2.0
6 stars 1 forks source link

Failing to install on Windows Server 2016 with python 2.7 #3

Open Ruffle opened 7 years ago

Ruffle commented 7 years ago

Hello,

I've been following the instructions given here The earliest (in terms of VC) binaries for Apache that I found on ApacheLounge were compiled with VC11. These binaries contained all the necessary headers for "pip install mod_wsgi" to succeed.

(Btw, when I ran "mod_wsgi_express module_config", the output contained 'LoadModule wsgi_module "c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgiNone"' instead of what I assume should have been 'LoadModule wsgi_module "c:/python27/lib/site-packages/mod_wsgi/server/mod_wsgi.pyd"')

I have Python2.7 BUT compiled with VC11.

An error occured when I ran "pip install mod_wsgi-httpd": (disregard the first two warnings. I think they're unrelated) C:\Python27>pip install mod_wsgi-httpd Collecting mod_wsgi-httpd C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning. SNIMissingWarning C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Downloading mod_wsgi-httpd-2.4.27.1.tar.gz (12.3MB) 100% |################################| 12.3MB 81kB/s Complete output from command python setup.py egg_info: 'rm' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\users\azureu~1\appdata\local\temp\2\pip-build-9kshfy\mod-wsgi-httpd\setup.py", line 77, ``in <module> raise RuntimeError('Failed to build APR.') RuntimeError: Failed to build APR. ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in c:\users\azureu~1\appdata\local\temp\2\pip-build-9kshfy\mod-wsgi-httpd\

It seems like the command should be "del" instead of "rm", right?

As a sidenote, I'm doing all this hoping that I will have access to the WSGIDaemonProcess command. I realise that you're previously stated that, regarding pre-compiled binaries:

Occassionally precompiled binaries will be made available for mod_wsgi. These may not be updated on every release because more often than not code changes are being made which relate only to mod_wsgi daemon mode, or mod_wsgi-express, neither of which are available for Windows.

But I was hoping that, with the introduction of mod_wsgi-httpd, this would change. What I'm trying to accomplish here is mostly a short-term fix as in the long term I'm going to have a linux web server.

GrahamDumpleton commented 7 years ago

You can't run pip install mod_wsgi-httpd on Windows. It only works on UNIX like systems. Daemon mode is also not supported on Windows. It is a limitation of Apache on Windows.

When you say you 'have Python 2.7 but compiled with VC11', how did you get that? Python 2.7 is usually compiled with VC9 and as far as I know can't be compiled with newer compiler.

The extension showing as None is a known issue that I haven't been able to get anyone to assist me with the code change to fix it.

Overall, right now with current state of Python and Apache, I know of no one recently who has said the have successfully got Python 2.7 working with Apache 2.4. The mod_wsgi module simply fails to load into Apache with it indicating a file (likely some DLL it requires) not being able to be found.

Ruffle commented 7 years ago

Thanks for clarifying.

Well it's unfortunate neither mod_wsgi-httpd nor daemon mode doesn't work on Windows. We have certain requests that exceed the Apache max stack size (8MB) and we were wondering if daemon mode could bypass this problem.

Regarding Python, I wasn't there when it happened but my coworker tells me that we've recompiled Python27 with VC11 in both release and debug.

We've been using this version of python + Apache 2.4.25 x64 VC9 (from Apachehaus) + mod_wsgi-windows-4.4.6 (from The Grapevine) + Django + Windows Server for 2 years now without stability problems.