1. build a network depot
Server: 10.0.0.201
1. Prepare a software package (CD 1. 2. 3. Networking cache synchronization download 4.)
1.挂载光盘 mount /dev/cdrom
2. ftp share package store directory
yum install vsftpd -y systemctl start vsftpd systemctl enable vsftpd systemctl stop firewalld setenforce 0
3. The package CD-ROM are copied to the shared directory of ftp
mkdir /var/ftp/centos7/ find /mnt/ -type f -name "*.rpm" -exec cp {} /var/ftp/centos7 \;
4. Sharing yum repository
yum install createrepo -y createrepo /var/ftp/centos7
Client: 10.0.0.101
1. Close all public yum repository
gzip /etc/yum.repos.d/*
2. Create a new repo file, the file server baseurl point
vim /etc/yum.repos.d/centos.repo [centos7] name = centos7_local baseurl = ftp://10.0.0.101/centos7 gpgcheck=0 enabled=1
3. Does the test can install the software
yum install httpd -y
2. build zabbix nginx
服务端:10.0.0.201
1.服务端需要提供zabbix软件相关的仓库
[root@yinwucheng ~]# mkdir /var/ftp/zabbix
-------------获取zabbix的软件包-------->
curl https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/ > zabbix_1.txt
grep "<a href" zabbix_1.txt
grep "<a href" zabbix_1.txt | awk -F '"' '{print $2}'
grep "<a href" zabbix_1.txt | awk -F '"' '{print $2}' > zabbix_2.txt
grep "<a href" zabbix_1.txt | awk -F '"' '{print "https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}'
grep "<a href" zabbix_1.txt | awk -F '"' '{print "wget https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}'
grep "<a href" zabbix_1.txt | awk -F '"' '{print "wget https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/"$2}' > zabbix_3.txt
chmod +x zabbix_3.txt
./zabbix_3.txt
2. zabbix还需要下载的四个软件包
http://repo.zabbix.com/non-supported/rhel/7/x86_64/
zabbix还缺少的四个软件包
wget http://repo.zabbix.com/non-supported/rhel/7/x86_64/fping-3.10-1.el7.x86_64.rpm
wget http://repo.zabbix.com/non-supported/rhel/7/x86_64/iksemel-1.4-2.el7.centos.x86_64.rpm
wget http://repo.zabbix.com/non-supported/rhel/7/x86_64/iksemel-devel-1.4-2.el7.centos.x86_64.rpm
wget http://repo.zabbix.com/non-supported/rhel/7/x86_64/iksemel-utils-1.4-2.el7.centos.x86_64.rpm
[root@yinwucheng ~]# find ./ -type f -name "*.rpm" -exec mv {} /var/ftp/zabbix/ \;
3.将zabbix目录生成为一个yum仓库
[root@oldboy ~]# createrepo /var/ftp/zabbix/
客户端:10.0.0.101
1.客户端新建一个repo文件指向服务端提供的zabbix仓库 10.0.0.201
[root@yinwucheng ~]# cat /etc/yum.repos.d/ftp-zabbix.repo
[ftp-zabbix]
name = ftp share zabbix repo
baseurl = ftp://10.0.0.201/zabbix/
enable = 1
gpgcheck = 0
2.客户端测试zabbix仓库是否可用
[root@yinwucheng ~]# yum clean all
[root@yinwucheng ~]# yum install zabbix-agent
[root@yinwucheng ~]# yum install zabbix-get
[root@yinwucheng ~]# yum install zabbix-server
3.若正常安装,则zabbix源完美搭建完毕!
3. source package management practices
1. What is the source package
Source package refers to the development of good writing program source code, but did not compile it into a tool normally used.
2. Why learn source package
- 1, only part of the software to provide the official website source package, it is necessary to compile and install.
- 2, part of the software in the new version has some features not had time to make an rpm, you can compile your own software using its new features.
3. The advantages and disadvantages of source packages
- 1 can modify the source code
- 2. Can customized needs related functions
- 3. The new version of the software update source priority
- 4. The disadvantages are:
- 1) relative yum install a lot of software complexity. 2) standardization of implementation difficulties, can not be automated landing.
4. How to get source packages
Common packages are source packages can be obtained at the official website, such as apache, nginx, mysql, etc.
5. Source Package compiled into binary executable steps, referred to as installation trilogy
1. Download source archives
2. unpack
[root @ yinwucheng ~] # tar xf nginx-1.16.1.tar.gz
- ./configure Configuration
./configure --prefix=/usr/local/nginx-1.16 --with-http_mp4_module
yum install pcre pcre-devel -y
./configure --prefix=/usr/local/nginx-1.16 --with-http_mp4_module
yum install zlib zlib-devel -y
./configure --prefix=/usr/local/nginx-1.16 --with-http_mp4_module
4. Compile
[root@yinwucheng nginx-1.16.1]# make
5. Installation
[root@yinwucheng nginx-1.16.1]# make install
6. checks whether the command is executed successfully
echo $?
7. Create a soft link
[root@yinwucheng ~]# ln -s /usr/local/nginx-1.16/ /usr/local/nginx
8. Run
/usr/local/nginx/sbin/nginx
9. Finally browser to access the server's IP address, and thus the installation was successful shots are as follows: