nginx做yum源
我这边环境是原先有个nginx只是做了代理转发,现在需要在通过nginx做yum源方便后期安装源
1、原先的配置代理转发,为不影响原先配置及端口,在http中最末尾加“include include /local/nginx/conf.d/*.conf;” 加载其它配置文件。
nginx所在服务器地址是10.7.12.10
#cat /local/nginx/conf/nginx.conf user nginx nginx;
worker_processes ; pid /local/nginx/run/nginx/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'$upstream_addr $upstream_response_time $request_time ';
log_format log404 '$status [$time_local] $remote_addr $host$request_uri $sent_http_location'; access_log logs/nginx/access.log main;
access_log logs/nginx/host.access..log log404; sendfile on; keepalive_timeout ; server {
listen ;
server_name localhost;
large_client_header_buffers 128k;
client_max_body_size 300m;
client_body_buffer_size 128k;
proxy_connect_timeout ;
proxy_read_timeout ;
proxy_send_timeout ;
proxy_buffer_size 64k;
proxy_buffers 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k; location /status{
stub_status on;
access_log on;
auth_basic "status";
auth_basic_user_file htpasswd;
} location /nk {
index index.html index.htm index.jsp;
proxy_pass http://10.7.12.15:8081/nk;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host:$server_port;
} error_page /50x.html;
location = /50x.html {
root html;
} include /local/nginx/conf.d/*.conf; #加载其它配置文件 }
2、在 /local/nginx/conf.d/目录下建个yumrepo.conf配置文件,定义server
#vi /local/nginx/conf.d/yumrepo.conf server {
listen ;
server_name localhost;
large_client_header_buffers 128k;
client_max_body_size 300m;
client_body_buffer_size 128k;
proxy_connect_timeout ;
proxy_read_timeout ;
proxy_send_timeout ;
proxy_buffer_size 64k;
proxy_buffers 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k; #charset koi8-r; #access_log logs/host.access.log main; location / {
root /yumrepo/Yumdate/rhel6;
index index.html index.htm;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
} }
将镜像文件里面所有包拷贝到/yumrepo/Yumdate/rhel6目录下
重新reload一下nginx即可,页面可以访问看看http://IP:端口号:
3、编辑自己的repo文件
#vi /etc/yum.repos.d/yum.repo
[yumku]
name=yumku Red Hat .2x64 repo
baseurl=http://10.7.12.10:8022 #yum源所在服务器IP及端口,如果端口为80直接写IP即可
enable=
gpgcheck=
yum list 查看yum是否可用
yum clean all 清除缓存
至此nginx做yum源已搭建完成!!!
nginx做yum源的更多相关文章
- CentOS6.5使用本地光盘做yum源 (参考:http://www.jb51.net/os/RedHat/43343.html)
一.使用光盘做yum源安装软件 mkdir /media/CentOS #新建CentOS挂载目录 mount -t auto /dev/cdrom /media/CentOS #挂载CentOS光 ...
- RHEL7下用本地光盘或镜像iso文件做yum源
应用场境:Redhat 系统想要直接在线通过yum的条件时需要注册,一般用户都是非注册的,这个时候如果要想通过yum安装新软件,我们可以通过将安装盘或者镜像iso文件设置为yum源的方式来进行. 测试 ...
- 跨服务器做yum源
服务器无法上网,然后自己根据光盘搭建的YUM源不够用.RPM安装软件,各种依赖,找包烦死. 先做个 能上外网的 http proxy 找一个可以上Internet的服务器,然后起一个squid服务, ...
- CentOS下的安装命令 安装Nginx 更新yum源 kali系统当中的软件管理命令(第五天)
Linux下软件的安装:方式:yum/rpm/源码安装YUM安装(帮助管理员解决依赖关系):yum search mysqld 在源中搜索软件包yum install mysql-connector- ...
- centos 7 配置nginx 的yum源
在/etc/yum.repos.d里创建nginx.repo文件: touch nginx.repo vim nginx.repo 填写如下内容后保存 [nginx] name=nginx repo ...
- centos7将本地的镜像挂载做yum源
首先将镜像挂载上来(用的是VNware),mount命令可以看到自动挂载的位置. mount可以看到挂载在/dev/sr0 这个位置. 接着来新建另一个挂载点:mkdir /iso mount /de ...
- 【nginx】利用yum源安装nginx
先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/pack ...
- 使用nginx代理centos yum 源
我们在安装centos 服务器时,可能会有以下情况: 局域网内有若干台服务器,但是只有一台服务器可以连接外网,其余服务器都不可以连接外网,但通过局域网与外网机器联通. 那么我们再使用 yum 安装软件 ...
- CentOS配置Nginx官方的Yum源
由于yum源中没有我们想要的nginx,那么我们就需要创建一个"/etc/yum.repos.d/nginx.repo"的文件,其实就是新增一个yum源. [root@niaoyu ...
随机推荐
- spring 2.5.6 错误:Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher
在运行一个第三方公司交付的项目的时候, 出现: Caused by: java.lang.IllegalStateException: Context namespace element 'annot ...
- log4j2 Filter用法详解
主要说下组合过滤器 CompositeFilter ,比较常用 <Filters> 是组合过滤器额标签,它包含的子标签是具体的过滤器,这三个具体过滤器分别是日志等级过滤器,正则表达式过滤器 ...
- 初次安装Ubuntu后的若干配置步骤
第一步,安装VMware-tools 按照如下提示安装 首先将压缩包,复制到/home 目录下,将其解压,执行./vmware-install.pl即可 第二步,配置使linux能上网 首先将ubun ...
- 深入理解Java虚拟机读书笔记5----虚拟机字节码执行引擎
五 虚拟机字节码执行引擎 1 运行时栈帧结构 ---栈帧是用于支持虚拟机进行方法调用和方法执行的数据结构,是虚拟机运行时数据区中的虚拟机栈的栈元素. ---栈帧中存储了方法的局部变 ...
- java面试题复习(六)
51.实现多线程的方法 一种是继承Thread类:另一种是实现Runnable接口.两种方式都要通过重写run()方法来定义线程的行为,推荐使用后者,因为Java中的继承是单继承,一个类有一个父类,如 ...
- 在引用阿里云库或其他库的时候,经常发生框架不兼容(原因是系统采用:Microsoft .NET Framework 4 Client Profile ),请改为Microsoft .NET Framework 4
在引用阿里云库或其他库的时候,经常发生框架不兼容(原因是系统采用:Microsoft .NET Framework 4 Client Profile ),请改为Microsoft .NET Frame ...
- Linux OS7 常用
查看防火墙状态: firewall-cmd --state;停止firewall: systemctl stop firewalld.service;禁止firewall开机启动:systemctl ...
- Install Oracle Tuxedo in silent mode
在我的工作中,Tuxedo通常是和PeopleSoft一起出现的. 下面总结不同版本Tuxedo静默(silent)安装的方法,方便提高我们部署系统的效率. Tuxedo 12.1.3 1. repo ...
- word里如何将模板的样式(标题啊、字体啊)导入到另外的模板里
点进去
- Game Engine Architecture 8
[Game Engine Architecture 8] 1.Differences across Operating Systems • UNIX uses a forward slash (/) ...