Mount the local code to the vm Virtual Environment and mount the vm
Step 1: first install a VM and create a new Linux virtual environment (CentOS image recommended .....)
Step 2: Start the VM and configure lnmp (here we can use the lnmp Integrated Installation Package)
Specific reference: https://lnmp.org/install.html installation operation
Step 3: After everything is ready
Open the shared folder "VMware Virtual Machine" Settings "option"
Then, specify the local folder to be shared to the virtual machine. Specifically, the ''name'' is the ing directory of the local directory in the virtual machine.
Step 4: Check whether/mnt/hgfs/In the VM maps to the shared directory on the host (then we will create a site in Nginx and bind it to this directory)
Step 5 configure Nginx
The nginx-t command can be used to query the location of the nginx server configuration file.
Or cd/usr/local/nginx/conf
Step 6: Open the vhost folder
You can create a site configuration file (I have already configured it)
You can use the touch command to create one (as shown below)
Then use the vi command to write the configuration file
In command line mode, you can use: set nu to view the number of rows.
Press the I key to enter the insert mode.
Write the following Configuration:
Then Press esc to exit the command line mode.
Then, wq is saved and exited.
Restart the nginx server.
Step 7: view the Virtual Machine IP Address
Bind the configured domain name to the ip address in the host file.
Finally, you can try to access the domain name. As a result, this mounting step is complete.
PS: Out-of-Question
If a website is configured with redis, you can install redis extension:
The installation procedure is as follows:
First, go to the lnmp decompressed directory.
Install
Go to the directory after lnmp decompression and execute:./Addons. sh install redis
The following prompt is displayed after running:
Enter: s press enter to install stable version Redis 2.8.8; enter: B Press enter to install test version Redis 3.0.0; enter: o press enter to install old version Redis 2.6.17.