Install mod_wsgi with Python 2.7 on a 64-bit version of Windows

I am trying to deploy my Django site, which is written in Python 2.7, on a 64-bit Windows machine (Windows Server 2008 R2). I installed the precompiled version of Apache (Apache 2.4.16 x64) from https://www.apachehaus.com/cgi-bin/download.plx (due to the lack of the option provided by Apache Lounge * **) and verified that Python 2.7 works on 64 bit and compiles with VC9. I could not find the finished binary for mod_wsgi (for Windows 64 bit and compiled with VC9), so I downloaded the source code for mod_wsgi from https://github.com/GrahamDumpleton/mod_wsgi/releases/tag/4.4.13 and followed the direction https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst by changing the file ap24py27-win64-VC9.mkto specify the correct directories forAPACHE_ROOTDIRand PYTHON_ROOTDIRand using the C ++ 2008 64-bit command line to run the command nmake -f ap24py27-win64-VC9.mk clean. However, this gave me an error:

wsgi_memory.obj : error LNK2019: unresolved external symbol GetProcessMemoryInfo referenced
  in function getPeakRSS
mod_wsgi.so : fatal error LINK1120: 1 unresolved externals
NMAKE : fatal error U1077: `"...\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"` :
  return code `0x2`
Stop.

I read the installation and configuration documents for mod_wsgi several times and searched the Internet, including SO for the past few hours, to no avail. What am I doing wrong here and how can I fix it?

*** I know that the official installation document for mod_wsgi warns about using binary files from sources other than Apache Lounge, but I seem to be unable to find the required compiled version (for VC9 and Windows 64 bit) from the site, Maybe this is a problem, and if so, how can I fix it?

: Adelin namke -f ap24py27-win64-VC9.mk clean. , namke -f ap24py27-win64-VC9.mk namke -f ap24py27-win64-VC9.mk install, , : warning C4820: '...' : '...' bytes padding added after data member '...',

fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
...\mod_wsgi-4.4.13\src\server\wsgi_memory.c<124> : warning C4711: function 'getCurrentRSS' selected for automatic inline expansion
NMAKE: fatal error U1077: '"C:\...\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\c1.EXE"' : return code '0x2'
Stop.

- , ?

+4
1

.

, cl.exe psapi.lib. , wsgi_memory.c - GetProcessMemoryInfo.

, :

  • psapi.lib ( C:\)
  • ap24py27-win64-VC9.mk, ,
  • , .mk . , common-VC9.mk
  • (common-VC9.mk)
  • LDFLAGS /LIBPATH:"PATH_FOUND_AT_STEP_1"\

:)

P.S. psapi.lib , , SDK Windows. Windows 7 Windows 8 SDK , , psapi.lib, C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64

Edit: , , nmake throws "No such file" , common-VC9.mk.

nmake: .h .lib.

a .h , CPPFLAGS common-VC9.mk. a .lib , LDFLAGS.

? psapi.lib: : CPPFLAGS LDFLAGS.

+3

Source: https://habr.com/ru/post/1609222/


All Articles