It is recommended to install xftp, which is a software for visual management of files on virtual machine, which is convenient for beginners to learn.
Log in after installation,
Note that if xftp 5 is installed, the protocol is changed to SFTP.
Well, without much gossip, let’s start today’s topic
—How to customize your own website!!!
Step 1: Execute
lnmp add vhost
01. Please enter the domain name you want to bind, and then press enter. For example, the domain name I registered with Alibaba cloud is lolong.xyz. Here, I can enter lolong.xyz or any other *. Lolong.xyz to specify a specific website. One host can deploy multiple websites.
After registering the website domain name here, we also need to log in to the personal alicloud account (similar to other platforms), and set the domain name resolution in the console. The legend is as follows:
↑ host record: must be consistent with the website domain name deployed here
Record value: is the virtual machine IP address
Parsing takes several minutes. This step can be set in advance.
Next, proceed to the operation above the xshell
02. Prompt to register more website domain names. If not, press enter directly
03. Enter the host file directory corresponding to your domain name and press enter directly. The default is / home / wwwroot / domain name. It is not changed here. Later, it will be adjusted according to different projects.
04. Ask whether to add a static rule and press enter directly. Generally, it is URL access
05. Do you want to save the access log? Click y and enter
06. Enter the name of the saved log and press enter to use the default name
07. Whether to create a MySQL database (not required) and press enter
08. Finally, click any key to start creating
At this point, you have created your own website. You only need to put the items in your hand into the corresponding location and configure them accordingly. See the end for detailed configuration operationsSupplementary notes。
If you want to create multiple sites, you can repeat the above operation.
1. How to use and test the site after it is created?
After creating a website by executing LNMP Vhost add, the user-defined domain name (for example, lolong. XYZ) is actually corresponding to the virtual machine / home / wwwroot / lolong.xyz address. When accessing lolong.xyz, the index.html file under the address / home / wwwroot / lolong.xyz is actually accessed.
Go to this folder / home / wwwroot / lolong.xyz
Create and edit index.html
Enter any content and save it: Hello world, this is website
Then visit: lolong.xyz, as shown in the figure
02. What if the configuration needs to be changed after the initial site creation?
Modify the corresponding configuration file in the path / usr / local / nginx / conf / Vhost /
It is usually named after your domain name, followed by. Conf.
The operations at the beginning of the article are all modifications to the configuration file.
The following is the nginx configuration content (cross domain and reverse proxy are also added here)
After modifying the nginx configuration at any time, you must restart nginx in three ways:
service nginx restart
systemctl restart nginx.service