Mirroring PGXN

Hosting a PGXN mirror is simple. All you need is:

  • A reasonably fast internet connection
  • Space for storage—not much at this point
  • An rsync client
  • A web server

The rsync address for the PGXN master mirror is rsync://master.pgxn.org/pgxn.

Once you have the rsync client installed on your system and the disk space mapped out, add an entry to your crontab like so:

0 20 * * * /usr/bin/rsync -az --delete rsync://master.pgxn.org/pgxn /usr/local/pgxn

On Windows, use AT like so:

AT 20:00 /every:M,T,W,Th,F,S,Su "C:\\Program Files\\Rsync\\rsync -az --delete rsync://master.pgxn.org/pgxn C:\\Projects\\PGXN"

Please do not sync more than once every hour. And realistically you only need to sync once or twice a day. Next, set up a web server to serve the mirror. If your rsync is already in the subdirectory of a web server root, you should be golden. Otherwise, if you’re using Apache, you can set up a virtual host like so (assuming that you’re rsyncing to /usr/local/pgxn):

<VirtualHost *:80>
  DocumentRoot /usr/local/pgxn
  ServerName pgxn.example.org
  CustomLog /var/log/httpd/access_log combined
  <Directory /usr/local/pgxn>
    AllowOverride All
    Allow from all
    Options +Indexes
  </Directory>
</VirtualHost>

For Nginx, you set set up a virtual host like this:

server {
    listen       80;
    server_name  pgxn.example.org;
    charset      utf-8;
    location / {
        root   /var/local/pgxn;
        index  index.html;
    }
}

If you’d like to register your mirror, send us email with all the details and we’ll get you registered.