When you are Install and set the lnmp environment in centOS system After that, the next thing to do is to add the domain name and virtual host.
Prompt: If there is an error in the input, you can press Ctrl and then Backspace to delete it.
First, open the Xshell and connect to your vps. After the connection is successful, enter the command:
lnmp vhost add
Enter the domain name you want to add in the interface that appears, and I will enter www.vpss.net here
Next, ask whether you want to add more domain names. If yes, enter Y and press Enter; Otherwise, enter n and press Enter.
Now you need to enter the directory of the website corresponding to the domain name. If the website directory does not exist, the directory will be created. You can also enter an existing directory or a directory to be set (note that if you want to enter a full path, that is, a full path starting with/). If you do not enter Enter directly, the default directory is/home/wwwroot/domain name.
Whether pseudo static is supported below? Pseudostatic can make the URL more concise and is also beneficial to SEO. Wordpress program supports and needs to set pseudo static. If you select y, you will be asked to enter the name of the php program, including the php program commonly used by domestic webmasters.
By default, there are discuz, discuzx, discuzx2 (Discuz X secondary directory), wordpress, wp2 (WordPress secondary directory), typecho, typecho2 (Typecho secondary directory) Common Nginx pseudo static configuration files, such as sablog, emlog, dabr, phpwind, dedecms, drupal, ecshop, shopex, can be directly entered for use. If it is a secondary directory, it needs the name of the secondary directory in the corresponding configuration file.
The next step is to set the log. The blogger chooses not to enable it, enters n, and enters Enter.
Now you will be asked whether to add a database and a database user (with the same name), enter y, enter, and ask you to enter the root password of MySql for verification. Note that the password you entered is not displayed in the operation window. After entering it correctly, enter, and you will be prompted that the password is correct, and you will be asked to enter the database name.
The following is to enter the password corresponding to the database name. Think of a more complicated one.
After you prompt Press any key to start create virtual host..., press Enter to confirm that the virtual host will be created.
When you see the following virtual host information page, it means that the website folder, pseudo static, and database account password have been set successfully.
To sum up, today we added a virtual host and domain name in the lnmp environment. The command we used is: lnmp vhost add, which is also simple to use. Follow the command line prompts step by step.