Build a local Ubuntu backup storage

Source: Internet
Author: User
Build a local Ubuntu backup storage. requirement analysis recently, the company's software Team has the following requirement: can we build an Ubuntu image server on the LAN? the advantage of this is that it can save the installation time of some commonly used Ubuntu tools. II. deployment process 2. 1... build a local Ubuntu backup storage. requirement analysis recently, the company's software Team has the following requirement: can we build an Ubuntu image server on the LAN? the advantage of this is that it can save the installation time of some commonly used Ubuntu tools. II. deployment process 2.1 test environment currently there is a Ubuntu machine in the company that can connect to the Internet, IP address: 192.168.8.173, Ubuntu version: Ubuntu 9.04 i686. 2.2 setup steps to create a Ubuntu mirror server requires at least 60 GB of hard disk space. Each Ubuntu version has two versions: 32-bit and 64-bit, and two groups of deb packages are available. Of course, you can create a 32-bit and 64-bit image server for Ubuntu or all versions of images. Here, the mirror address of sohu is used as the local Ubuntu Source server. the reason for using sohu is: 1. sohu's Ubuntu Source server is quite fast 2. sohu's ubuntu Source server synchronizes with the official Ubuntu Server once a day, which ensures that we use the latest software package. The modification method is as follows: root @ ms ~: Cat/etc/apt/sources. listdeb http://mirrors.sohu.com/ubuntu/ Jaunty main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ Jaunty-security main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ Jaunty-updates main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ Jaunty-proposed main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ Jaunty-backports main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ Jaunty main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ Jaunty-security main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ Jaunty-updates main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ Jaunty-proposed main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ Jaunty-backports main restricted universe multiverse install the following tool: root @ ms ~: Apt-get install apt-plain root @ ms ~: Apt-get install apache2: build a local Ubuntu 9.04 32bit mirror server as an example to illustrate how to configure: modify the configuration file: root @ ms ~: Cat/etc/apt/mirror. list ############# config #################### set base_path/var/ spool/apt-mirror # set pai_path $ base_path/mirror # set skel_path $ base_path/skel # set var_path $ base_path/var # set cleanscript $ var_path/clean. sh # set defaultarch # Set postmir_script $ var_path/postmirror. shset run_postmirror 0 set nthreads 20 set _ tilde 0 ############### end config ############## deb-i386 http://mirrors.sohu.com/ubuntu Jaunty main restricted universe multiversedeb-i386 http://mirrors.sohu.com/ubuntu Jaunty-security main restricted universe multiversedeb-i386 http://mirrors.sohu.com/ubuntu Jaunty-updates main restricted universe multiverse # deb http://mirrors.sohu.comubuntu Jaunty-proposed main restricted universe multiverse # deb http://mirrors.sohu.comubuntu Jaunty-backports main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu Jaunty main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu Jaunty-security main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu Jaunty-updates main restricted universe multiverse # deb-src http://mirrors.sohu.com/ubuntu Jaunty-proposed main restricted universe multiverse # deb-src http://mirrors.sohu.com/ubuntu Jaunty-backports main restricted universe multiverse # clean http://archive.ubuntu.com/ubuntu Note: deb-i386 http: // indicates downloading the 32-bit deb software deb http: // indicates downloading the 64-bit version of deb software jaunty indicates that after the code setting of Ubuntu 9.04 is complete, enter the following command: root @ ms ~: Apt-mirror: at this time, the system will start 20 threads to run wget http://mirrors.sohu.com/Ubuntu Download the corresponding deb package. After the command is executed, all the required deb packages and corresponding configuration files are available in the/var/spool/apt-mirror directory. Since I downloaded the file from sohu, the actual file is in the/var/spool/apt-mirror/mirrors.sohu.com/ubuntu directory. In this way, all the files required by the Ubuntu Source server are stored locally, and the corresponding service is enabled: apache2 is used as the Web server. the default root directory is/var/www /, therefore, you can create a link in this directory, as shown below: root @ ms ~: Cd/var/wwwroot @ ms ~: Ln/var/spool/apt-mirror/mirrors.sohu.com/ubuntu-s enable web service: root @ ms ~: Apache2ctl start open the browser and enter the following address to view the page that is the same as sohu mirror: http://192.168.8.173/ubuntu You can also use crontab for daily updates and modify the configuration file: root @ ms ~: Cat/etc/cron. d/apt-mirror # Regular cron jobs for the apt-mirror package #0 4 *** apt-mirror/usr/bin/apt-mirror>/var/spool/ apt-mirror/var/cron. log removes "#" in front of the command, so that the system will automatically use apt-mirror to update with the sohu server. Finally, we need to modify and update the source configuration file on the client machine and change the address to the address of the local mirror server, as shown below: root @ ms ~: Cat/etc/apt/sources. listdeb http://192.168.8.173/ubuntu /Jaunty main restricted universe multiversedeb http://192.168.8.173/ubuntu /Jaunty-security main restricted universe multiversedeb http://192.168.8.173/ubuntu /Jaunty-updates main restricted universe multiversedeb http://192.168.8.173/ubuntu /Jaunty-proposed main restricted universe multiversedeb http://192.168.8.173/ubuntu /Jaunty-backports main restricted universe multiversedeb-src http://192.168.8.173/ubuntu /Jaunty main restricted universe multiversedeb-src http://192.168.8.173/ubuntu /Jaunty-security main restricted universe multiversedeb-src http://192.168.8.173/ubuntu /Jaunty-updates main restricted universe multiversedeb-src http://192.168.8.173/ubuntu /Jaunty-proposed main restricted universe multiversedeb-src http://192.168.8.173/ubuntu /Jaunty-backports main restricted universe multiverse execute "apt-get update" to re-create the local index. then, the local Mirror server will be used for updates.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.