CentOS mini 和 nginx 的安装和配置要点
1.安装VMware Player
版本:5.0.2 build-1031769
2.安装XShell
版本:Build 0126
3.安装CentOS
版本:6.4-x86_64-minimal
4.配置ip地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 IPV6INIT=no ONBOOT=yes BOOTPROTO=static IPADDR=192.168.187.123 NETMASK=255.255.255.0
5.配置网关
vi /etc/sysconfig/network
NETWORKING=yes HOSTNAME=centos GATEWAY=192.168.187.2
6.配置DNS服务器
vi /etc/resolv.conf
nameserver 8.8.8.8 nameserver 192.168.1.1 nameserver 192.168.0.1
7. 重启网卡
service network restart
8.配置XSell
配置过程用遇到乱码,如下图解决
9.添加enginx源
vi /etc/yum.repos.d/CentOS-Base.repo
添加:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
10.安装nginx
yum install nginx 一路Y结束
11.开放80端口
vim /etc/sysconfig/iptables
添加: -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
12. 重启网卡
service network restart
13.测试一下是否可以访问
Welcome to nginx!
-------------------------------------------------
!!!作者:木由水 http://www.cnblogs.com/muyoushui