How to setup pushpool? How can I setup pushpool on my ubuntu dedi?

I have bitcoind up and running with latest blocks, what's next?
This guide will set up everything you need on a single machine.

Let's get started by setting up the environment:

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install automake gcc
sudo apt-get install libevent-dev libmemcached-dev libcurl4-openssl-dev zlib1g-dev libjansson-dev curl memcached


Depending on your distro some of these may not be available (libjansson-dev for example is not available on Lucid), and you may have to download and compile the sources.

Pushpool requires a database to work so we have to install either SQLite3 or MySQL. MySQL probably is the better choice, but SQLite3 suffices to just test pushpool:

sudo apt-get install libsqlite3-dev sqlite3


To get MySQL you'd instead install libmysql++-dev.

Next we download the pushpool source and extract it to /tmp/:

cd /tmp/
curl -s http://yyz.us/bitcoin/pushpool-0.5.1.tar.gz | tar -xvz
cd pushpool-0.5.1


Now let's get on with it by configuring, compiling and installing it into /opt/pushpool:

./configure --prefix=/opt/pushpool/
make
sudo make install
cd /opt/pushpool/


At this point we can quickly check that everything worked:

$ sbin/pushpoold -E -F
[2013-01-04 16:00:40.682356] config file(server.json): No such file or directory


All we need to do now is to configure the pushpool server.

sudo cp /tmp/pushpool-0.5.1/example-cfg.json /opt/pushpool/server.json
sudo nano /opt/pushpool/server.json


Here's mine for example:

{
        # network ports
        "listen" : [
                # binary protocol (default), port 8336
                { "port" : 8336 },

                # HTTP JSON-RPC protocol, port 8337
                { "port" : 8337, "protocol" : "http-json" }

        ],

        # database settings
        "database" : {
                "engine" : "sqlite3",
                "name" : "/tmp/data.sqlite",
                "stmt.pwdb" :
                  "SELECT password FROM pool_worker WHERE username = ?"

        },

        # cache settings
        "memcached" : {
                "servers" : [
                        { "host" : "127.0.0.1", "port" : 11211 }
                ]
        },

        "pid" : "/tmp/pushpoold.pid",

        # overrides local hostname detection
        "forcehost" : "localhost.localdomain",

        "log.requests" : "/tmp/request.log",
        "log.shares" : "/tmp/shares.log",

        # the server assumes longpolling (w/ SIGUSR1 called for each blk)
        "longpoll.disable" : false,

        # length of time to cache username/password credentials, in seconds
        "auth.cred_cache.expire" : 75,

        # RPC settings
        "rpc.url" : "http://127.0.0.1:8332/",
        "rpc.user" : "bitcoinrpc",
        "rpc.pass" : "bitcoinpassword",

        # rewrite returned 'target' to difficulty-1?
        "rpc.target.rewrite" : true,

        # allow clients to update the ntime field of their work
        "roll.ntime.disable" : false
}


And finally we get to the database setup:

sqlite3 /tmp/data.sqlite "CREATE TABLE pool_worker (username VARCHAR(32), password VARCHAR(32))"
sqlite3 /tmp/data.sqlite "INSERT INTO pool_worker VALUES ('username', 'password');


At this point we have created the database and inserted a new user called username and password password. Running sbin/pushpoold -E -F again will start the daemon.

Pointing your miner to http://username:password@127.0.0.1:8336/ should get you mining.