Added configs for apt-mirror-server
This commit is contained in:
parent
f1c2906b58
commit
e3b8902143
25
apt-mirror-server/README.md
Normal file
25
apt-mirror-server/README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Configuration server for mirroring apt repositories.
|
||||||
|
|
||||||
|
First, need to install apt-mirror and nginx:<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
`apt install apt-mirror nginx`<br/>
|
||||||
|
<br/>
|
||||||
|
Second, create directory structure for repos:<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
`/DATA`<br/>
|
||||||
|
`├── iso`<br/>
|
||||||
|
`└── repos`<br/>
|
||||||
|
` ├── mirror`<br/>
|
||||||
|
` ├── skel`<br/>
|
||||||
|
` └── var`<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
Third, start apt-mirror for sync repos:<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
`apt-mirror`<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
Last, exit conf of nginx. Loock at examples.
|
24
apt-mirror-server/etc/apt/mirror.list
Normal file
24
apt-mirror-server/etc/apt/mirror.list
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#### START /etc/apt/mirror.list ####
|
||||||
|
|
||||||
|
set base_path /DATA/repos
|
||||||
|
set mirror_path $base_path/mirror
|
||||||
|
set skel_path $base_path/skel
|
||||||
|
set var_path $base_path/var
|
||||||
|
set cleanscript $var_path/clean.sh
|
||||||
|
set _autoclean 1
|
||||||
|
|
||||||
|
#set postmirror_script $var_path/postmirror.sh
|
||||||
|
set run_postmirror 0
|
||||||
|
|
||||||
|
set nthreads 40
|
||||||
|
set _tilde 0
|
||||||
|
|
||||||
|
deb-amd64 http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
|
||||||
|
deb-amd64 http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
|
||||||
|
deb-amd64 http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
|
||||||
|
|
||||||
|
deb-amd64 http://deb.debian.org/debian/ bookworm main/debian-installer main contrib non-free
|
||||||
|
|
||||||
|
clean http://ftp.us.debian.org/debian
|
||||||
|
|
||||||
|
#### End ####
|
34
apt-mirror-server/etc/apt/mirror.list.def
Normal file
34
apt-mirror-server/etc/apt/mirror.list.def
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
############# config ##################
|
||||||
|
#
|
||||||
|
# set base_path /var/spool/apt-mirror
|
||||||
|
#
|
||||||
|
# set mirror_path $base_path/mirror
|
||||||
|
# set skel_path $base_path/skel
|
||||||
|
# set var_path $base_path/var
|
||||||
|
# set cleanscript $var_path/clean.sh
|
||||||
|
# set defaultarch <running host architecture>
|
||||||
|
# set postmirror_script $var_path/postmirror.sh
|
||||||
|
# set run_postmirror 0
|
||||||
|
set nthreads 20
|
||||||
|
set _tilde 0
|
||||||
|
#
|
||||||
|
############# end config ##############
|
||||||
|
|
||||||
|
deb http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
deb-src http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
|
||||||
|
# mirror additional architectures
|
||||||
|
#deb-alpha http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-amd64 http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-armel http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-hppa http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-i386 http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-ia64 http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-m68k http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-mips http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-mipsel http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-powerpc http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-s390 http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
#deb-sparc http://ftp.us.debian.org/debian unstable main contrib non-free
|
||||||
|
|
||||||
|
clean http://ftp.us.debian.org/debian
|
37
apt-mirror-server/etc/nginx/sites-available/default
Normal file
37
apt-mirror-server/etc/nginx/sites-available/default
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Default server configuration
|
||||||
|
#
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
# Add index.php to the list if you are using PHP
|
||||||
|
|
||||||
|
index index.html index.htm index.nginx-debian.html;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
# First attempt to serve request as file, then
|
||||||
|
# as directory, then fall back to displaying a 404.
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /debian/ {
|
||||||
|
root /DATA/repos/mirror/deb.debian.org;
|
||||||
|
autoindex on;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /debian-security/ {
|
||||||
|
root /DATA/repos/mirror/security.debian.org;
|
||||||
|
autoindex on;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /iso/ {
|
||||||
|
root /DATA;
|
||||||
|
autoindex on;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
91
apt-mirror-server/etc/nginx/sites-available/default.def
Normal file
91
apt-mirror-server/etc/nginx/sites-available/default.def
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
##
|
||||||
|
# You should look at the following URL's in order to grasp a solid understanding
|
||||||
|
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
||||||
|
# https://www.nginx.com/resources/wiki/start/
|
||||||
|
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
||||||
|
# https://wiki.debian.org/Nginx/DirectoryStructure
|
||||||
|
#
|
||||||
|
# In most cases, administrators will remove this file from sites-enabled/ and
|
||||||
|
# leave it as reference inside of sites-available where it will continue to be
|
||||||
|
# updated by the nginx packaging team.
|
||||||
|
#
|
||||||
|
# This file will automatically load configuration files provided by other
|
||||||
|
# applications, such as Drupal or Wordpress. These applications will be made
|
||||||
|
# available underneath a path with that package name, such as /drupal8.
|
||||||
|
#
|
||||||
|
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
||||||
|
##
|
||||||
|
|
||||||
|
# Default server configuration
|
||||||
|
#
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
# listen [::]:80 default_server;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
#
|
||||||
|
# listen 443 ssl default_server;
|
||||||
|
# listen [::]:443 ssl default_server;
|
||||||
|
#
|
||||||
|
# Note: You should disable gzip for SSL traffic.
|
||||||
|
# See: https://bugs.debian.org/773332
|
||||||
|
#
|
||||||
|
# Read up on ssl_ciphers to ensure a secure configuration.
|
||||||
|
# See: https://bugs.debian.org/765782
|
||||||
|
#
|
||||||
|
# Self signed certs generated by the ssl-cert package
|
||||||
|
# Don't use them in a production server!
|
||||||
|
#
|
||||||
|
# include snippets/snakeoil.conf;
|
||||||
|
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
# Add index.php to the list if you are using PHP
|
||||||
|
index index.html index.htm index.nginx-debian.html;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
# First attempt to serve request as file, then
|
||||||
|
# as directory, then fall back to displaying a 404.
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# pass PHP scripts to FastCGI server
|
||||||
|
#
|
||||||
|
#location ~ \.php$ {
|
||||||
|
# include snippets/fastcgi-php.conf;
|
||||||
|
#
|
||||||
|
# # With php-fpm (or other unix sockets):
|
||||||
|
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
||||||
|
# # With php-cgi (or other tcp sockets):
|
||||||
|
# fastcgi_pass 127.0.0.1:9000;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# deny access to .htaccess files, if Apache's document root
|
||||||
|
# concurs with nginx's one
|
||||||
|
#
|
||||||
|
#location ~ /\.ht {
|
||||||
|
# deny all;
|
||||||
|
#}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Virtual Host configuration for example.com
|
||||||
|
#
|
||||||
|
# You can move that to a different file under sites-available/ and symlink that
|
||||||
|
# to sites-enabled/ to enable it.
|
||||||
|
#
|
||||||
|
#server {
|
||||||
|
# listen 80;
|
||||||
|
# listen [::]:80;
|
||||||
|
#
|
||||||
|
# server_name example.com;
|
||||||
|
#
|
||||||
|
# root /var/www/example.com;
|
||||||
|
# index index.html;
|
||||||
|
#
|
||||||
|
# location / {
|
||||||
|
# try_files $uri $uri/ =404;
|
||||||
|
# }
|
||||||
|
#}
|
Loading…
x
Reference in New Issue
Block a user