Mount the local code to the vm Virtual Environment and mount the vm

Source: Internet
Author: User
Tags touch command virtual environment install redis

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.