This tutorial is for host admins who want to change subdomain or domain of website without actually recreating a website on CyberPanel or change subdomain or domain of an existing website. Why?
Because this cannot be done automatically on CyberPanel but there is a longer process that if not done correctly can mess up your virtual host configuration.
Before you start remove SSL certificate for subdomain.maindomain.com and remove any mailboxes for that subdomain.
- Create the path
/home/subdomain1.maindomain.com/public_html
- Go to
https://SERVER_URL:7080/index.php#view/confMgr.php?m=vh
and choose the virtual host to change domain. As seen in the image above the url visited ishttps://SERVER_URL:7080/index.php#view/confMgr.php?m=vh_add-your-domain-here
~ replaceadd-your-domain-here
with your actual domain from the list or existing domain on your cyberpanel server.
- Under General tab click edit
- Document root will not be created by the server automatically if it does not already exist. Please ensure that both the directory exists i.e.
/home/add-domain-here
and it is owned by the correct user as seen above.
- On Basic tab change the Virtual Host Name with subdomain1.maindomain.com from Step 1 as seen in the image above.
- This will change the virtual host file.
- Confirm there is NO paired SSL private key and SSL certificate for SSL listener as seen in the image above,
OR you can visit https://SERVER_URL:7080/index.php#view/confMgr.php?m=sl_SSL
to delete relationship between the SSL listener and your virtual host as seen below.
- By now you see “Configuration has been modified. To apply changes, please perform a graceful restart.” message. Perform a graceful restart as seen below.
6.Reboot the server
- Go to
https://SERVER_URL:8090/phpmyadmin/index.php?route=/sql&db=cyberpanel&table=websiteFunctions_websites&pos=0
this opens a table in PhpMyAdmin as seen in image above.
On that table websiteFunctions_websites look for the line subdomain.maindomain.com
(your domain) and change to subdomain1.maindomain.com
(the new domain you want to change to)
- Go back to list of websites - viola! You can see
subdomain1.maindomain.com
and now you can Issue SSL etc