Gavin Watson

Member
Apr 25, 2016
5
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
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?
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

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).
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
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?
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.
 

Gavin Watson

Member
Apr 25, 2016
5
0
1
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
So, I guess my question is, how to I edit this root page or at least put in a forward?
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.
 

Gavin Watson

Member
Apr 25, 2016
5
0
1
UK
cPanel Access Level
Root Administrator
Hello,

Thank you for your help.

I get the following error

Code:
[email protected] [/var/cpanel/templates/apache2]# cp main.default main.local

cp: cannot stat ‘main.default’: No such file or directory

[email protected] [/var/cpanel/templates/apache2]#
Interestingly, if I do this:

Code:
[email protected] [/var/cpanel/templates/apache2]# /scripts/rebuildhttpdconf

info [rebuildhttpdconf] Missing owner for domain mydomain.com, force lookup to root