yum源的制作

第一步:准备需要的安装包

[root@compute1 tmp]# mkdir -pv /tmp/soft
cd /tmp/soft
[root@compute1 soft]# ll /tmp/soft
total 0
[root@compute1 soft]# yum install nginx --downloadonly --downloaddir=/tmp/soft
[root@compute1 soft]# ll /tmp/soft

  

提示不能使用--downloadonly的请先安装yum-utils软件

[root@compute1 soft]# yum -y install yum-utils
利用yum的参数,进行只下载,不安装,同时会下载对应依赖的软件

自建仓库
将上述app复制到客户内网机器,假设目录为/usr/app

[root@iZ25vh2zuf2Z ~]# cd /usr/app
[root@iZ25vh2zuf2Z app]# createrepo ./
createrepo命令不存在的,可以yum install createrepo进行安装

这样自行仓库就建立完成,然后/etc/yum.repos.d/添加对应的配置文件

  

rm -fr /etc/httpd/conf.d/welcome.conf

cp 1/* /var/www/html/ 

 

[bendi]
name = my repo
enabled = 1
gpgcheck = 0
baseurl = http://192.168.126.8

nginx制作方法


vim /etc/nginx/nginx.conf

server {
       listen 80;

       location / {
       root /usr/www/html;
       autoindex  no;

       }

}




原文地址:https://www.cnblogs.com/itzhao/p/11761466.html