Custom script to run as cron to change ownership of public_html based on package

Håvard - Nordhost

New member
Joined
Jan 3, 2013
Messages
4
Location
Honningsvåg, Norway
Hello,

We got some clients that parked their domain on our servers. Those clients does not need access to public_html since they are not allowed to host any webpage.

To keep control of those we need a custom script to run by cron once every hour to set the correct ownership.

The command we use today (manually) is:

chown -R root.username /home/username/domains/domainname.tld/public_html

This should be done for all users that got the hosting package "00-Domeneparkering" with 105 MB disk space.


And also we need a cron to revert the changes in case a user upgrade their package by the command:

chown -R username.username /home/username/domains/domainname.tld/public_html

I do not know if the best way is to keep a list stored with parked domains and than compare to current package, or if the best way is to run this for all users on the server every hour.

Note that our servers maximum are hosting 80 users, so the job should be able to complete within a few minutes.

Please contact me by PM if you think you can manage to help us.

Thanks,
Haavard
 
You should never have to chown on a cronjob. You have something missconfigured with your server. Look into using mod_ruid, php-fpm or equiv.
 
@scsi, is it possible you're misunderstanding? Or am I? Poster is intentionally chowning directories to make sure they can't be used.

@nordkappnett, I do smething similar by having a 'parked' user going to a parked page. At it's own IP#.

For all domains eing parked I use that IP# for A record for domain name and for www, so they see the parked page.

Jeff
 
Hello,

Yeah, i think @scsi did misunderstand the purpose of the script i need.

@nobaloney That would work, but will also require a script to to the change upon creation or upgrade of an account. And also the client will be able to edit the DNS back to the "correct" server, since we do give them access to DNS management on parked domains. Some clients like to point the domain to another server, and than they need DNS access. I found the solution with changing the owner of the public_html most sufficient.

Thanks for tha PMs, I will get back to you shortly. This week has been to busy for me.

SY,
Haavard
 
We offer parking through our domain registration service to our own park pages. Most registration providers do. If clients want to create/manage their own parked sites we let them do that by creating a parked page themselves as a site, then use pointers for their parked pages. But of course then they don't get email.

Jeff
 
Back
Top