-
Notifications
You must be signed in to change notification settings - Fork 0
Install guide
These instructions will guide you through the process of setting up a reddit clone for the first time. We also have an automated install script for Ubuntu Linux.
Before continuing with this guide, make sure you have all of reddit's many dependencies installed. See one of the following guides for details.
This guide will assume that you are installing reddit as user reddit in the directory /home/reddit. If this is not the case, modify the examples accordingly.
Clone the git repository available here on github.
$ git clone git://github.com/reddit/reddit.gitOnce this is done, you'll need to install the python module dependencies.
$ cd reddit/r2
$ sudo python setup.py develop
$ makeThe setup.py script only needs to be run at installation time, but the Makefile will need to be rerun any time you modify a Cython file (*.pyx) so that the code can be compiled.
PostgreSQL is reddit's primary data store. It is used for storing data on Accounts, Subreddits, Links, Comments, Votes, etc. In production, we use many separate database clusters, but for sites with less traffic (or test instances) a single postgres database should suffice.
This section may be unnecessary on your system. Check if your installation of postgres created a default database and start scripts for you.
If one doesn't already exist, create an account for postgres to run under. This guide will assume the name postgres.
$ adduser postgresCreate a directory for postgres to store its data in.
$ sudo mkdir -p /usr/local/pgsql/data
$ sudo chown postgres /usr/local/pgsql/dataThen, initialize the database.
$ sudo -u postgres initdb -D /usr/local/pgsql/dataFinally, start up the server.
$ sudo -u postgres postgres -D /usr/local/pgsql/dataCreate a database for reddit's data.
$ createdb -E utf8 redditThen add reddit's SQL functions to the schema.
$ cd ~/reddit/
$ psql -U reddit reddit < sql/functions.sqlFor testing purposes, you can generate random test data for your reddit install.
$ cd ~/reddit/r2
$ paster shell example.ini>>> from r2.models import populatedb
>>> populatedb.populate()