版本:nginx:1.1 php:5.3.8
虚拟机选择网络桥接网卡(bridge network card)
设置后启动虚拟机
编辑配置
命令 vi /etc/sysconfig/network-scripts/ifcfg-eth0
重启 service network restart
检测 ping -c3 baidu.com
网络配置:
DEVICE=eth0
HWADDR=08:00:27:21:C4:2C
TYPE=Ethernet
UUID=7ad392ea-448e-4944-839f-65a92f46493b
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
NETMASK=255.255.255.0
IPADDR=192.168.1.67
GATEWAY=192.168.1.1
DNS1=114.114.114.114
清除防火墙规则:iptables -F
保存规则 service iptables save
vi /etc/selinux/config
关闭shell配置:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
安装nginx
Ubuntu下安装nginx,直接apt-get install nginx就行了,很方便。
但是今天装了CentOS6.2,直接yum install nginx不行,要先处理下源,下面是安装完整流程,也十分简单:
1、CentOS 6,先执行:
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2,查看yum的nginx信息
yum info nginx
3,安装并启动nignx
yum install nginx
service nginx start
4,然后进入浏览器,输入http://192.168.1.67测试,如果看到有页面则已经成功
安装php5.3版本 yum -y install php php-mysql php-gd php-mbstring