1. Win7 set share account with password set to share
2. Set up the shared directory, I am here (F:\dev)
3 Create a directory below Linux
CD ~
Make Windows_share
Chown Www-data:www-data/windows_share #这个是运行nginx的用户 The following 501 is the group and user ID where the user is located
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
Description need to add UID and GID because the user running nginx is www user, there will be a problem when installing
"Vim/etc/fstab (this method I have not been successful in the experiment, it is said that because there is no network connection, this automatic mount is not successful)
192.168.10.78/dev/windows_share cifs default,username=share,password=share 0 2 "
5 Rebooting the system
Reboot
6 Nginx Configuration
Vim/etc/local/nginx/conf/nginx.cnf
Add the following code
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 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 put the Discuz code below the e:/dev/.
My directory:
E:\dev\discuz
8 Configuring host in Win7
Write the IP of the Linux server
192.168.239.128 www.discuz1.com
9 Enter the URL:
http://www.discuz1.com/
Win7 mount the development environment under Linux