Lost in domains and subdirectories


#1

I had one domain hosted with DH. User1 can get to Domain1 via FTP. Life was simple.

Then I added a second user (User2). User2 couldn’t do much until I added a subdomain under dreamhosters.com. I had User2 access the new subdomain (Subdomain1). Life was grand.

I added a third user (User3) so I let someone else manage the subdomain. User3 could see Subdomain1. Life was dandy.

Now registered a second domain (Domain2), and hosted that on DH too. I tried to get User3 to have access to Domain2 but I can’t seem to figure out how to do this. Now my life is complicated. I’m in FTP hell. I went into Control Panel, Domain, Manage Domains and messed with the “FTP user / CGI-runs-as user:” settings. User1 can only see Domain1. User2 can see Subdomain1 and Domain2, but Domain1 is just an empty folder. User3 can see Subdomain1 and an empty folder for Domain2.

Obviously, I don’t understand how these subdirectories relate to the users, and how to give each user access to specific subdirectories. In the end, I’d like User1 and User2 to have full access to all subdirectories (domains and subdomains) and have User3 limited to just Domain2.

I went to the DH FAQ and I could not find a simple explanation. Can someone help out? Is there a cheat sheet for this?


#2

You’ll notice when editing a domain/subdomain it only lets you specify a single “FTP / CGI” user. This means whomever that user is, that is the only one that should login to FTP or shell to manage files for that domain.

Each file or directory is “owned” by a single user and group.
Each FTP/shell user has his own “home directory” in which to store his own files.
The web server is configured to look for web site files in a subdirectory of a single “home directory”.

Only the “owner” of a file/directory gets to set permissions. If one is not careful, and attempts to have other users manage files or directories they don’t own, then the permissions may prevent the web server, scripts and other services from functioning, and users will not be able to create, edit or remove files.

To solve your problem without causing headaches, you need:

  1. Two FTP/shell users, “shared_one” and “shared_two” for example.
  2. Set Domain1 FTP/CGI user to “shared_one”
  3. Set Domain2 FTP/CGI user to “shared_two”

To manage files:
No matter whom the person is, the person needs to login as “shared_one” to manage Domain1, and “shared_two” to manage Domain2.

It’s really that simple.

:cool: Perl / MySQL / HTML+CSS


#3

So how do I set User1 to control Domain1 and User2 to control Domain2? Do I just go to Manage Domains then do the “FTP user / CGI-runs-as user:” thing? How do I transfer ownership of a domain/subdirectory to a user?


#4

[quote]So how do I set User1 to control Domain1 and User2 to control Domain2?
Do I just go to Manage Domains then do the “FTP user / CGI-runs-as user:” thing? [/quote]
Yes.

Using the web panel, write down both the FTP/CGI user and the Web Directory for each domain.
Then login as each user, and make sure the web directory exists.
If it is, upload the files for that domain to that directory.

For example, Domain1 FTP/CGI user is User1, and the Web Directory is /home/User1/Domain1

Login to FTP as User1, make sure you have a subdirectory Domain1, change into that directory, and upload the files. You should then be able to browse to http://Domain1/ and see the files you uploaded.

This does mean if you already uploaded the files, but as the wrong user, you have to login as the wrong user, download them, then login as the right user and upload them. If you have to do this, keep track of the permissions on the files.

:cool: Perl / MySQL / HTML CSS


#5

Ok, I think I’m with you still. Unfortunately, I will probably have to FTP everything down then up again.

If User1 logs in and sees a /home/User1/Domain1, and User2 logs in and sees a /home/User2/Domain1, which Domain1 is seen when someone goes to http://Domain1?

When I do the One-Click Installs from the Control Panel, how do I chose who becomes the owner of the installed software? Some of my stuff is owned by User2 but I have never logged into the DH Control Panel with the User2 account. Is that what the ‘Active Domain’ thing does on the left hand side?


#6

Web Panel -> Domains -> Manage Domains -> Edit
FTP user / CGI-runs-as user: USER
Web Directory: /home/USER/DOMAIN/

Of course, its not like you can’t upload a file and attempt to browse to it, either…

:cool: Perl / MySQL / HTML+CSS


#7

Cool. What about the ownership of One-Click Installs?


#8

on a semi related note: With multiple domains hosted, when I create new FTP user for one domain, how can I specify that their login only grant access to their home dir, and automatically propagate permission to all files within that directory (drwxr-xr-x) ? If they add files now, every one has to be manually permissioned.

ideally, user access to www.domain.com/user1/ only… so their web address is the same.

Right now, when I create a ftp user for a domain, it logs in and sees the root of the (secondary) domain level, even if the default user directory is set when creating.