Users deleting folders: AH00112

Arieh

Verified User
Joined
May 27, 2008
Messages
1,234
Location
The Netherlands
After you install a new server with DA, it is only a matter of time before the AH00112 (Warning: DocumentRoot .. does not exist) warnings show up at restarting httpd.

I figured it's because users delete folders that were created by(/through) DA and configured as such in httpd. However right now these warnings/configurations stay there until I do something about them.

Often it's a subdomain folder removed from public_html, or a private_html.

I was wondering what the best way is to handle this.
 
But users can create subdomains themselves.

Maybe it could be done with post/pre scripts, but I was wondering if there is something other people do for this issue.
 
Well scsi this will prevent the delete of the folder aswell when you remove the subdomain... so maybe da from his interface should set chattr +i once subdomain created and chattr -i before subdomain is going to be deleted from cp, so user will not be able to remove them usingi ftp/ssh

Regards
 
Well Arieh, using pre/post script would be pretty easy to do for chattr +/- i the folder created on cp as subdomain.

Regards
 
Hi,

When I use chattr +i, contents of the folder can't be modified.

Code:
[root@host02 public_html]# chattr +i bbb/

[root@host02 public_html]# lsattr . bbb/
-------------e- ./500.shtml
-------------e- ./401.shtml
----i--------e- ./bbb
-------------e- ./404.shtml
-------------e- ./403.shtml
-------------e- ./400.shtml
-------------e- ./index.html
-------------e- ./test
-------------e- ./cgi-bin
-------------e- ./azerty
-------------e- ./logo.png
-------------e- ./aaa
-------------e- bbb/test
-------------e- bbb/cgi-bin

[root@host02 public_html]# touch bbb/azer
touch: cannot touch `bbb/azer': Permission denied
 
When I notice the warning when restarting httpd, I just handle it manually by logging in to the user account, locate and delete the subdomain from user account in DirectAdmin. It only happen a few times each year, so its not a big problem for me. So on my servers it is usually just clients that don't understand they need to delete the subdomain from DirectAdmin, and not from (s)ftp.
 
Last edited:
When I use chattr +i, contents of the folder can't be modified.
In Unix (including Linux) everything is a file. Including a Directory. You can certainly chattr a directory; after all; it's only a file listing of other files.

But changing a file, without extending it, doesn't change the directory entry, so of course you can do it.

Or in other words, the only way to prevent someone from changing a file in a directory is with permissions.

Jeff
 
Back
Top