yum update 先安装一个nginx。
安装Nginx
yum install gcc gcc-c++ pcre pcre-devel openssl openssl-devel libtool zlib zlib-devel -y
cd /usr/local/src
wget http://nginx.org/download/nginx-1.22.0.tar.gz
tar -zxvf nginx-1.22.0.tar.gz
cd nginx-1.22.0
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
createrepo
yum install createrepo
server {
listen 99;
server_name 本机IP;
charset utf-8;
location /CentOS-7
{
autoindex on;
root /mnt/;
}
}
cd /mnt
下载包到这个目录
[base]
name=CentOS-Local
baseurl=http://对应地址
gpgcheck=0
enabled=1
yum repolist 看一下有没有 CentOS-Local