public_html deleted... now now www.

sch

Member
Jan 10, 2008
20
0
51
I have a client that needed me to install a php app. Apparently, when removing an FTP account via cPanel he hit the 'Yes, and delete files' button and public_html and all its contents was removed. Now... his domain does not use the www. How do you fix that?


P.S. I think he was confused about the Yes button which said delete all files. I looked and I would have thought it meant delete all files relating to the ftp account - might want to emphasize that on the next cPanel release.
 
Last edited:

Roxanne

Member
PartnerNOC
Jan 10, 2008
14
0
51
Orlando, FL
That doesn't sound like a Cpanel problem? Also the Yes, delete all files within this folder is pretty straight forward/blunt statement. Can't blame Cpanel for that.
 

sch

Member
Jan 10, 2008
20
0
51
So what you are saying is, if the cPanel user clicks the 'Yes and all files' button when deleting an FTP account and cPanel deletes the public_html directory and ALL files in it and then they check their site later [after loading the script again] and and the www. no longer is displayed it has nothing to do with cPanel and the fact the public_html directory was deleted? I find that to be a little suspect.
 

Roxanne

Member
PartnerNOC
Jan 10, 2008
14
0
51
Orlando, FL
Sorry, I wrote down what I was thinking the wrong way. The fault is the user for pressing the button in the first place. I understand it was an accident, though.

By any chance has your client made a back-up of his files? If so then you can recover everything with that. Have you tried creating a new public_html folder and putting an index.html file to see if it worked?

Also you said while he was deleting an FTP account, so he deleted his main account or was it a sub-account?
 

kieranmullen

Well-Known Member
Aug 25, 2005
165
0
166
Portland, OR USA
this is a bit off topic, but regarding the programming that went into that web command.

Would it not make more sense to delete all files within the directory except for the directory itself which is needed?

Like the folder is owned by root but all contents in it belong to the user that puts it there?

Thank you

KieranMullen
 

sch

Member
Jan 10, 2008
20
0
51
Well... you live you learn - not much can be done about it now.

This was a sub FTP account he deleted and he had not made any backups of his files as we were just starting to set up his site on his new server.

It does not make any sense to me at all. Prior to the public_html directory being deleted the url was using the www. and after he clicked that button and cpanel deleted the public_html directory it started loading without the www.

Yes, we have a script installed in public_html. Its a script I install everyday for clients and it never installs incorrectly.

I thought cPanel updated virtual host and/or httpd.conf when this happened... this seems more like a server issue somewhere.

Sorry, I wrote down what I was thinking the wrong way. The fault is the user for pressing the button in the first place. I understand it was an accident, though.

By any chance has your client made a back-up of his files? If so then you can recover everything with that. Have you tried creating a new public_html folder and putting an index.html file to see if it worked?

Also you said while he was deleting an FTP account, so he deleted his main account or was it a sub-account?
 

sch

Member
Jan 10, 2008
20
0
51
I have to wonder why, when deleting a FTP account, cPanel would think to delete the public_html folder to begin with...



this is a bit off topic, but regarding the programming that went into that web command.

Would it not make more sense to delete all files within the directory except for the directory itself which is needed?

Like the folder is owned by root but all contents in it belong to the user that puts it there?

Thank you

KieranMullen
 

Roxanne

Member
PartnerNOC
Jan 10, 2008
14
0
51
Orlando, FL
I have to wonder why, when deleting a FTP account, cPanel would think to delete the public_html folder to begin with...
Yes, that doesn't make much sense. Since a sub-FTP account would have nothing to do with it unless you delete the main FTP account. When your client deleted this, he did it all himself correct, you don't think by some chance he isn't giving you the whole story, and by accident deleted his main FTP account, or the public_html? I'm trying to get you to accuse him of anything, but it never hurt to ask? If so, it would make a lot more sense why this happened.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
/usr/local/cpanel/logs/access_log may log what precisely happened here.

I'm a bit confused myself, as deleting a FTP account doesn't delete any files in my experience.
 

Roxanne

Member
PartnerNOC
Jan 10, 2008
14
0
51
Orlando, FL
/usr/local/cpanel/logs/access_log may log what precisely happened here.

I'm a bit confused myself, as deleting a FTP account doesn't delete any files in my experience.
Its a new feature now in Cpanel 11 where you are able to not only delete the FTP account, but all the files created under it. I think its a handy feature, since when I had 10 I would delete the FTP account and then would forgot about the files and when I looked at my public_html folder I'd have a like 5 folders that needed to be deleted since I deleted the FTP account.
 

sch

Member
Jan 10, 2008
20
0
51
It deleted the files in public_html and the public_html folder when he deleted the FTP account...


/usr/local/cpanel/logs/access_log may log what precisely happened here.

I'm a bit confused myself, as deleting a FTP account doesn't delete any files in my experience.
 

sch

Member
Jan 10, 2008
20
0
51
It was the FTP sub account deletion that did it. He emailed me when it happened and I logged into cPanel and his main FTP account was there but the sub FTP account he created not. The guy wouldn't go in and just delete the entire public_html folder.


Yes, that doesn't make much sense. Since a sub-FTP account would have nothing to do with it unless you delete the main FTP account. When your client deleted this, he did it all himself correct, you don't think by some chance he isn't giving you the whole story, and by accident deleted his main FTP account, or the public_html? I'm trying to get you to accuse him of anything, but it never hurt to ask? If so, it would make a lot more sense why this happened.
 

sch

Member
Jan 10, 2008
20
0
51
I thought it meant the FTP account files too and maybe it is supposed to mean that but in his case... it wiped out everything. There is something wrong with his installation of cPanel or something.

Its a new feature now in Cpanel 11 where you are able to not only delete the FTP account, but all the files created under it. I think its a handy feature, since when I had 10 I would delete the FTP account and then would forgot about the files and when I looked at my public_html folder I'd have a like 5 folders that needed to be deleted since I deleted the FTP account.
 

lehels

Well-Known Member
Jul 10, 2006
91
0
156
I thought it meant the FTP account files too and maybe it is supposed to mean that but in his case... it wiped out everything. There is something wrong with his installation of cPanel or something.

We have clients who are erasing their own public_html/ and it happens like ~twice weekly, but backups are invented. Pretty bad if nor the hosting, nor the client has no data from his own site, sounds a bit /stupid/.
Maybe something smells around that FTP account, but you have to check what path was attributed, and that folder obviously will erase if it's asked and you said YES. "You" should think before, and no more headaches after. Anyway the keyword is: backup [and LOGS to investigate].

Cheers,
Lehel
 
Last edited:

sch

Member
Jan 10, 2008
20
0
51
Thanks wise ass. It shouldn't delete the public_html folder.



We have clients who are erasing their own public_html/ and it happens like ~twice weekly, but backups are invented. Pretty bad if nor the hosting, nor the client has no data from his own site, sounds a bit /stupid/.
Maybe something smells around that FTP account, but you have to check what path was attributed, and that folder obviously will erase if it's asked and you said YES. "You" should think before, and no more headaches after. Anyway the keyword is: backup [and LOGS to investigate].

Cheers,
Lehel