Sunday, February 24, 2008

CPAN mirror SOP

3 steps note for how to mirror CPAN for fast installation in organization:

First, using rsync mirror whole CPAN to local machine. Write rsync -avHP --delete /var/www/CPAN >> /var/log/rsync.log 2>&1 into crontab for daily synchronization. This step supposes mirror site root is put at /var/www/CPAN.

Second, write apache VirtualHost as below.
<VirtualHost *>
ServerName cpan.yourdomain

DocumentRoot /var/www/CPAN
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /var/www/CPAN/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

ErrorLog /var/log/apache2/cpan-error.log

LogLevel warn

CustomLog /var/log/apache2/cpan-access.log combined
ServerSignature On


Restart your apache and access cpan.yourdomain. you can see it.

Third, register your mirror site at if you want to become a official mirror site.


No comments: