Focus on cloud service provider activities
Notes on website operation and maintenance

Record the process of thoroughly deleting bound domain names and website folders/files in the LNMP environment

There are still a lot of military brother LNMP used in the domestic Linux VPS one key environment installation. This is not the old Zuo's intention to reorganize the series of tutorials based on our common domestic one key package from installation, deployment, station building to simple operation and maintenance. Today, there are dozens of websites in the WEB environment built by a friend using LNMP, most of which are unnecessary. He hopes to delete the directory and unbind.

According to his statement, direct FTP deletion of folders is not feasible, because it is impossible to directly delete folders since version 1.2, and it is not the same for correctly deleting bound domain names and folders. In this article, Lao Zuo will share his demonstration on how to delete websites in the LNMP environment and unbind domain names.

First, unbind the domain name

If we are not going to use this domain name in this server, we should first delete it or stop parsing to point to this server, because even if we do not use it, parsing will occupy some resources. To remove the domain name resolution, you can directly go to the domain name management panel or use a third-party DNS resolution to directly replace or stop the resolution.

Second, check the Nginx binding file

Because of this friend's dozens of websites, we can see that the website directory is the corresponding folder when we created it, but later we changed the binding, that is, the corresponding folder is not the domain name. We need to check whether the corresponding folder is the corresponding domain name in the NGINX configuration environment manually.

/usr/local/nginx/conf/vhost

 Record the process of thoroughly deleting bound domain names and website folders/files in the LNMP environment - Page 1

We find the corresponding directory site in turn, and then find one of the. conf files to see if it is the domain name we want to delete and which folder corresponds.

Third, use the lnmp command to delete the binding

 Record the process of thoroughly deleting bound domain names and website folders/files in the LNMP environment - Page 2

lnmp vhost del

Enter the command in SSH, then you can see the bound domain name in the current server, and delete the binding according to actual needs. Enter the corresponding domain name.

 LNMP deletes the bound domain name

Here we can see that the binding has been deleted, but the file is still in place, and will not be deleted in linkage. We need to delete it manually.

Fourth, delete the LNNP binding website file

Here we are familiar with the command and delete it directly with rm. If we are not familiar with it, we can delete it with FTP. Especially with the former, we can delete all the files in the domain name folder in the corresponding folder.

But here is but. If we delete the domain name folder with SFTP, an error will be prompted.

 Delete LNNP binding site file

We can see that. user.ini files cannot be deleted due to the inherent security factors of the program. We need to find solutions here.

Chattr - i/home/wwwroot/domain folder/. user.ini

Execute this name and change the "Domain Name Folder" to the directory where we need to delete the folder. Then we can use FTP or command to delete the corresponding folder.

In this way, we can delete the bound domain name in the LNMP environment and the files in the folder by checking the binding and unauthorized files and deleting the directory folder in four steps. If there is a database, we can delete it in PHPMYADMIN.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Record the process of thoroughly deleting bound domain names and website folders/files in the LNMP environment


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge