Deleting Websites Does Not Delete Data

Discussion in 'Developers' Forum' started by Indieben, Apr 22, 2018.

  1. Indieben

    Indieben Member

    Hi, I have had a quick look at the manual and it doesn't seem that there is an article on deleting websites. From this, I can only presume that it is as simple as going to sites and hitting delete in the ispconfig control panel.

    I wanted to delete a site and create exactly the same website again, but a fresh copy. When I created the new website the first time (after deleting the original), the files that were visible in Filezilla originally appeared again (after creating a new FTP account that did not delete when I deleted the website as I would have expected it to).

    So I went off and did the same thing again thinking I might not have given ispconfig enough time to tidy things up and repeated the process. The second time, when I logged into the FTP account I re-created (same ID), none of the files appeared at all BUT the index.html default page still appeared on the website, regardless of deleting the cache. I also tried an alternative browser.

    By way of background, I have pointed www.website.com to 192.168.1.x in my hosts file on my laptop.

    Something has gone a bit scew whiff. I followed one of the perfect server setups (Debian 9, Apache on Debian 9) to the letter. Running ISPConfig 3.1.11 (all be it the same old issues around setting up FTP quota still present themselves). I also noticed (and a few other people have commented) that phymyadmin does not ask for the root database password as the instructions suggested. Believe me, I went through that guide, letter by letter, character by character from experience!

    I'm hoping you can look into this and give me some instructions in the meantime please. Ideally, the proposed fix would be that:

    1) user hits delete website
    2) user is presented with dialogue "save files to an archive area out of the way? y/n"
    3) user can create website again as they did before.

    Purpose:

    Sometimes people will mess with settings/mess things up and wish to go back a step and create a clean copy.

    Thanks :)
     
    Last edited: Apr 22, 2018
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I delete the client, that removes all files and databases belonging to that client. It does take some time until the removal is complete but it does work.
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    If a website is deleted, and then new one is created, the new one should be in a different folder.

    Thus I think when you delete a website, you should delete the old ftp account as well since it relates to the old website folder.

    You then can create a new ftp for the new website which should upon its completion link you to the right (new website) folder.
     
  4. Indieben

    Indieben Member

    Hey guys, thanks for your replies. I was hoping you were going to tell me I was wrong! It looks like this is a bug - Will it be considered as one? I have a number of different websites for myself that are all "client 1". I didn't see the point of setting up one client per website :) so I can't really delete them all and then set them all back up as, on one website, I have around 7 different installs connecting with databases etc....
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I can't see why it should be considered as a bug, as @Taleman said earlier, it works but you should wait until the whole process is fully completed.

    And as I said, new website though created with the same name as the deleted one, should be in a different folder e.g. client1/web1/web, client1/web2/web etc; and index.html will always be created upon each creation of new website so that you can check whether its creation is successful or otherwise.

    And since your new website has the same name, try new different FTP username for the newly created website especially if you are not sure if the old credential still linked to old website folder or it has been properly deleted.
     
  6. Indieben

    Indieben Member

    Sure, but the system shouldn't by default, keep the website data intact when the intention is to delete it.... It's not the nicest thing to do to go into the back end and start hacking away at it, particularly when you could leave the ispconfig control panel out of sync....from this end, it does seem to be a bug as it does not give you the option to save or delete so it seems the behaviour is not intentional....

    As a workaround, for now, i've created a new client but I hope to transfer the website back over to client 1 (and delete client 2) once either a fix or proper instructions are found...
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The website data is correctly deleted incl. all its files, just tested it on my server with Debian 9, an exact copy of the perfect server guide, so there is no bug here as @Taleman and @ahrasis pointed out already. phpmyadmin is asking for the root password on my Debian 9 system. A index.html file is placed into any new website that you created, so this is to be expected that you find an index.html filee when you create a new site. You can e.g. use the debug mode to find out why the file can't be deleted from your server. It does not matter if you wait before you create a new site or not, all actions are done in order.
     
  8. Indieben

    Indieben Member

    Till, so did you:

    1) create a new website
    2) create an ftp user
    3) put some directories and files within the website by ftp
    4) delete website
    (Did the FTP account delete at that point automatically?)
    5) recreate website with exactly the same name and same client
    6) recreate ftp account with exactly the same name and client
    7) ftp in on that same account
    (Did the files reappear from the old website then)
    8) Change the files within that website at this stage
    (Did the changes reflect in the browser?)

    Thanks
     
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If you delate a website when the client this website belongs to has several websites so you can not delate the client, I assume you should delete the associated objects of that website also. Like the FTP-user and shell user for that website, database and database user, DNS-entries, etc.. Otherwise these users have dangling references to the directories, so maybe the directories are not delated when there still are users associated with them.
    Furthermore, as @ahrasis pointed out, it would be strange if a new website you create, even if with same name as the previous one, would have files from the old website. I would rather believe the FTP-user or shell-user is the same, so might well have the old files in the directory. Check what is the directory, it is web123 or something and should be different in the new website compared to the deleted website.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    When you delete a client, then all assets he owns get deleted. When you delete a website, then all 'sub' assets like FTP users.shell users and cronjobs get deleted. DNS records do not get deleted when you delete a website as the DNS record does not belong to a site.

    Like I mentioned in my first post, deleting a website works fine here and when the site is deleted, then everything on the harddisk that belongs to the site is removed, so there can not be any files show up when you recreate the site.

    Example: Created the site test2.tld
    2018-04-23 17_31_15-ISPConfig.png
    2018-04-23 17_31_36-ISPConfig.png
    On the shell:
    Code:
    root@server1:~# ls -la /var/www/test2.tld
    lrwxrwxrwx 1 root root 31 Apr  3 03:03 /var/www/test2.tld -> /var/www/clients/client0/web16/
    root@server1:~# ls -la /var/www/clients/client0/web16/
    total 40
    drwxr-xr-x 10 root  root    4096 Apr  3 03:03 .
    drwxr-xr-x  7 root  root    4096 Apr  3 03:03 ..
    drwxr-xr-x  2 web16 client0 4096 Apr  3 03:03 cgi-bin
    drwxr-xr-x  2 root  root    4096 Apr  3 03:03 log
    drwx--x---  2 web16 client0 4096 Apr  3 03:03 private
    drwx------  2 web16 client0 4096 Apr  3 03:03 .ssh
    drwxr-xr-x  2 root  root    4096 Apr  3 03:03 ssl
    drwxrwx---  2 web16 client0 4096 Apr  3 03:03 tmp
    drwx--x--x  4 web16 client0 4096 Apr  3 03:03 web
    drwx--x---  2 web16 client0 4096 Apr  3 03:03 webdav
    root@server1:~#
    Now I deleted the website by clicking on the delete icon.

    2018-04-23 17_33_48-ISPConfig.png
    2018-04-23 17_34_00-ISPConfig.png
    As you can see, website gone and FTP user gone. Now let's check on the shell:

    Code:
    root@server1:~# ls -la /var/www/test2.tld
    ls: cannot access '/var/www/test2.tld': No such file or directory
    root@server1:~# ls -la /var/www/clients/client0/web16/
    ls: cannot access '/var/www/clients/client0/web16/': No such file or directory
    root@server1:~#
    As you can see, everything got deleted.

    But, I have an Idea what your problem might have been. There was no issue with your server, my guess is that your FTP client cached the file view. So there were no old files on the server, your FTP client just showed you the old file list.
     
  11. Indieben

    Indieben Member

    Aha, Till, when I get some time I will play with that theory and report back to you :) I know you work very hard on ispconfig and also your instructions! That's why, I never put a character out of line with your install tutorials as i've learned the hard way in the past there! Thanks everybody for your replies, I will report back so please leave this open. It won't be immediately though as i'm snowed under. Till, last thought, for now, would the caching have led to me re-deleting the website and setting it up for a second time and then only having a few files including an index.html landing page that, when I deleted it, did not reflect in the browser even though I had cleared the browser cache?
     

Share This Page