Apache Config

Warning: This information is presented as a convenience, using another webserver than Evennia’s own is not directly supported and you are on your own if you want to do so. Evennia’s webserver works out of the box without any extra configuration and also runs in-process making sure to avoid caching race conditions. The browser web client will most likely not work (at least not without tweaking) on a third-party web server.

You can run Evennia’s web front end with apache2 and mod_wsgi. However, there seems to be no reason why the codebase should not also work with other modern web servers like nginx/lighttpd + gunicorn, Tornado, uwsgi, etc.

Note that the Apache instructions below might be outdated. If something is not working right, or you use Evennia with a different server, please let us know.

mod_wsgi Setup

Install mod_wsgi

mod_wsgi is an excellent, secure, and high-performance way to serve Python projects. Code reloading is a breeze, Python modules are executed as a user of your choice (which is a great security win), and mod_wsgi is easy to set up on most distributions.

For the sake of brevity, this guide will refer you to mod_wsgi’s installation instructions page, as their guides are great. For those that are running Debian or Ubuntu, you may install the entire stack with the following command:

sudo aptitude install libapache2-mod-wsgi

This should install apache2 (if it isn’t already), mod_wsgi, and load the module. On Fedora or CentOS, you’ll do this with yum and a similar package name that you’ll need to search for. On Windows, you’ll need to download and install apache2 and mod_wsgi binaries.

Copy and modify the VHOST

After mod_wsgi is installed, copy the evennia/game/web/utils/evennia_wsgi_apache.conf file to your apache2 vhosts/sites folder. On Debian/Ubuntu, this is /etc/apache2/sites-enabled/. Make your modifications after copying the file there.

Read the comments and change the paths to point to the appropriate locations within your setup.

Restart/Reload Apache

You’ll then want to reload or restart apache2. On Debian/Ubuntu, this may be done via:

sudo /etc/init.d/apache2 restart` or `sudo /etc/init.d/apache2 reload

Enjoy

With any luck, you’ll be able to point your browser at your domain or subdomain that you set up in your vhost and see the nifty default Evennia webpage. If not, read the hopefully informative error message and work from there. Questions may be directed to our Evennia Community site.

A note on code reloading

If your mod_wsgi is set up to run on daemon mode (as will be the case by default on Debian and Ubuntu), you may tell mod_wsgi to reload by using the touch command on evennia/game/web/utils/apache_wsgi.conf. When mod_wsgi 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 live instance of your site until reloaded.

If you are not running in daemon mode or want to force the issue, simply restart or reload apache2 to apply your changes.

Further notes and hints:

If you get strange (and usually uninformative) Permission denied errors from Apache, make sure that your evennia 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 /home directory.

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.

<Directory "/home/<yourname>/evennia/game/web">
                Options +ExecCGI
                Allow from all
</Directory>