在windows中下载安装Oracle VM VirtualBox虚拟机。各个版本的下载地址:https://www.virtualbox.org/wiki/Downloadsphp
固定Host-Only的ip
mysql
在虚拟机中安装centos6.6,设置两张网卡,第一张为NAT,第二张为Host-Only。
linux
配置linux网络, vi /etc/sysconfig/network-scripts/ifcfg-eth0,eth1只需修改成ONBOOT=yesnginx
DEVICE=eth0
HWADDR=08:00:27:BA:37:8C
TYPE=Ethernet
UUID=a80d14be-d246-4f01-8035-0a74ff51b3b4
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcpgit
安装php环境 教程地址 : https://github.com/lj2007331/lnmpgithub
改php.ini,关闭zend opcachesql
改nginx.conf, sendfile off。windows
在本地window系统建www,conf,logs文件夹而且共享,本地window系统必须设置用户名跟密码。centos
在linux 系统中的 /srv目录创建上述对应的三个目录网络
查看www的gid,uid 。cat /etc/passwd
在/etc/fstab中写入
//192.168.56.1/www /srv/www cifs,rw username=用户名,password=密码,noperm,gid=505,uid=504,file_mode=0777,dirmode=0777,auto 0 0 //192.168.56.1/conf /srv/conf cifs,rw username=用户名,password=密码,noperm,gid=504,uid=504,file_mode=0777,dirmode=0777,auto 0 0 //192.168.56.1/logs /srv/logs cifs,rw username=用户名,password=密码,noperm,gid=504,uid=504,file_mode=0777,dirmode=0777,auto 0 0
在/etc/rc.local中写入
mount -a service php-fpm restart service nginx restart service mysqld restart
最后修改nginx的配置。vi /usr/local/nginx/conf/nginx.conf