yum仓库
- 服务器批量下载 rpm 包(光盘、下载、同步)
curl http://nginx.org/packages/centos/7/x86_64/RPMS/ > 1.txt
grep "gref" 1.txt | awk -F '"' '{print $2}' sed -r 's#(.*)#wget http://nginx.org/packages/centos/7/x86_64/RPMS/\1#g' > 2.txt
sh 2.txt
curl https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/ >1.txt
grep "href" 1.txt | awk -F '"' '{print $2}' | sed -r 's#(.*)#wget https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/\1#g' |bash
curl https://mirrors.aliyun.com/mongodb/yum/redhat/7/mongodb-org/3.0/x86_64/RPMS/ >1.txt
grep "href" 1.txt | awk -F '"' '{print $2}' | sed -r 's#(.*)#wget https://mirrors.aliyun.com/mongodb/yum/redhat/7/mongodborg/3.0/x86_64/RPMS/\1#g' |bash
yum install vsftpd -y
systemctl start vsftpd
setenforce 0
systemctl stop firewalld
- 将 rpm 包的目录制成仓库
yum install createrepo -y
createrepo /var/ftp/mongodb
createrepo /var/ftp/zabbix
createrepo /var/ftp/nginx
- 客户端配置源
vim /etc/yum.repos.d/ftp/mongodb.repo
[mongodb]
name = db
baseurl = ftp://10.0.0.200/mongodb/
enabled = 1
gpgcheck = 0
yum install mongodb-org
vim /etc/yum.repos.d/ftp_zabbix.repo
[zabbix-rep]
name = zabbix monitor
baseurl = ftp://10.0.0.200/zabbix/
enable = 1
gpgcheck = 0
yum install zabbix-agent
- 源码包管理
wget http://nginx.org/download/nginx-1.16.1.tar.gz
mkdir /soft
tar xf nginx-1.16.1.tar.gz -C /soft/
cd /soft/nginx-1.16.1/
./configure --prefix=/usr/local/nginx-1.16
make
make install
ln -s /usr/local/nginx-1.16/ /usr/local/nginx
systemctl stop httpd
/usr/local/nginx/sbin/nginx
./configure: error: the HTTP rewrite module requires the PCRE library.
yum install pcre-devel -y
./configure: error: the HTTP gzip module requires the zlib library.
yum install zlib-devel -y