Heapkeeper will be an editable mailing list web application.
Heapkeeper will be used at http://heapkeeper.org.
This section describes how to set up a Heapkeeper server on Debian or Ubuntu Linux using the nginx web server and the sqlite database engine. These steps apply only if you want to run no other web service. If you do want that, then you can adjust these steps accordingly.
$ sudo apt-get install nginx python-flup
$ sudo apt-get install python-sqlite sqlite3
Get Django: https://docs.djangoproject.com/en/1.3/topics/install/#installing-an-official-release
We used the following versions of these programs:
- Python: 2.7
- Django: 1.3
- nginx: 0.8
- sqlite3: 3.7
All of these are the default on the latest Ubuntu except for Django.
-
Create a Django project (this will create a directory called
Heapkeeper
with some Python files):$ django-admin.py startproject Heapkeeper
-
Clone the Heapkeeper repository as a Django application called
hk
:$ cd Heapkeeper $ git clone git://github.com/hcs42/heapkeeper.git hk
If you forked the Heapkeeper repository, use your own repository instead:
$ cd Heapkeeper $ git clone [email protected]:<username>/heapkeeper.git
-
Edit
settings.py
(you will find an example inhk/setup/settings.py
):DATABASES
: fill it in according to the database you want to use. I used sqlite.ADMIN_ROOT
: change it to'/admin/media/'
LOGIN_REDIRECT_URL
: set it to'..'
MIDDLEWARE_CLASSES
: insert'django.middleware.locale.LocaleMiddleware'
afterSessionMiddleware
INSTALLED_APPS
: append'django.contrib.admin'
and'hk'
- Anything else you want to customize (e.g. timezone)
- Move the
DEBUG
andTEMPLATE_DEBUG
variables intodebug_settings.py
(see the next step)
-
Create
debug_settings.py
(you will find an example inhk/setup/debug_settings.py
):DATABASES
: fill it in- Move the
DEBUG
andTEMPLATE_DEBUG
variables here fromsettings.py
(see the previous step)
-
Overwrite
urls.py
with the one in thesetup
directory:$ cp hk/setup/urls.py .
-
Set up the database files. When asked about whether to create a superuser, create them.
$ python manage.py syncdb $ python manage.py syncdb --settings=debug_settings
-
Copy the startup scripts and change the ports in them if you need to:
$ cp hk/setup/start_debug.sh hk/setup/start_debug.sh . $ vim hk/setup/start_debug.sh hk/setup/start_debug.sh
-
Start the server in debug mode:
$ ./start_debug.sh
Try it from the browser:
$ google-chrome http://localhost:8002
Finally close it:
Kill `start_debug.sh` with CTRL-C
-
Perform the following steps as root:
Rename the original nginx configuration file:
# mv /etc/nginx/nginx.conf{,.old}
Copy the provided config file instead and modify its content to match your paths:
# cp hk/setup/nginx.conf /etc/nginx/nginx.conf # vim /etc/nginx/nginx.conf
Restart nginx:
# /etc/init.d/nginx restart
-
Start the production server, try it and kill it:
$ ./start_production $ google-chrome http://localhost/ Kill start_production with CTRL-C
-
Set up the name of your site:
$ python manage.py shell >>> from django.contrib.sites.models import Site >>> s = Site.objects.get(pk=1) >>> s.domain = 'mysite.org' >>> s.name = 'Heapkeeper' >>> s.save()
-
Set up SMTP server and configure Django to use it. See more information here: https://docs.djangoproject.com/en/1.3/topics/email/
In Debian or Ubuntu, Heapkeeper can be set to start up automatically by performing the following steps as root.
-
Copy the provided init script to the directory of the init scripts:
# cp hk/setup/heapkeeper.d /etc/init.d/heapkeeper
-
Modify the
SITE_PATH
variable in it to<path to heapkeeper>/Heapkeeper
and modifyRUN_AS
to your Linux username:# vim /etc/init.d/heapkeeper
-
Try the script:
# /etc/init.d/heapkeeper start $ google-chrome http://localhost/ # web page is there # /etc/init.d/heapkeeper stop $ google-chrome http://localhost/ # web page is not there
-
Run
update-rc.d
to create symbolic links in the/etc/rc*.d/
directories, which will make operating system call/etc/init.d/heapkeeper
automatically with thestart
parameter after the system has booted, and with thestop
parameter before it shuts down.# update-rc.d heapkeeper defaults
You will be able to read the user documentation at http://heapkeeper.org/help.