Linux学习笔记5-搭建内网Yum源
[root@nodeSource local]# yum install gc-devel gcc-c++ pcre-devel zlib-devel
[root@nodeSource local]# tar -zxvf nginx-1.8.0.tar.gz
[root@nodeSource local]# cd nginx-1.8.0
[root@nodeSource local]# ./configure --prefix=/usr/local/nginx-1.8.0
[root@nodeSource local]# make && make install
[root@nodeSource sbin]# mkdir -p /var/lock/subsys/nginx
[root@nodeSource local]# vim /etc/init.d/nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid # Source function library.
. /etc/rc.d/init.d/functions # Source networking configuration.
. /etc/sysconfig/network # Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/local/nginx-1.8.0/sbin/nginx"
prog=$(basename $nginx) NGINX_CONF_FILE="/usr/local/nginx-1.8.0/conf/nginx.conf" lockfile=/var/lock/subsys/nginx start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
} stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
} restart() {
configtest || return $?
stop
start
} reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
} force_reload() {
restart
} configtest() {
$nginx -t -c $NGINX_CONF_FILE
} rh_status() {
status $prog
} rh_status_q() {
rh_status >/dev/null 2>&1
} case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac
[root@nodeSource local]# chmod +x /etc/init.d/nginx
[root@nodeSource local]# chkconfig --add nginx
[root@nodeSource local]# chkconfig --list
[root@nodeSource local]# chkconfig nginx on
[root@nodeSource ~]# service nginx start
[root@nodeSource ~]# service iptables stop



[root@nodeSource ~]# mount /dev/cdrom /mnt

[root@nodeSource /]# vim /usr/local/nginx-1.8.0/conf/nginx.conf
location / {
#root html;
#index index.html index.htm;
root /mnt;
autoindex on;
}
[root@nodeSource /]# service nginx restart

[root@node1 /]# mkdir -p /etc/yum.repos.d/_bak
[root@node1 /]# mv /etc/yum.repos.d/* /etc/yum.repos.d/_bak
[root@node1 yum.repos.d]# vi local.repo #(注:无论文件名是什么但是必须以.repo结尾)
[local_server]
name=Thisis a local repo
baseurl=http://IP
enabled=1
gpgcheck=1
gpgkey=http://IP/RPM-GPG-KEY-CentOS-6 #(如果是其他版本的CentOS例如CentOS 7则需要把Key改成相应的KEY)
[root@node1 yum.repos.d]# yum makecache #更新Yum源,然就后行后啦,可以随便安装个软件试试效果
清除缓存目录(/var/cache/yum)下的软件包
命令:yum clean packages- 清除缓存目录(/var/cache/yum)下的 headers
命令:yum clean headers
- 清除缓存目录(/var/cache/yum)下旧的 headers
命令:yum clean oldheaders
- 清除缓存目录(/var/cache/yum)下的软件包及旧的headers
命令:yum clean, yum clean all (= yum clean packages; yum clean oldheaders)
Linux学习笔记5-搭建内网Yum源的更多相关文章
- 搭建内网Yum源
搭建内网yum源 阅读(2,238) 一:因内网服务器 众多,当统一安装一些比较大的rpm的时候全部从外网下载就比较慢,而且还占用了一定的出口流量,因此在内网部署了一台yum服务器,将阿里云的epel ...
- RadHat搭建内网YUM源server
前言:随着内网linuxserver越来越多,在每台server上安装软件.都要先把安装盘上传上去.在配置本地yum服务,即麻烦又费时.能够在内网的一台linuxserver上安装yum服务,然后其它 ...
- #centos7 创建内网yum源 OpenStack源部署
#centos7 创建内网yum源#centos7 自动化安装 本地 内网 web源创建.更新 createrepo http OpenStack源部署 Elven原创 http://www.cnbl ...
- 【转】内网yum源搭建
我们内网yum要玩的话,先加hosts,然后找运维要CentOS_base.repo这个文件,然后yum clean all && yum makecache ========== ...
- linux 配置内网yum源
一.yum服务器端配置1.安装FTP软件#yum install vsftpd #service vsftpd start#chkconfig --add vsftpd#chkconfig vsftp ...
- 利用nginx 来实现内网yum源(反向代理)
简介 在项目部署时,尤其是在政府企业,对于外网简直是奢望,但是对于运维来说,没有外网的话只能自建yum源.我今天来说的是一种简单的自建yum源方法,前提是必须有一台内外网都有的机器,我们一般称为前置机 ...
- 公司内网yum源
新增yum源配置文件 vi /etc/yum.repos.d/szyum.repo 内容如下: #[redhat6.3] [base] name=redhat63 baseurl=http://10. ...
- Linux 学习笔记 6 搭建nginx 实现二级域名访问
前言 在前一节的内容里面,我们学习了如何使用yum 包管理工具来安装我们需要的软件,这节内容,通过搭建Nginx 反向代理服务器,以及学习服务的配置等内容. NGINX Nginx是一款轻量级的Web ...
- Linux学习笔记-Centos7搭建owncloud私有云盘
使用环境:虚拟机centos7 1.下载安装LAMP相关软件 [root@localhost yum.repos.d]# yum install httpd –y [root@localhost yu ...
随机推荐
- cf479A Expression
A. Expression time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- java 防止sql注入的方法(非原创)
一.SQL注入简介 SQL注入是比较常见的网络攻击方式之一,它不是利用操作系统的BUG来实现攻击,而是针对程序员编程时的疏忽,通过SQL语句,实现无帐号登录,甚至篡改数据库. 二.SQ ...
- LeeCode-Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x. int mySqrt(int x) { ) ; /* for(i ...
- hadoop1.2.1+hbase0.90.4+nutch2.2.1+elasticsearch0.90.5配置(伪分布式)
系统:ubuntu14.04 一.hadoop安装 ssh免密码登陆详情见上一篇博客. 解压hadoop1.2.1到某个目录下,这里解压到ubuntu下载目录下(注意没必要使用管理员权限) 在hado ...
- 【LeetCode练习题】Unique Paths II
Unique Paths II Follow up for "Unique Paths": Now consider if some obstacles are added to ...
- 浅谈ThreadPool 线程池
本文来自:http://www.cnblogs.com/xugang/archive/2010/04/20/1716042.html 相关概念: 线程池可以看做容纳线程的容器: 一个应用程序最多只能有 ...
- Oracle基础学习5-- Oracle权限之”角色”
不论什么与权限相关的东西都少不了"角色"的概念,Java如此,.Net如此,Oracle当然也不例外. 角色事实上就是权限的集合,将多个权限打包到一个角色中,这样每一个角色有特定的 ...
- angular $location常用方法使用
$location提供了一些常用的操作和获取地址栏里的地址的方法. <script type="text/javascript"> angular.module('ap ...
- oc特有语法
分类 问题 1.什么是分类? 就是把一个类的功能,分出一部分来放在一个独立的文件中 2.分类的语法是什么样的? @interface Person(SuperMan) 3.分类与类是什么关系? 分类依 ...
- UIView和其子类的几个初始化函数执行的时机
-(id)initWithFrame:(CGRect)frame - UIView的指定初始化方法; 总是发送给UIView去初始化, 除非是从一个nib文件中加载的; -(id)initWithCo ...