My favorites | Sign in
Project Logo
                
Search
for
Updated Jan 04, 2008 by sir.steve.h
Labels: Featured
Installation  
Rough setup instructions

Introduction

The latest version of this can be found in SVN; I will probably update that more frequently than this. I'm also too lazy to add my docs to the wiki dir right now.

Contents

Torrentbarf uses Django, a Python framework for creating Web applications. The advantage of this is that Django not only automates tasks that PHP coders do by hand time and time again, but it is also designed to scale extremely well (not only by allowing multiple servers to run the application, but with verious caching elements that I haven't set up yet). There are also various apps already written for Django that I plan to customize just for this project.

To set up Django, you should probably consult the manual at http://www.djangoproject.com/ or alternatively the free online book at http://www.djangobook.com/. Here are the steps that I used to set mine up (on Arch Linux, a very lightweight distribution):

First, install Django. On Arch, that means pacman -S django, your mileage may vary.

Next, install lighttpd (pacman -S lighttpd). While it's very possible to use Apache + mod_python with Django, lighttpd is a much faster, lighter server that will allow us to simply pass most requests to the Django FastCGI process. It also performs very well with static files (our /media directory).

To configure lighttpd, you can simply use the example lighttpd.conf provided; all you need to know is that django uses fastcgi to communicate with the Web server, and that the server uses a socket on /tmp/tracker.sock to interface with fastcgi.

Don't forget to copy or symlink the admin media into the Web server root, so the admin interface doesn't look bland.

cp -R /usr/lib/python2.5/site-packages/django/contrib/admin/media /srv/www/htdocs

Next, edit settings.py to suit your needs, particularly the database, root URL, admin name, etc.

Install mysql. There are docs all over the internet, and this can be as easy or hard as you need it to be. If you're tuning a database for tens of thousands of users, then you should be looking at more than a quick install guide for help.

Finally, copy the provided rc.tracker into your init scripts and make sure it's executable:

cp rc.tracker /etc/rc.d/tracker
chmod 770 /etc/rc.d/tracker

You should now be ready to run the server. Since django and lighttpd are separate processes, you have to start them separately. Both servers will go straight to the background if there are no configuration errors.

lighttpd -f /etc/lighttpd/lighttpd.conf
/etc/rc.d/tracker start

There is now a script in the codebase, db_install.sh, which will cover the rest of the installation. Enter your database's root username (default is root) and password. These are used for setup only. This takes the database name, user, and password from settings.py and adds the appropriate privs.

./db_install.sh

Sign in to add a comment
Hosted by Google Code