Difference between revisions of "How to become a resource repository mirror"

From Armagetron
 
(7 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
** mod_rewrite
 
** mod_rewrite
 
** ability to edit Apache vhost config
 
** ability to edit Apache vhost config
 +
** mod_php 4+
 
* rsync
 
* rsync
 
* One of:
 
* One of:
Line 11: Line 12:
 
=== Mirror Number ===
 
=== Mirror Number ===
 
Ask [[User:Luke-Jr|Luke]] for a mirror number. Be sure to include your machine's IP address(es). References to this mirror number below are in English. For example, 'one' and 'two'.
 
Ask [[User:Luke-Jr|Luke]] for a mirror number. Be sure to include your machine's IP address(es). References to this mirror number below are in English. For example, 'one' and 'two'.
 +
 +
=== Sync Document Root ===
 +
You probably don't want to run this as root:
 +
mkdir -p /var/www/armagetron/resource
 +
rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource/
  
 
=== Setup Apache ===
 
=== Setup Apache ===
Line 20: Line 26:
 
     DocumentRoot /var/www/armagetron/resource/htdocs
 
     DocumentRoot /var/www/armagetron/resource/htdocs
 
     UseCanonicalName On
 
     UseCanonicalName On
 +
</VirtualHost>
 +
<Directory "/var/www/armagetron/">
 
     AllowOverride All
 
     AllowOverride All
     Options SymLinks
+
     Options FollowSymLinks
  </VirtualHost>
+
    Order allow,deny
 +
    Allow from all
 +
  </Directory>
  
 
With Gentoo, this should be <code>/etc/apache2/vhosts.d/02_armagetronad.conf</code>
 
With Gentoo, this should be <code>/etc/apache2/vhosts.d/02_armagetronad.conf</code>
Line 28: Line 38:
 
After setting up apache, you need to reload your configuration :)
 
After setting up apache, you need to reload your configuration :)
  
=== Sync Document Root ===
+
=== Automatic Updating ===
You probably don't want to run this as root:
+
==== Cron ====
mkdir -p/var/www/armagetron/resource
+
Put in a crontab that gets run daily or hourly (with non-root permissions):
 
  rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource
 
  rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource
 +
You may wish to append <code>&amp;&gt;/dev/null</code> so you don't get logs every time.
 +
 +
Using this method, your server will redirect to the master mirror when it doesn't have a resource.
 +
 +
==== Armabot ====
 +
Armabot is our bot that handles IRC and also updates things when there are changes.
 +
 +
Add to your SSH account's <code>~/.ssh/authorized_keys</code> file:
 +
command="rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtW5agPIL23MDpL6zFhJnLumv0pQrpIz7QkTlBbZ60KTVN0xITrVB7cf/Uphx7+WFYSde42Sf666jomDRu9ZwkBauGQjvKH7BlWRuLnFazdSd3X4jSEhAl38pQI/dV7QhUP0lBpIGv25h40S6YG1QwxQII4+BkbzoPIJs4RM4Pmn5piTN7OHdT/S8XxT/oVPiU1WrD08ewjxS7fawfQ31NKcAApDl5IFUkHY0+Zqzk0QACuWRRGTSa8h051JUWAnkEfNEg75PIstA6sgzXFqVcJLD4Mvk8sKkBqITniX8btxzW9kSfo/bzdgfx6C8X2r2ES/cY1ttTnp4Gb32GzuvXw== supybot@butler
 +
 +
Now, contact [[User:wrtlprnft|wrtlprnft]] to add a notifier for resource additions.
 +
 +
Using this method, you should always have all the latest resources.
 +
 +
=== Activate Mirror ===
 +
Inform [[User:Luke-Jr|Luke]] that you're done. He'll check your mirror to make sure it's sane and put it in the round-robin.
 +
 +
[[Category:Development]]

Latest revision as of 12:27, 23 August 2021

Requirements

  • Apache 2
    • mod_rewrite
    • ability to edit Apache vhost config
    • mod_php 4+
  • rsync
  • One of:
    • cron
    • ssh account

Mirror Setup

Mirror Number

Ask Luke for a mirror number. Be sure to include your machine's IP address(es). References to this mirror number below are in English. For example, 'one' and 'two'.

Sync Document Root

You probably don't want to run this as root:

mkdir -p /var/www/armagetron/resource
rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource/

Setup Apache

Add to your vhost configuration:

<VirtualHost *:80>
    ServerName mirror-number.resource.aa.dashjr.org
    ServerAlias resource.armagetronad.net *.resource.armagetronad.net resource.aa.dashjr.org *.resource.aa.dashjr.org
    ServerPath /
    DocumentRoot /var/www/armagetron/resource/htdocs
    UseCanonicalName On
</VirtualHost>
<Directory "/var/www/armagetron/">
    AllowOverride All
    Options FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

With Gentoo, this should be /etc/apache2/vhosts.d/02_armagetronad.conf

After setting up apache, you need to reload your configuration :)

Automatic Updating

Cron

Put in a crontab that gets run daily or hourly (with non-root permissions):

rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource

You may wish to append &>/dev/null so you don't get logs every time.

Using this method, your server will redirect to the master mirror when it doesn't have a resource.

Armabot

Armabot is our bot that handles IRC and also updates things when there are changes.

Add to your SSH account's ~/.ssh/authorized_keys file:

command="rsync --delete -a rsync://master.resource.aa.dashjr.org/armagetron-resource/ /var/www/armagetron/resource" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtW5agPIL23MDpL6zFhJnLumv0pQrpIz7QkTlBbZ60KTVN0xITrVB7cf/Uphx7+WFYSde42Sf666jomDRu9ZwkBauGQjvKH7BlWRuLnFazdSd3X4jSEhAl38pQI/dV7QhUP0lBpIGv25h40S6YG1QwxQII4+BkbzoPIJs4RM4Pmn5piTN7OHdT/S8XxT/oVPiU1WrD08ewjxS7fawfQ31NKcAApDl5IFUkHY0+Zqzk0QACuWRRGTSa8h051JUWAnkEfNEg75PIstA6sgzXFqVcJLD4Mvk8sKkBqITniX8btxzW9kSfo/bzdgfx6C8X2r2ES/cY1ttTnp4Gb32GzuvXw== supybot@butler

Now, contact wrtlprnft to add a notifier for resource additions.

Using this method, you should always have all the latest resources.

Activate Mirror

Inform Luke that you're done. He'll check your mirror to make sure it's sane and put it in the round-robin.