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

888u

Last update at :2024-06-14,Edit by888u

Junge LNMP is still used a lot in the one-click environment installation of Linux VPS in mainland China. This is not the case. Snail is also planning to reorganize it based on our commonly used one-click package in mainland China from installation, deployment, website building, simple Operation and maintenance tutorial series. Today, a friend used LNMP to build a WEB environment with dozens of websites, most of which he did not need to use. He wanted to delete the directory and unbind them.

According to his statement, it is not possible to delete the folder directly via FTP, because starting from about version 1.2, it cannot be deleted directly, and this is not how to correctly delete the bound domain name and folder. In this article, Snail will share and demonstrate how to delete a website in an LNMP environment and unbind a domain name.

First, unbind the domain name

If we are not going to use this domain name in this server, then directly delete it or stop parsing it to point to this server, because even if we don't use it, parsing it will take up some resources. To cancel domain name resolution, you can directly go to the domain name management panel or use a third-party DNS resolution to directly change or stop the resolution.

Second, check the Nginx binding file

Because among the dozens of websites this friend has, we can see that the website directories are corresponding folders when they were first created, but later the binding was changed, which means that the corresponding folders are not this domain name. We You need to manually go to the NGINX configuration environment to check whether the corresponding folder is the corresponding domain name.

/usr/local/nginx/conf/vhost

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 it corresponds to.

Third, use the lnmp command to delete the binding

lnmp vhost del

Enter the command in SSH, and 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.

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

Fourth, delete the LNNP binding website files

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

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

We can see that due to the security factors of the program, the .user.ini file cannot be deleted. We need to find a solution here.

chattr -i /home/wwwroot/domain name folder/.user.ini

Execute this name and replace \\"domain name folder\\" with the directory where we currently need to delete the folder. Then we can use FTP or commands to delete the corresponding folder.

In this way, through 4 steps, we check the binding, deauthorize the file, and delete the directory folder to delete the domain name bound in the LNMP environment and the files in the folder. If there is a database, we can delete it in PHPMYADMIN.

Recommended site search: American server and Japanese server, Zhejiang server, IP address query, registration number, IP address search, search IP, purchase space, Alibaba Cloud server, multi-IP station group server, rent a server,

p>

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

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码