First, make sure you have the following software installed:
- Apache2
- mod_wsgi
- python
- virtualenv
- mysql-server
On ubuntu, sudo apt-get install apache2 libapache2-mod-wsgi python-virtualenv mysql-server should suffice.
To create the database and user homunculus will use, enter the following in a mysql-shell:
CREATE DATABASE homunculus;
GRANT ALL PRIVILEGES ON *.* TO 'homunculus'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Then, choose a directory where you want to install homunculus. In this example, we assume /var/www/homunculus
$ mkdir -p /var/www/homunculus
$ mkdir -p /var/www/homunculus/data
$ mkdir -p /var/www/homunculus/data/webserver/apache
$ cd /var/www/homunculus
To install the dependencies in a virtualenv and create a runner, run this:
$ virtualenv --no-site-packages pythonenv
$ pythonenv/bin/pip install homunculus_server mysql-python
Copy the file examples/runner.wsgi into /var/www/homunculus, and edit it, so that it fits your needs.
Add the following lines to your apache config:
Include /var/www/homunculus/data/webserver/apache
<VirtualHost *>
ServerName homunculus.example.com
WSGIScriptAlias / /var/www/homunculus/runner.wsgi
</VirtualHost>
Homunculus needs privileges to restart the webserver, via sudo /etc/init.d/apache2 reload. To grant these privileges, on ubuntu/debian edit your sudoers file, and append the following:
www-data ALL = NOPASSWD: /etc/init.d/apache2
Make sure, all files beneath /var/www/homunculus are writeable by the webserver. Assuming the webserver’s user is www-data, you can achieve that by this command:
sudo chown www-data:www-data -R /var/www/homunculus
Restart apache. The command is something like /etc/init.d/apache2 reload, reload apache2 or simimlar, and depends on your OS.
With a webbrowser, visit http://homunculus.example.com/migrations/ and click “Execute all”
Go to http://homunculus.example.com. Homunculus should now be running.