Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dedicated server on which I have a site

I need to create a user and:

  1. How do I provide ftp access to him?
  2. How do I setup public_html and all necessary details so that he can access html file from the internet? I want him to be able to execute php scripts as well (which I dont think should be a problem as the website on this site can do it already).

I don't have cPanel. I am running RHEL5/CentOS


In httpd.conf I added this:

NameVirtualHost *:80

<VirtualHost *:80>
  DocumentRoot /var/www/html/

<VirtualHost *:80>
  DocumentRoot /home/david/public_html

<VirtualHost *:80>
  DocumentRoot /home/matthew/public_html

And made sure the corresponding folders existed with 755 permissions.

I have the main site accessible now, but not the ones.

share|improve this question
This is entirely dependant on what FTP server you are using and what Web Server you are using. – Sam Jan 24 '11 at 11:56
@Sam - Redhat Linux, Apache, and dunno about the ftp server... – siliconpi Jan 24 '11 at 15:30
well you are going to need to find out if you want to give him FTP access. You will either need to know how to configure a user in that FTP software, or use a control panel that will help you do that. – Sam Jan 24 '11 at 15:52
@Sam - okay, forget about that for the time being... can you help out with how to setup public_html properly? – siliconpi Jan 24 '11 at 17:06

You use mod_userdir to set up public_html and directories that allow users to have websites on your machine.

If you only need this for one user you can also set up a plain virtual host to that directory. EG:

Listen 80
NameVirtualHost *

<VirtualHost *>
  DocumentRoot /var/www/html/

<VirtualHost *>
  DocumentRoot /home/username/public_html/

If you have multiple usernames you want to create VirtualHosts for, you have a few options. The first is to write them out explicitly in your httpd.conf. The second is to use mod_rewrite to look for unknown hostnames and translate them to the default user directory

That takes care of the Web aspect of it. For the FTP aspect a daemon such as ProFTPd's DefaultRoot takes care of user directory FTP access. For DNS you could create a wildcard A entry to point the * to your server's IP address.

As a side note, please edit this question with the information your provided on your question on StackOverflow (and was eventually ported to ServerFault) so that we do not have duplicate questions floating around. Thanks!

share|improve this answer
Hi @Dave - thank you for responding... I dont think your instructions are fully accurate. I did get part of it working - the main site works again, but not the subdomains. See edit1. – siliconpi Jan 25 '11 at 3:06
do I need to change the DNS settings in the /etc/hosts file? – siliconpi Jan 25 '11 at 4:42
/etc/hosts does not affect anything other than local DNS resolution on the machine. You will need to add the correct records to the DNS server who is authoritive for – Dave Drager Jan 25 '11 at 17:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.