Deploying with Apache
In this recipe, we will learn how to deploy a Flask application with Apache
, which is, arguably, the most popular HTTP server. For Python web applications, we will use mod_wsgi
, which implements a simple Apache module that can host any Python applications that support the WSGI interface.
Note
Remember that mod_wsgi
is not the same as Apache and needs to be installed separately.
Getting ready
We will start with the catalog application from the previous chapter. There is no need to make any changes to the existing code.
For deploying with Apache, it is important to make sure that the latest version of the Apache httpd
server is installed on the machine on which you intend to deploy. Usually, the versions of Apache shipped with the operating systems (especially macOS) might be older and will not be supported by the mod_wsgi
library.
Note
httpd
stands for Hypertext Transfer Protocol Daemon, which refers to a program that waits for requests from...