这是hwl第二阶段的文件 、手动滑稽。。。
使用yum直接下载安装Nginx 如果要源码编译 请看另一篇 Linux配置Nginx服务器并配置本地Yum源
- 安装nginx
yum install nginx -y - 修改
/etc/nginx/nginx.conf中的user为root
注释 #include /etc/nginx/conf.d/*.conf;
添加
location / {
root /usr/share/nginx/html;
index index.html index.htm;
autoindex on;
}
3.重启服务 - 去/usr/share/nginx/html目录下创建一个目录soft。将nc包上传。
- yum install createrepo -y 下载createrepo
- 执行 createrepo -o /usr/share/nginx/html/soft ./ 命令生成文件夹
-----------------------------------------------------------------------以上服务器(10.0.88.245)的本地yum源制作完成,下面是用自己的 不用的虚拟机器 - 进入cd /etc/yum.repo.d
- 将其他 repo文件 改成 .repo.bak
- 创建自己的repo并写入
[base]
name=CentOS-Local
baseurl=http://10.0.88.245/
gpgcheck=0
enable=1 - 执行 yum repolist看自己的仓库,
- 执行 yum install nc -y下载nc命令。