wiki:AddingAMondoRescueMirror

Version 1 (modified by bruno, 5 years ago) (diff)

First version of the mirror instructions

First we suppose that you dedicate a directory to your MondoRescue mirror. Adapt to your taste/needs:

# mkdir -p /prj/ftp /prj/www

Then populate the content from the master MondoRescue server:

# cat > /usr/local/bin/mirror-mondo << EOF
rsync -av rsync.mondorescue.org::mondorescue-ftp /prj/ftp
rsync -av rsync.mondorescue.org::mondorescue-www /prj/www
EOF
# chmod 755 /usr/local/bin/mirror-mondo
# /usr/local/bin/mirror-mondo

Do that regularly (daily basis is preferred) with the appropriate crontab setup:

# cat >> /var/spool/cron/root << EOF
0 12 * * * /usr/local/bin/mirror-mondo
EOF

Once you get the content, setup your ftp and http servers to serve MondoRescue content (in my case vsftpd and apache):

# cat >> /etc/passwd << EOF
ftp:x:497:497:system user for vsftpd:/prj/ftp:/bin/false
ftpnobody:x:502:502::/var/empty:/sbin/nologin
EOF
# perl -pi -e 's/nopriv_user=.*/nopriv_user=ftpnobody/' /etc/vsftpd/vsftpd.conf
# perl -pi -e 's/ftp_username=.*/ftp_username=ftp/' /etc/vsftpd/vsftpd.conf
# /etc/init.d/vsftpd restart
# lftp localhost
lftp localhost:~> dir
drwxr-xr-x    4 ftp      ftp          4096 Mar 05  2009 asianux
drwxr-xr-x    2 ftp      ftp          4096 Mar 06  2007 audio
drwxr-xr-x    8 ftp      ftp          4096 Feb 16  2011 debian
[...]
drwxr-xr-x   14 ftp      ftp          4096 Nov 11 15:02 ubuntu
drwxr-xr-x    2 ftp      ftp          4096 Mar 05 16:44 video
# cat > /etc/httpd/conf.d/mondorescue.conf << EOF
NameVirtualHost x.y.z.t

<VirtualHost x.y.z.t>
    ServerName mondo.mirror.xx
    ServerAdmin webmaster@mondo.mirror.xx
    DocumentRoot /prj/www/html/mondorescue
    CustomLog /var/log/httpd/www.mondorescue.org/access_log combined
    Errorlog /var/log/httpd/www.mondorescue.org/error_log
    RewriteEngine On
    RewriteRule         ^/index\.html$  /index.shtml
    RewriteRule         ^/$  /index.shtml

    <Directory "/prj/www/html/mondorescue">
        DirectoryIndex index.shtml
        Options -Indexes MultiViews FollowSymLinks +Includes
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <Directory "/prj/www/html/mondorescue/ftp">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <Directory "/var/www/cgi-bin">
        AllowOverride All
        Options ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>
EOF
# /etc/init.d/httpd restart
# firefox http://x.y.z.t