[phpwiki] Debian Local Mirror

For organizations with many Debian machines, setting up a local mirror maybe a good idea to save Internet bandwidth and ensure consistency. This involves dedicating a section of the local web server as the mirror, setting updates of the mirror on a daily basis and pointing the local Debian machines to the mirror.

For those with the resources - bandwidth and disk-space, you can contribute by creating a push mirror. This will allow everyone inside and outside your organization to access your web-server as an official Debian mirror. Registration with Debian is required, see reference for details.

Always make proper backup before proceeding.
Please report problems and direct all inquiries to Contact US.


Prerequisites


Procedures

1. Choose a Primary Push Server

From the World Wide Mirror Site list on Debian, find a primary or secondary push server.

2. Anonftpsync Script Modification

Edit anonftpsync with your favourite editor.

  1. Add in the local mirror location in the "TO=" field,
  2. Add the Primary or Secondary push mirror you have chosen from the World Wide Mirror Site list in the "RSYNC_HOST=",
  3. Edit the "RSYNC_DIR=" field if need be.
  4. Add in the "LOGDIR=" field.
  5. Add architecture you want to exclude if you are doing a partial mirror. Note it is not a good idea to create a full mirror unless you have the bandwidth and the willingness to become a member of the "World Wide Mirror Site".
  6. Add in the exclusion list - "EXCLUDE=". e.g. If you only want stable releases, exclude unstable and testing.

3. Make Anonftpsync Script Executable

Change the file permission mode.

 # chmod 744 annoftpsync

4. Sync Local Server to Official Debian Mirror.

Run annoftpsync. You don't need to be root to run this script.

Suggestion - run the program in the background with "No Hang Up" will free you to to close your ssh session as the job may take a few days to complete depending on your bandwidth.

	nohup job &
	|         |
	|         +----- run in background.
	+--------------- don't stop after terminal session is close.
 $ nohup anonftpsync

After a successful completion, a utc date will be the content of a file in "../project/trace/<hostname>" under the mirror directory.

4. Schedule Regular Update

After the initial download, the local mirror will need to be resync every so often. Schedule an update at most once a day, less frequent update is recommended. Security updates can be specified separately. Schedule the annoftpsync in the crontab with the proper user id.

5. Publish Local Mirror

Setup your local apache web server with a link to the mirror directory.

3. Test and Verify

Check using your browser. If you can see the mirror contents, iit works, test the local repository by replacing the sources.list in the Debian clients with the local mirror address.


References


Page locked (last edited December 14, 2009) [info] [diff])
FindPage by browsing or searching
5 best incoming links: FrontPage (4)
5 best outgoing links:
5 most popular nearby: FrontPage (2047)