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 ...
随机推荐
- 2013第51周二eclipse启动优化
2013第51周二eclipse启动优化 今天注意到了eclipse.ini配置文件中gc.log--在eclipse启动时清空,然后记录了eclipse每次运行过程中的gc分配情况,看到了一篇很好的 ...
- HDU 4649 Professor Tian
Professor Tian Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) T ...
- Python 练习 —— 2048
1. 引言 2048 这段时间火的不行啊,大家都纷纷仿造,"百家争鸣",于是出现了各种技术版本号:除了手机版本号,还有C语言版.Qt版.Web版.java版.C#版等,刚好我接触P ...
- <ListView>分列显示
<ListView> <ListView.ItemsPanel> <ItemsPanelTemplate> <WrapPanel Width="{B ...
- 那么温暖http合约,入门。
简介 年提出.经过几年的使用与发展,得到不断地完好和扩展.眼下在WWW中使用的是HTTP/1.0的第六版,HTTP/1.1的规范化工作正在进行之中,并且HTTP-NG(Next Generation ...
- Sql语句之查询所有学生所有科目分数及总分
昨天练Sql语句,数据库建了四个表分别是,学生表,课程表,成绩表以及教师表(教师表不在讨论范围),突然想到以前高中时代老师手上的那张成绩表,然后我就寻思着能不能用Sql语句把表打印出来,以下是我的思考 ...
- 利用cookie改变背景色
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- CSS 四个样式表格
1. 单像素边框CSS表格 这是一个很常用的表格样式. 源代码: <!-- CSS goes in the document HEAD or added to your external sty ...
- ENOVIA 基础
Part 零件 Part Master PM 如何表示零件:每当创建一个Part(给定一个Part Number),都回创建一个Part Master Part Master管理每个Part的最本质的 ...
- Spring:启动项目时加载数据库数据(总结)
在项目中需要启动程序时,要将数据库的用户信息表加载到内存中,找到一下几种方式. 1.实现ApplicationListener接口,重写onApplicationEvent方法,可以在项目启动的时候执 ...