Home > Article > System Tutorial > Use Centos to build an open source mirror site
Building a mirror site requires three steps: find a faster domestic source, install and configure tomcat, and synchronize target source data.
Domestic sources are also synchronized with foreign official servers. We need to find domestic sources that support rsync. You can search the keyword [centos mirror station] on Baidu or use my recommended Tsinghua University open source software mirror station https://mirrors4. tuna.tsinghua.edu.cn/centos/.
Install
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24-fulldocs.tar.gz tar -zxvf apache-tomcat-8.5.24-fulldocs.tar.gz
Configuration
Set the specified directory as the resource directory
Set tomcat to display the soft link directory
Tomcat installation directory / conf directory: context.xml file, add the allowLinking="true" attribute to
Set up tomcat directory browsing
Official website address: https://tomcat.apache.org/
Link address: http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24-fulldocs.tar.gz
The synchronization source is to synchronize the data of the domestic mirror station to the local centos.
Create Folder
mkdir -p /data/centos mkdir -p /data/epel
Synchronize:
rsync -avrt rsync://mirrors4.tuna.tsinghua.edu.cn/centos/ /data/centos/ rsync -avrt rsync://mirrors4.tuna.tsinghua.edu.cn/epel/ /data/epel/
Scheduled tasks:
Write the above two lines of synchronization statements into the script yum_rsync.sh, vi /etc/crontab #Add the following code to the last line
0 1 * * * root /home/crontab/yum_rsync.sh #
Set to start executing the script at 1:00 a.m. every day, :wq! #Save and exit
service crond restart #重启
Finally, let me show you what the built mirror source looks like:
The above is the detailed content of Use Centos to build an open source mirror site. For more information, please follow other related articles on the PHP Chinese website!