| 1 | First we suppose that you dedicate a directory to your !MondoRescue mirror. Adapt to your taste/needs: |
| 2 | |
| 3 | {{{ |
| 4 | # mkdir -p /prj/ftp /prj/www |
| 5 | }}} |
| 6 | |
| 7 | Then populate the content from the master !MondoRescue server: |
| 8 | |
| 9 | {{{ |
| 10 | # cat > /usr/local/bin/mirror-mondo << EOF |
| 11 | rsync -av rsync.mondorescue.org::mondorescue-ftp /prj/ftp |
| 12 | rsync -av rsync.mondorescue.org::mondorescue-www /prj/www |
| 13 | EOF |
| 14 | # chmod 755 /usr/local/bin/mirror-mondo |
| 15 | # /usr/local/bin/mirror-mondo |
| 16 | }}} |
| 17 | |
| 18 | Do that regularly (daily basis is preferred) with the appropriate crontab setup: |
| 19 | |
| 20 | {{{ |
| 21 | # cat >> /var/spool/cron/root << EOF |
| 22 | 0 12 * * * /usr/local/bin/mirror-mondo |
| 23 | EOF |
| 24 | }}} |
| 25 | |
| 26 | Once you get the content, setup your ftp and http servers to serve !MondoRescue content (in my case vsftpd and apache): |
| 27 | {{{ |
| 28 | # cat >> /etc/passwd << EOF |
| 29 | ftp:x:497:497:system user for vsftpd:/prj/ftp:/bin/false |
| 30 | ftpnobody:x:502:502::/var/empty:/sbin/nologin |
| 31 | EOF |
| 32 | # perl -pi -e 's/nopriv_user=.*/nopriv_user=ftpnobody/' /etc/vsftpd/vsftpd.conf |
| 33 | # perl -pi -e 's/ftp_username=.*/ftp_username=ftp/' /etc/vsftpd/vsftpd.conf |
| 34 | # /etc/init.d/vsftpd restart |
| 35 | # lftp localhost |
| 36 | lftp localhost:~> dir |
| 37 | drwxr-xr-x 4 ftp ftp 4096 Mar 05 2009 asianux |
| 38 | drwxr-xr-x 2 ftp ftp 4096 Mar 06 2007 audio |
| 39 | drwxr-xr-x 8 ftp ftp 4096 Feb 16 2011 debian |
| 40 | [...] |
| 41 | drwxr-xr-x 14 ftp ftp 4096 Nov 11 15:02 ubuntu |
| 42 | drwxr-xr-x 2 ftp ftp 4096 Mar 05 16:44 video |
| 43 | # cat > /etc/httpd/conf.d/mondorescue.conf << EOF |
| 44 | NameVirtualHost x.y.z.t |
| 45 | |
| 46 | <VirtualHost x.y.z.t> |
| 47 | ServerName mondo.mirror.xx |
| 48 | ServerAdmin webmaster@mondo.mirror.xx |
| 49 | DocumentRoot /prj/www/html/mondorescue |
| 50 | CustomLog /var/log/httpd/www.mondorescue.org/access_log combined |
| 51 | Errorlog /var/log/httpd/www.mondorescue.org/error_log |
| 52 | RewriteEngine On |
| 53 | RewriteRule ^/index\.html$ /index.shtml |
| 54 | RewriteRule ^/$ /index.shtml |
| 55 | |
| 56 | <Directory "/prj/www/html/mondorescue"> |
| 57 | DirectoryIndex index.shtml |
| 58 | Options -Indexes MultiViews FollowSymLinks +Includes |
| 59 | AllowOverride None |
| 60 | Order allow,deny |
| 61 | Allow from all |
| 62 | </Directory> |
| 63 | |
| 64 | <Directory "/prj/www/html/mondorescue/ftp"> |
| 65 | Options Indexes MultiViews FollowSymLinks |
| 66 | AllowOverride None |
| 67 | Order allow,deny |
| 68 | Allow from all |
| 69 | </Directory> |
| 70 | |
| 71 | <Directory "/var/www/cgi-bin"> |
| 72 | AllowOverride All |
| 73 | Options ExecCGI FollowSymLinks |
| 74 | Order allow,deny |
| 75 | Allow from all |
| 76 | </Directory> |
| 77 | |
| 78 | </VirtualHost> |
| 79 | EOF |
| 80 | # /etc/init.d/httpd restart |
| 81 | # firefox http://x.y.z.t |
| 82 | }}} |