一、安装vmware8+centos6.3(网络选择nat方式)
二、配置ifcfg-eth0(查看vmware –>edit->virtual network editor->vmnet8->nat settings)
Vi /etc/sysconfig/network-scripts/ ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE="Ethernet"
UUID="229b524e-7f41-461a-909d-b96e6a4e3706"
HWADDR=00:0C:29:61:25:46
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.81.10#不要不subnet ip 和gateway 重复
GATEWAY=192.168.81.2#和vmnet8 的 一致
重启:service network restart
三、安装lamp
1、Vi /etc/resolv.conf 添加如下
nameserver 8.8.8.
nameserver 8.8.4.4
2、yum –y install httpd mysql-server php php-devel php-mysql
3、vi /etc/httpd/conf/httpd.conf
#ServerName www.localhost.com:80 打开
重启:/etc/init.d/httpd restart
4、查看防火墙:/etc/init.d/iptables status
开启80端口:
vi /etc/sysconfig/iptables 添加如下
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
重启:/etc/init.d/iptables restart
5、mysql 启动:/etc/init.d/mysqld start
退出:quit
查看:netstat -tuln | grep ':3306'
设置密码:mysqladmin -u root password 'your.password'
6、webroot vi /var/www/html/index.php
四、在win7下打开浏览器访问192.168.81.10