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 (ns1.exampledomain.com & ns2.exampledomain.com) 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 exampledomain.com 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?

migrated from stackoverflow.com Nov 17 '11 at 21:57

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

  • 1
    it makes no difference. thats a default folder. – mate64 Nov 17 '11 at 23:02

Here is how I would do this using exampledomain.com as a website with ns1.exampledomain.com and ns2.exampledomain.com 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 server1.exampledomain.com. 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 exampledomain.com 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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