Creating FTP accounts in subdomains with alternate docroot

jganders

Registered
Jul 6, 2009
4
0
51
Before I ask the title question about setting up a new subdomain FTP user in a private docroot, I need to explain.

For security and logistical reasons, I need to establish a subdomain that has its own docroot. I've been able to do this using the following steps.
I shelled into my Cpanel account that owns mydomain.com. I did a mkdir to create a new directory 'private_html'.
So in /home/mydomain I have these directories (amongst others):
public_html (the domain docroot) and
private_html (soon to be the docroot for a subdomain called 'private'.

In the private_html directory I created an index.html file. It contains the text 'hello world'.

To initially create an entry in the Apache config file for the new subdomain 'private', I logged into Cpanel and created a subdomain called 'private'. Of course, this process created a new directory /home/mydomain/public_html/private. I deleted this directory because I dont want it there. To tell Apache about my new docroot for 'private', I logged into root shell and edited the apache config file httpd.conf. I found the VirtualHost tag for the ServerName which was private.mydomain.com.
I changed the DocumentRoot for this entry from
/home/mydomain/public_html/private -to-
/home/mydomain/private_html.

I saved and restarted Apache
Now I can browse to http://private.mydomain.com. The browser correctly reports 'hello world'.

But now Cpanel can not create an FTP account using the new directory.
IE: Using Cpanel I want to create a new FTP account that can access
/home/mydomain/private_html.

When I use Cpanel to try to do this, on the 'Add FTP account' page, Cpanel hard codes the directory field with '/home/mydomain/public_html'. This does not allow me to set an ftproot for the new account to my new private_html directory.

Thanx for you help.