1. The process of removing the default virtual host in LNMP 2.1. Checking the directory, only .user.ini remains in /home/wwwroot/default; the other files have already been manually deleted. See Figure 1.

[root@iZ2zeaj7tnbv8d3gsoy1w5Z wwwroot]# cd default/
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# ls -la
total 4
drwxr-xr-x 2 www www 23 Mar 8 19:17 .
drwxr-xr-x 4 root root 32 Mar 8 16:57 ..
-rw-r--r-- 1 root root 48 Mar 8 16:43 .user.ini
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# pwd
/home/wwwroot/default
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]#
2. Reference: LNMP add, delete virtual host and pseudo-static usage tutorial https://lnmp.org/faq/lnmp-vhost-add-howto.html . However, the default virtual host does not exist. See Figure 2.

[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# lnmp vhost list
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Nginx Virtualhost list:
objectapi.ikhw.cn
object.ikhw.cn
3. Although the file /usr/local/nginx/conf/nginx.conf exists and contains server server_name _; root /home/wwwroot/default; . I decided to remove the configuration related to this server. See Figure 3.

4. The .user.ini file cannot be modified directly. To modify or delete it, you must first run: chattr -i /home/wwwroot/default/.user.ini . Then rm -f /home/wwwroot/default/.user.ini will work. See Figure 4.

[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# chattr -i /home/wwwroot/default/.user.ini
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# ls -la
total 4
drwxr-xr-x 2 www www 23 Mar 8 19:17 .
drwxr-xr-x 4 root root 32 Mar 8 16:57 ..
-rw-r--r-- 1 root root 48 Mar 8 16:43 .user.ini
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# rm -f /home/wwwroot/default/.user.ini
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# ls -la
total 0
drwxr-xr-x 2 www www 6 Mar 18 10:41 .
drwxr-xr-x 4 root root 32 Mar 8 16:57 ..
[root@iZ2zeaj7tnbv8d3gsoy1w5Z default]# cd ..
[root@iZ2zeaj7tnbv8d3gsoy1w5Z wwwroot]# ls -l
total 0
drwxr-xr-x 2 www www 6 Mar 18 10:41 default
drwxr-xr-x 4 root root 64 Mar 11 14:56 object
[root@iZ2zeaj7tnbv8d3gsoy1w5Z wwwroot]# rm -rf default/
[root@iZ2zeaj7tnbv8d3gsoy1w5Z wwwroot]# ls -la
total 0
drwxr-xr-x 3 root root 17 Mar 18 10:42 .
drwxr-xr-x. 5 root root 47 Mar 8 16:43 ..
drwxr-xr-x 4 root root 64 Mar 11 14:56 object
5. Run lnmp nginx reload to reload the Nginx configuration.
