首页 > 代码库 > win7挂载开发环境到linux下面

win7挂载开发环境到linux下面

 

1. win7设置share账户,密码设置为share

2. 设置共享目录,我这里是(F:\dev)

clip_image001

3 创建linux下面的目录

    cd ~

    make windows_share

chown www-data:www-data /windows_share    #这个是运行nginx的用户 下面的501是用户所在的组和用户id

4 vim /etc/rc.d/rc.local

mount -t cifs //192.168.10.78/dev /windows_share -o rw,username=share,password=share,uid=501,gid=501

说明需要添加uid和gid因为运行nginx的用户是www用户,安装的时候会有问题

【vim /etc/fstab(这个方法我一直没有实验成功,有说是因为没有连接上网络,这个自动挂载没有成功)

//192.168.10.78/dev /windows_share cifs default,username=share,password=share 0 2】

5 重启系统

reboot

6 nginx配置

vim /etc/local/nginx/conf/nginx.cnf

添加如下代码

server {

listen 80;

server_name www.discuz1.com;

charset utf-8;

root /windows_share/discuz/;

index index.php index.html index.htm json.php;

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

location ~ \.php$ {

index index.php index.html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

7 在e:/dev/下面放上discuz的代码

我的目录:

E:\dev\discuz

8 在win7中 配置host

把linux的服务器的ip写入

192.168.239.128 www.discuz1.com

9 输入网址:

http://www.discuz1.com/

win7挂载开发环境到linux下面