linux本地网络源服务器搭建(linux配置本地源)
一、下载软件包:
以kylin server V10为例,基础包的更新包分别下载。
wget https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/base/
wget https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/updates/
很长时间。。。以后下载完成。。。
二、安装配置nginx:
缺包去base目录找:
rpm -ivh nginx-1.21.5-5.p03.ky10.x86_64.rpm
编辑nginx配置文件:
vim /etc/nginx/nginx.conf
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
#打开目录浏览
autoindex on;
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
把下载的源文件拷贝到nginx主目录/usr/share/nginx/html/下。
启动nginx:
systemctl enable nginx
systemctl start nginx
用浏览器访问试试:
以上,源服务器搭好了。
三、需要用本地网络源的主机修改源文件:
[root@kylinser ~]# vim /etc/yum.repos.d/kylin_x86_64.repo
###Kylin Linux Advanced Server 10 - os repo###
[ks10-adv-os]
name = Kylin Linux Advanced Server 10 - Os
baseurl = https://192.168.1.168/NS/V10/V10SP3-2403/os/adv/lic/base/$basearch/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 1
[ks10-adv-updates]
name = Kylin Linux Advanced Server 10 - Updates
baseurl = https://192.168.1.168/NS/V10/V10SP3-2403/os/adv/lic/updates/$basearch/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 1
~
~
~
~
~
"/etc/yum.repos.d/kylin_x86_64.repo"
#更新源
yum clean all
yum makecache
然后就可以使用本地网络yum源啦。。。