win7挂载开发环境到linux下面

本文详细介绍了如何在Win7系统中设置Share账户,配置密码,并将共享目录(F:dev)与Linux服务器进行连接。同时,通过Nginx配置实现对Linux服务器上特定目录的访问。包括使用rc.local和fstab文件挂载CIFS共享,以及在Linux服务器上创建目录和安装Nginx。

 

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/

转载于:https://www.cnblogs.com/wowotou/p/3953550.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值