Perkin5
Perkin5

Reputation: 399

How to run flask in wamp with a mod_wsgi module

Windows 10, Python 3.6, Wamp 3.0.6. I am a python newbie and wanting to create a test website using flask. I know I can use a virtual environment but I'd rather use my wamp server running apache 2.4.23. To do this I understand I have to install an mod_wsgi module. A helpful guy called Graham Dumpleton has made the files available and depending on the version of Windows and python, you can download a .whl file. So I've done that, renamed it to zip, uncompressed it and have a bunch of folders and files inside. However, all apache module files have a .so extension and there are no files in the download like that. I think I have what I need but there is a process to install the module that I don't understand. Can anyone explain how I can do this?

Upvotes: 0

Views: 2754

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

You are better off compiling/installing mod_wsgi yourself. Those .whl files are created by a third party (not me) and I don't know how they are being built.

Presuming you have you Apache installation under C:/Apache24 and have the correct MS C/C++ compiler installed for the version of Python you are using, all you need to do to install mod_wsgi is run:

pip install mod_wsgi

Once it is installed, run:

mod_wsgi-express module-config

Copy what it outputs and add it to your Apache configuration file. Then configure mod_wsgi for your specific WSGI application.

Note that only the Apache distribution from www.apachelounge.com is recommended. Some other Apache distributions do not provide the header files required to allow you to compile additional Apache modules.

Upvotes: 1

Related Questions