The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Default website for new server

Discussion in 'Bind / DNS / Nameserver Issues' started by Gavin Watson, Apr 25, 2016.

  1. Gavin Watson

    Gavin Watson Member

    Joined:
    Apr 25, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi there,

    New to cPanel, please bear with me! I have a couple of questions, I’ll raise them in separate threads.

    I am wondering where/how to set up the default site for my cPanel installation. So for example, what people see when they go to the IP address of the server. I can see how to create websites, create accounts and packages, but how do I point the IP address (port 80) to a specific website that I have already created in cPanel?

    I have tried to configure the website that I want to appear, but it says it is already in the Apache configuration? Is this because it is the www for the hostname? (ie: my hostname is mysite.com and I want to set up www.mysite.com to have a website there).

    Thanks in advance.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can configure the default page via the "Web Template Editor" in Web Host Manager:

    Web Template Editor - Documentation - cPanel Documentation

    Or, if you want it to point to a specific website, you can follow the instructions from this post:

    Server IP Address

    Per the interface in Web Host Manager:

    It is important to choose a hostname that you will not be using for any account. You should choose something that will be socially acceptable, as it will appear in all mail headers. Your hostname must be a FQDN. In English, a hostname should consist of a name and a domain name. All valid hostnames should have 2 dots in them. Hostnames should never begin with “www”. Hostnames should also not begin with a digit, nor end with a hyphen (“-”).

    Thank you.
     
  3. Gavin Watson

    Gavin Watson Member

    Joined:
    Apr 25, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi, thanks for your reply.

    Just to confirm, if I use mydomain.com as my hostname, I cannot then use any other aspect of that domain such as www.mydomain.com or cp.mydomain.com or mail.mydomain.com on the same server?

    Thank you.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You should not use "mydomain.com" as your hostname. Instead, use something such as "cp.mydomain.com" as your hostname and then you can create an account for "mydomain.com".

    Thank you.
     
  5. Gavin Watson

    Gavin Watson Member

    Joined:
    Apr 25, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
  6. Gavin Watson

    Gavin Watson Member

    Joined:
    Apr 25, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    So... I changed the hostname to cp.mydomain.com and have been able to create a website at www.mydomain.com, all OK there...

    If anyone goes to cp.mydomain.com they get the default http://cp.mydomain.com/cgi-sys/defaultwebpage.cgi pagewhich I am aware I could configure in the Account Functions -> Web Template Editor BUT, the desired outcome here is that the root page of http://cp.mydomain.com could redirect to http://cp.mydomain.com:2083 (so that anyone wishing to go to the control panel can just type in cp.mydomain.com (without the port number) and have a redirect in that page to go to the URL with the port number. I don't want to edit the template page because then any new sites deployed will be forwarded to the control panel.

    So, I guess my question is, how to I edit this root page or at least put in a forward?

    Thanks again in advance!
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Most administrators will simply utilize the proxy subdomains feature and offer the following URLs for access to cPanel, WHM, or Webmail:

    cpanel.anydomain.tld
    whm.anydomain.tld
    webmail.anydomain.tld

    However, you can edit the document root associated with the hostname with the instructions on the following post:

    Server IP Address

    Thank you.
     
  8. Gavin Watson

    Gavin Watson Member

    Joined:
    Apr 25, 2016
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hello,

    Thank you for your help.

    I get the following error

    Code:
    root@cp [/var/cpanel/templates/apache2]# cp main.default main.local
    
    cp: cannot stat ‘main.default’: No such file or directory
    
    root@cp [/var/cpanel/templates/apache2]# 
    Interestingly, if I do this:

    Code:
    root@cp [/var/cpanel/templates/apache2]# /scripts/rebuildhttpdconf
    
    info [rebuildhttpdconf] Missing owner for domain mydomain.com, force lookup to root
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page