<h2><codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> Setup<aclass="headerlink"href="#mod-wsgi-setup"title="Permalink to this headline">¶</a></h2>
<h3>Install <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code><aclass="headerlink"href="#install-mod-wsgi"title="Permalink to this headline">¶</a></h3>
<li><p><em>Fedora/RHEL</em> - Apache HTTP Server and <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> are available in the standard package
<li><p><em>Ubuntu/Debian</em> - Apache HTTP Server and <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> are available in the standard package
<h3>Copy and modify the VHOST<aclass="headerlink"href="#copy-and-modify-the-vhost"title="Permalink to this headline">¶</a></h3>
<p>After <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> is installed, copy the <codeclass="docutils literal notranslate"><spanclass="pre">evennia/web/utils/evennia_wsgi_apache.conf</span></code> file to your
apache2 vhosts/sites folder. On Debian/Ubuntu, this is <codeclass="docutils literal notranslate"><spanclass="pre">/etc/apache2/sites-enabled/</span></code>. Make your
modifications <strong>after</strong> copying the file there.</p>
<p>Read the comments and change the paths to point to the appropriate locations within your setup.</p>
<h3>A note on code reloading<aclass="headerlink"href="#a-note-on-code-reloading"title="Permalink to this headline">¶</a></h3>
<p>If your <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> is set up to run on daemon mode (as will be the case by default on Debian and
Ubuntu), you may tell <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> to reload by using the <codeclass="docutils literal notranslate"><spanclass="pre">touch</span></code> command on
<codeclass="docutils literal notranslate"><spanclass="pre">evennia/game/web/utils/apache_wsgi.conf</span></code>. When <codeclass="docutils literal notranslate"><spanclass="pre">mod_wsgi</span></code> sees that the file modification time has
changed, it will force a code reload. Any modifications to the code will not be propagated to the
<h3>Further notes and hints:<aclass="headerlink"href="#further-notes-and-hints"title="Permalink to this headline">¶</a></h3>
<p>If you get strange (and usually uninformative) <codeclass="docutils literal notranslate"><spanclass="pre">Permission</span><spanclass="pre">denied</span></code> errors from Apache, make sure
that your <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> directory is located in a place the webserver may actually access. For example,
some Linux distributions may default to very restrictive access permissions on a user’s <codeclass="docutils literal notranslate"><spanclass="pre">/home</span></code>
directory.</p>
<p>One user commented that they had to add the following to their Apache config to get things to work.
Not confirmed, but worth trying if there are trouble.</p>
<h2><codeclass="docutils literal notranslate"><spanclass="pre">mod_proxy</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">mod_ssl</span></code> setup<aclass="headerlink"href="#mod-proxy-and-mod-ssl-setup"title="Permalink to this headline">¶</a></h2>
<p>Below are steps on running Evennia using a front-end proxy (Apache HTTP), <codeclass="docutils literal notranslate"><spanclass="pre">mod_proxy_http</span></code>,
<codeclass="docutils literal notranslate"><spanclass="pre">mod_proxy_wstunnel</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">mod_ssl</span></code>. <codeclass="docutils literal notranslate"><spanclass="pre">mod_proxy_http</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">mod_proxy_wstunnel</span></code> will simply be
<h3>Install <codeclass="docutils literal notranslate"><spanclass="pre">mod_ssl</span></code><aclass="headerlink"href="#install-mod-ssl"title="Permalink to this headline">¶</a></h3>
<li><p><em>Fedora/RHEL</em> - Apache HTTP Server and <codeclass="docutils literal notranslate"><spanclass="pre">mod_ssl</span></code> are available in the standard package
<li><p><em>Ubuntu/Debian</em> - Apache HTTP Server and <codeclass="docutils literal notranslate"><spanclass="pre">mod_sslj</span></code>kl are installed together in the <codeclass="docutils literal notranslate"><spanclass="pre">apache2</span></code>
package and available in the
standard package repositories for Ubuntu and Debian. <codeclass="docutils literal notranslate"><spanclass="pre">mod_ssl</span></code> needs to be enabled after
<h4>Evennia secure websocket configuration<aclass="headerlink"href="#evennia-secure-websocket-configuration"title="Permalink to this headline">¶</a></h4>
<p>There is a slight trick in setting up Evennia so websocket traffic is handled correctly by the
proxy. You must set the <codeclass="docutils literal notranslate"><spanclass="pre">WEBSOCKET_CLIENT_URL</span></code> setting in your <codeclass="docutils literal notranslate"><spanclass="pre">mymud/server/conf/settings.py</span></code> file:</p>
<p>The setting above is what the client’s browser will actually use. Note the use of <codeclass="docutils literal notranslate"><spanclass="pre">wss://</span></code> is
over SSL/TLS). Also, especially note the additional path <codeclass="docutils literal notranslate"><spanclass="pre">/ws</span></code> at the end of the URL. This is how
Apache HTTP Server identifies that a particular request should be proxied to Evennia’s websocket
port but this should be applicable also to other types of proxies (like nginx).</p>