<h1>Apache httpd<aclass="headerlink"href="#apache-httpd"title="Link to this heading">¶</a></h1>
<p><aclass="reference external"href="https://httpd.apache.org/">Apache httpd</a> is a fast, production level HTTP server. When serving
your application with one of the WSGI servers listed in <aclass="reference internal"href="index.html"><spanclass="doc">Deploying to Production</span></a>, it
is often good or necessary to put a dedicated HTTP server in front of
it. This “reverse proxy” can handle incoming requests, TLS, and other
security and performance concerns better than the WSGI server.</p>
<p>httpd can be installed using your system package manager, or a pre-built
executable for Windows. Installing and running httpd itself is outside
the scope of this doc. This page outlines the basics of configuring
httpd to proxy your application. Be sure to read its documentation to
understand what features are available.</p>
<sectionid="domain-name">
<h2>Domain Name<aclass="headerlink"href="#domain-name"title="Link to this heading">¶</a></h2>
<p>Acquiring and configuring a domain name is outside the scope of this
doc. In general, you will buy a domain name from a registrar, pay for
server space with a hosting provider, and then point your registrar
at the hosting provider’s name servers.</p>
<p>To simulate this, you can also edit your <codeclass="docutils literal notranslate"><spanclass="pre">hosts</span></code> file, located at
<codeclass="docutils literal notranslate"><spanclass="pre">/etc/hosts</span></code> on Linux. Add a line that associates a name with the
local IP.</p>
<p>Modern Linux systems may be configured to treat any domain name that
ends with <codeclass="docutils literal notranslate"><spanclass="pre">.localhost</span></code> like this without adding it to the <codeclass="docutils literal notranslate"><spanclass="pre">hosts</span></code>
<divclass="code-block-caption"><spanclass="caption-text"><codeclass="docutils literal notranslate"><spanclass="pre">/etc/hosts</span></code></span><aclass="headerlink"href="#id2"title="Link to this code">¶</a></div>
<divclass="code-block-caption"><spanclass="caption-text"><codeclass="docutils literal notranslate"><spanclass="pre">/etc/httpd/conf/httpd.conf</span></code></span><aclass="headerlink"href="#id3"title="Link to this code">¶</a></div>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">LoadModule</span></code> lines might already exist. If so, make sure they are
uncommented instead of adding them manually.</p>
<p>Then <aclass="reference internal"href="proxy_fix.html"><spanclass="doc">Tell Flask it is Behind a Proxy</span></a> so that your application uses the <codeclass="docutils literal notranslate"><spanclass="pre">X-Forwarded</span></code>
headers. <codeclass="docutils literal notranslate"><spanclass="pre">X-Forwarded-For</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">X-Forwarded-Host</span></code> are automatically
set by <codeclass="docutils literal notranslate"><spanclass="pre">ProxyPass</span></code>.</p>