Install the CentOS system, configure the network environment of the system
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
device=Eth0type=ethernetonboot=yesnm_controlled=Yesbootproto= Staticipaddr=192.168. 126.5 NETMASK=255.255. 255.0 Gatway=192.168. 126.2
Vi/etc/resolv.conf
192.168. 126.2
If it is a virtual machine, the gateway address is configured
Vi/etc/sysconfig/network
networking=yeshostname=YumGATEWAY=192.168. 126.2
Service Network restart
Installing Nginx Service
Yum Install Nginx
If the download fails or the source is not found, you can install it by updating the third-party source
Chkconfig Nginx on
- Update Nginx Configuration
Vi/etc/nginx/nginx.conf
Add the following content to the http{:
AutoIndex on; #开启nginx目录浏览功能autoindex_exact_size off; #文件大小从KB开始显示autoindex_localtime on; #显示文件修改时间为服务器本地时间
http://192.168.126.5
Preparing Yun Source data
mount/dev/cdrom/mnt/
- Copy the disc file to the Nginx directory
Mkdir/usr/share/nginx/html/yum
cp–rf/mnt/*/usr/share/nginx/html/yum/
Http://192.168.126.5/yum
Update Yum Source information
- Client host new Yum source configuration file
Vi/etc/yum.repos.d/localserver.repo
= CentOS/ localserverbaseurl=http://192.168.126.5/yum/1= http:// 192.168.126.5/yum/rpm-gpg-key-centos-61
- And then set the other source as invalid
VI Centos-base.repo
Add Enabled=0
Yum Check-update
Yum Repolist
CentOS builds local Yum source server