博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux安装服务器
阅读量:5274 次
发布时间:2019-06-14

本文共 3687 字,大约阅读时间需要 12 分钟。

dnsmasq做为dhcp, dns, ntp, tftp服务器

yum -y install dnsmasqsystemctl enable dnsmasq.servicesystemctl start dnsmasq.service

/etc/dnsmasq.d/my.conf

# resolve-file指定dnsmasq从哪个文件中读取上行DNS Server, 默认是从/etc/resolv.conf获取# addn-hosts  指定dnsmasq从哪个文件中读取'地址 域名'记录, 默认是系统文件/etc/hostsinterface=em1,lolisten-address=127.0.0.1,192.168.48.116bind-interfaceslog-querieslog-dhcplog-async=20log-facility=/var/log/dnsmasq.log# dhcpdhcp-range=em1,192.168.48.131,192.168.48.140,255.255.255.0,1hdhcp-option=option:router,192.168.48.1dhcp-boot=pxelinux.0,pxeserver,192.168.48.116# dnsdhcp-option=option:dns-server,192.168.48.116#no-resolvserver=114.114.114.114no-hostsaddress=/install.local/192.168.48.116address=/yum.local/192.168.48.116# ntpdhcp-option=option:ntp-server,192.168.48.116# tftpenable-tftptftp-root=/var/lib/tftpboot#pxe-prompt="Press F8 for menu.", 10#pxe-service=x86PC, "Install CentOS", pxelinux

建立本地安装源

mkdir /mnt/{centos-7,centos-atomic-host-7}mount -o loop /opt/CentOS-7-x86_64-Minimal-1503-01.iso /mnt/centos-7mount -o loop /opt/CentOS-Atomic-Host-7.20151001-Installer.iso /mnt/centos-atomic-host-7ln -s /mnt/centos-atomic-host-7 /opt/opmgmt/install/centos-atomic-host-7ln -s /mnt/centos-7 /opt/opmgmt/install/centos-7
mkdir -p /opt/opmgmt/install/{kickstart,pxelinux.cfg}ln -s /mnt/centos-atomic-host-7/images/pxeboot /var/lib/tftpboot/centos-atomic-host-7ln -s /mnt/centos-7/images/pxeboot /var/lib/tftpboot/centos-7ln -s /opt/opmgmt/install/pxelinux.cfg /var/lib/tftpboot/pxelinux.cfg

yum

/opt/opmgmt/yum/rsync_centos.sh

#!/bin/bashrepo_root='/opt/opmgmt/yum/centos/'sync_cmd='rsync -arv --delete-after --delete-excluded'sync_srv='rsync://mirrors.yun-idc.com/centos/'exclude='--exclude [23456]/ --exclude [23456]\.*/ --exclude i386/ --exclude drpms/ --exclude SCL/ --exclude centosplus/ --exclude cloud/ --exclude contrib/ --exclude cr/ --exclude fasttrack/ --exclude isos/ --exclude xen4/'[ -d $repo_root ] && mkdir -p $repo_root $sync_cmd $exclude $sync_srv $repo_root &

/opt/opmgmt/yum/rsync_epel.sh

#!/bin/bashrepo_root='/opt/opmgmt/yum/epel/'sync_cmd='rsync -arv --delete-after --delete-excluded'sync_srv='rsync://mirrors.yun-idc.com/epel/'exclude='--exclude [456]*/ --exclude=ppc64le/ --exclude testing/ --exclude SRPMS/ --exclude i386/ --exclude ppc64/ --exclude debug/ --exclude=repoview'[ -d $repo_root ] && mkdir -p $repo_root $sync_cmd $exclude $sync_srv $repo_root &

/opt/opmgmt/yum/centos.repo

[base]name=CentOS-$releasever - Basebaseurl=http://yum.localhost/centos/$releasever/os/$basearchenabled=1gpgcheck=0[updates]name=CentOS-$releasever - Updatesbaseurl=http://yum.localhost/centos/$releasever/updates/$basearchenabled=1gpgcheck=0[extras]name=CentOS-$releasever - Extrasbaseurl=http://yum.localhost/centos/$releasever/extras/$basearchenabled=1gpgcheck=0

/opt/opmgmt/yum/epel.repo

[epel]name=Extra Packages for Enterprise Linux $releasever - $basearchbaseurl=http://yum.localhost/epel/$releasever/$basearchenabled=1gpgcheck=0

/etc/cron.d/yum-repo.cron

0 2 * * 0 root /bin/sh /opt/opmgmt/yum/rsync_centos.sh0 4 * * 0 root /bin/sh /opt/opmgmt/yum/rsync_epel.sh

nginx

yum -y install nginxsystemctl enable nginx.servicesystemctl start nginx.service

/etc/nginx/conf.d/opmgmt.conf

server {    listen       80;    server_name  install.local;    root         /opt/opmgmt/install;    allow 192.168.48.0/24;    deny all;    autoindex on;    autoindex_exact_size off;    location / {    }}server {    listen       80;    server_name  yum.local;    root         /opt/opmgmt/yum;    allow 192.168.48.0/24;    deny all;    autoindex on;    autoindex_exact_size off;    location / {    }}
posted on
2015-10-23 17:35 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/liujitao79/p/4905224.html

你可能感兴趣的文章
Linux pipe函数
查看>>
java equals 小记
查看>>
2019春 软件工程实践 助教总结
查看>>
Zerver是一个C#开发的Nginx+PHP+Mysql+memcached+redis绿色集成开发环境
查看>>
程序的静态链接,动态链接和装载 (补充)
查看>>
关于本博客说明
查看>>
[Kaggle] Sentiment Analysis on Movie Reviews
查看>>
价值观
查看>>
mongodb命令----批量更改文档字段名
查看>>
国外常见互联网盈利创新模式
查看>>
android:scaleType属性
查看>>
shell脚本
查看>>
Upload Image to .NET Core 2.1 API
查看>>
【雷电】源代码分析(二)-- 进入游戏攻击
查看>>
Linux中防火墙centos
查看>>
如何设置映射网络驱动器的具体步骤和方法
查看>>
centos下同时启动多个tomcat
查看>>
Leetcode Balanced Binary Tree
查看>>
[JS]递归对象或数组
查看>>
linux sed命令
查看>>