____ _ | __ ) __ _ ___(_) ___ | _ \ / _` / __| |/ _ \ | |_) | (_| \__ \ | __/ |____/ \__,_|___/_|\___| Installing and deploying Basie on Linux using Apache ---------------------------------------------------- 0. Make sure you have the following pre-requisites installed: * python 2.5 (required) To install it type: sudo apt-get install python2.5 Note: If your distro ships with python higher than 2.5, you'll need to call it explicitly or otherwise use it instead of the default python version. * python-dev (required) To install it, type: sudo apt-get install python-dev * gcc (required) To install it, type: sudo apt-get install gcc * subversion (required) To install it type: sudo apt-get install subversion libsvn1 libsvn-dev python-subversion * setuptools (required) To install it type: sudo apt-get install python-setuptools Make sure that the version of setuptools is at least 0.6c9 * gettext (required) To install it type: sudo apt-get install xgettext (note: in case this install fails try: sudo apt-get install gettext) * apache2 (optional) To install it type: sudo apt-get install apache2 libapache2-mod-wsgi libapache2-svn Below, you will find a sample apache configuration file that will enable you to use Basie behind your apache server. Note: mod_wsgi 2.0 or later is requiered to authenticate against Django's user database from Apache. * apache portable runtime library (optional) To install it type: sudo aptitude install libapr1-dev * subvertpy (optional) By default subvertpy will be installed by basie's installation script but if you prefer to get subvertpy from your distro use: sudo apt-get install python-subvertpy (Note: If you are running Ubuntu 8.xx then python-subvertpy will not be available as a .deb package.) 1. wget http://basieproject.org/Basie-0.6.tar.gz 2. tar -xvf Basie-0.6.tar.gz 3. mv Basie-0.6 basie 4. cd basie 5. At this point you can either execute the installation script install.sh which will guide you through steps a-e (recommended) or you can edit basie/settings.py yourselves for specific installation variables and then perform the following steps: a. python2.5 bootstrap.py b. ./bin/buildout -v c. ./bin/django linkmedia Establishes links to CSS and other media files. d. ./bin/django syncdb During this step you will be asked whether you want to create a superuser for Basie's installation. If you select 'No', you can do it later by running "bin/django createsuperuser" See "bin/django help" for more details. e. ./bin/django compilemessages This will install translated languages for Basie. 7. You can check if the previous steps went well by running: a. bin/django test b. bin/django runserver (you will be able to see basie running on http://127.0.0.1:8000/) 8. Get permitions to apache user: a. sudo chown -R www-data: basie/var 9. Create the file /etc/apache2/sites-available/basie with the following contents -- keep in mind that this is only a template, and that you will have to replace PATH_TO_BASIE with an appropriate path. +--------------------------------------------------------------------------------+ ServerAdmin webmaster@localhost ServerName basie DocumentRoot PATH_TO_BASIE Alias /admin-media/ PATH_TO_BASIE/parts/django/django/contrib/admin/media/ Order deny,allow Allow from all Alias /media PATH_TO_BASIE/basie/media/ Order deny,allow Allow from all Options FollowSymLinks WSGIScriptAlias /basie PATH_TO_BASIE/bin/django.wsgi Order deny,allow Allow from all DAV svn SVNParentPath PATH_TO_BASIE/basie/var/repos AuthType Basic AuthName "Subversion repository" AuthBasicProvider wsgi WSGIAuthUserScript PATH_TO_BASIE/bin/auth AuthzSVNAccessFile PATH_TO_BASIE/basie/var/authz Satisfy Any Require valid-user +--------------------------------------------------------------------------------+ NOTE: The two aliases above enable links to Basie's and Django's CSS and Javascript files, as well as images etc. If you have more than one instance of basie running on the same server: example.org/stable/basie and example.org/sandbox/basie, you will have to include 'stable' or 'sandbox' on some configuration options in basie/settings.py (i.e. INSTANCE, MEDIA_URL, ADMIN_MEDIA_PREFIX, LOGIN_REDIRECT_URL). 10. cd /etc/apache2/sites-available sudo a2ensite basie sudo /etc/init.d/apache2 reload 11. Now, http://localhost/basie should be serving Basie's home page. If you don't want to run Basie on port 80, then you could wrap the above Apache configuration within a . Also, http://localhost/svn/ will be serving the subversion repositories. 12. Follow the instructions on apps/mail/README to configure the mailing lists using exim or postfix. 13. Setup a daemon process running 'bin/django runircbot' for the irc integration. External authentication ----------------------- If you need to enable external authentication of users via a validation script that checks the user's credentials against a database external to Basie (e.g. against /etc/shadow), then you need to provide an executable in PATH_TO_BASIE/basie/external_auth and declare the full path of this script in PATH_TO_BASIE/basie/settings.py at the setting EXTERNAL_BACKENDS. For instance: EXTERNAL_BACKENDS = ( (os.path.join(path('external_auth'), 'validate'), ('validate_file1', 'validate_file2')), ) You can find a sample validation program in PATH_TO_BASIE/basie/external_auth. validate.c accepts a username and a password and checks /etc/shadow and the given password files (optional). It returns one if the user's credentials are valid and zero otherwise. If you want to use it, then you need to compile the code before step 11. How to release Basie as a tar file ---------------------------------- Run bin/buildout setup . sdist in the directory where setup.py exists. The tar file will be created in /dist How to release Basie as an .egg ---------------------------------- Run bin/buildout setup . bdist_egg in the directory where setup.py exists. The .egg file will be created in /dist How to register and upload Basie on CheeseShop ---------------------------------------------- bin/buildout setup . sdist register upload