First, create the user that will run PyCS. Log in as this user. You will probably have to do something like this: |
First, you need to have a PostgreSQL server ready. It can be on the local machine, or on another machine on the network. Now, create the user that will run PyCS. Log in as this user. You will probably have to do something like this: |
Now set up your PostgreSQL database. You need to create a database called 'pycs' and a user called 'pycs', then edit pg_hba.conf to allow TCP access to the database. Detailed instructions are in the README file that will be in ~/src/pycs/README. |
First, you need to have a PostgreSQL server ready. It can be on the local machine, or on another machine on the network.
Now, create the user that will run PyCS. Log in as this user. You will probably have to do something like this:
(Note: you want to do the rest of these instructions as the www-pycs user. If you do them as root, you will end up with a copy of PyCS that runs as root, and lives inside /root, which probably isn't what you want.)
Now, create a directory to hold all the code for things we are about to compile.
Now, get Python (the latest version) from http://www.python.org/download/ ...
And compile it:
(This makes a private copy of Python, just for your community server).
Now, get the PyXML source from http://pyxml.sourceforge.net/ - this isn't really needed if you only have small changes on your system, but improves performance drastically if you have larger upstreams, as the XML parser in Python is written in Python and this package contains a parser based on expat (a parser written in C).
And now compile and install it:
Now, get MetaKit from http://www.equi4.com/pub/mk/ and compile it:
(Now we have a copy of MetaKit installed, with the Python extension enabled).
Now, get the PyCS code:
Download Medusa:
Now install PyCS:
NB: this is a GNU-style Makefile, so if you are on a platform that doesn't use GNU Make by default, e.g. FreeBSD?, you probably want to say gmake install ... instead of make install ....
Now set up your PostgreSQL database. You need to create a database called 'pycs' and a user called 'pycs', then edit pg_hba.conf to allow TCP access to the database. Detailed instructions are in the README file that will be in ~/src/pycs/README.
Now edit $HOME/pycs/etc/pycs/pycs.conf:
Phew! I think that's it ;-)
Test it to make sure it goes:
You should see some startup notes. If everything looks good, go to http://yourserver:5445/ and make sure the front page shows up.
Congratulations - you now have a working PythonCommunityServer!
Note that the server is running on port 5445, but the URLs it will pass out to users will be for port 80; PyCS assumes that it will be running on a machine which already has a web server (configured as a front-end proxy) on port 80. As such, you need to do one of the following:
If you use manila-style addresses, you should put in an equivalent ServerAlias directive, for example like:
And don't forget to set up an * A record in your domain to point to your webserver.
If you don't like the default login page (and you aren't expected to like it), copy $HOME/src/pycs/www/index.html to local_index.html, edit that, and run make install again (as above) to copy it into the right place.
To find out how to give people friendly URLs (like http://www.pycs.net/devlog/ rather than http://www.pycs.net/users/0105568/), look at the instructions in the file $HOME/pycs/etc/rewrite.conf.
If you want to password-protect some blogs or your whole server, create a file called $HOME/pycs/etc/pycs/users.conf and put in one line per user you want to create. Read authorizer.py for more information on the format. Basically it's:
username:md5 hash of password:comma separated list of things the user can get at
To make some of the server public, make a user with no name and password. To allow everyone to get at the front page and updates, for example, put in the following line:
::public
Edit /etc/init.d/pycs and change ROOTDIR to point to your root dir (/home/www-pycs/pycs if you followed the instructions above for installation).
Now you need to set up your rc*.d symlinks. On Debian, you can do it like this:
This doesn't work yet, but when it does, you'll want to install pyPgSQL and mxDateTime like this:
1. install mxDateTime from http://starship.python.net/~lemburg/mxDateTime.html
2. install pyPgSQL from http://pypgsql.sourceforge.net/