Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

This is my first experimental run of setting up a linux web host. I'm setting up cPanel and I want to try to do all of the configuration through cPanel, as I know that many manually entered changes could be overwritten by the cPanel application.

I registered the FQDN and the nameservers ( & I can ping and dig all of those now and I can ssh to the server via the fqdn and access the default Apache root via the fqdn in the browser.

How do I go about configuring cpanel or any one of the many .conf files for Apache or DNS to also point to the Apache document root. Is that even a good idea?

I know by default Apache's document root is /var/www/html but after installing cpanel it seems to be usr/local/apache/htdocs. Is this OK or should I change it back?

share|improve this question

migrated from Nov 17 '11 at 21:57

This question came from our site for professional and enthusiast programmers.

it makes no difference. thats a default folder. – mate64 Nov 17 '11 at 23:02
up vote 0 down vote accepted

Here is how I would do this using as a website with and as resolvers. ns1 and ns2 will also be resolving any other domain on the server:

  1. First I'd set the hostname of my server to something like You can do this in WHM by going to: Main, Networking Setup, Change Hostname

  2. Next I'd setup my default resolvers for all new account / domains added to the server by going to WHM at Main, Server Configuration, Basic cPanel & WHM Setup and scrolling to the bottom. The resolvers here will be expected to answer any new domains you add. If you've set this up to be the same server as your cPanel/WHM box then you can manage DNS through WHM.

  3. Now I'd create a new account for by going to Main, Account Functions, Create a New Account in WHM and finishing the wizard. The http_root for this will be at /home/examedomainUsername/public_html/

I know this isn't what you asked really but I'm guessing this is what you may be wanting. When you use a panel it is often best to play by the panel's rules. You can make changes to /usr/local/apache/conf/httpd.conf. If you do so make sure you run '/usr/local/cpanel/bin/apache_conf_distiller –update' afterward to check the changes in with cPanel. I personally wouldn't change the default to /var/www/html . It will probably be changed back next time cPanel updates. I would make changes directly if it is for an account / domain but only if I couldn't make the change through WHM and I'd be sure to run the distiller afterward.

share|improve this answer

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.