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 ...
随机推荐
- ZOJ3414Trail Walk(计算几何)
Trail Walk Time Limit: 2 Seconds Memory Limit: 65536 KB FatMouse is busy organizing the coming ...
- cf#366....
惨惨惨.... 我需要av.. b题意看错想了个加强版博弈结果发现完全没必要= =....cwa12到结束....中途想看d....只会n^4暴力啊.. 题解明天补上
- php接口数据加密、解密、验证签名代码实例
php接口数据加密.解密.验证签名 代码非常easy,这里就不多废话了,直接奉上代码 <?php /** * 数据加密.解密.验证签名 * @edit http://www.lai18.com ...
- mysql开启慢查询日志
5.1版本之前,在 my.cnf添加如下信息, long_query_time=1 log_slow_queries=/data/mysql/slow.log 5.1版本之后,在 my.cnf添加如下 ...
- C# DES 加密解密
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.S ...
- android——拍照,相册图片剪切其实就这么简单
接触android这么久了.还没有真正的浩浩看看android拍照,相册图片剪切到底是怎么回事,每次都是从别人的代码一扣,就过来了.其实,谷歌提供的API已经很强大.只需要用的好,就那么几句就可以搞定 ...
- js继承 prototype和constructor
function a(){ this.name="aaa"; } function b(){ ...
- node.js 入门(一)安装
从 https://nodejs.org/ 下载最新版的node.js 下载完成后,双击安装, 一路点击"Next"按钮即可. 等出现上图及表示安装成功. 按"win+r ...
- Core Java读书笔记之String
Java里面的String Conceptually, Java Strings are sequences of Unicode characters. Java里面的String都是Unicode ...
- activiti 部署在oracle多用户下不能自动建表问题的解决!
在activiti配置文件中的SpringProcessEngineConfiguration的配置项中添加<property name= "databaseSchema" ...