Cannot create addon domain
I am trying to add an Addon Domain via cPanel but I get an error message saying:
"A domain cannot be parked on itself."
This is my current setup:
- example.com -> Primary Account Domain -> pointing to /#account_user#/public_html/
- Addon Domains are allowed for this account (WHM Account configuration)
- The Domain dev.example.com is pointing to the server
- Allow to create document root outside of public_html folder (Tweak Settings)
-
An addon creates a subdomain and addon domain basically is a parked domain on that subdomain. I believe you cannot create the same addon in the server. 0 -
An addon creates a subdomain and addon domain basically is a parked domain on that subdomain. I believe you cannot create the same addon in the server.
I am not sure if I understand you right, but there is no subdomain dev.example.com installed yet on the server. It is just pointing to the server by IP in order to be able to install it as an addon-Domain. So the creation of a new addon domain dev.example.com should work, shouldn't it? By the way: I just saw I mixed up example.com and example.com in my initial post. It should all be example.com.0 -
It sounds like you do in fact want a subdomain though, based on the fact you want "dev.example.com to be the domain you're adding - this is literally a subdomain of example.com. Why is there a necessity for the addon instead of the subdomain? You can set the subdomain's documentroot however you'd like when you create it as well. 0 -
It sounds like you do in fact want a subdomain though, based on the fact you want "dev.example.com to be the domain you're adding - this is literally a subdomain of example.com. Why is there a necessity for the addon instead of the subdomain? You can set the subdomain's documentroot however you'd like when you create it as well.
Yes I see, what I wrote sounds like that, as it was meant as an example. Sorry for the confusion. So to be more specific, my definite setup should look like this: temp.website.com -> Primary Account, public_html -> not used because I need other file structure, can be completely other domain website.com -> Addon-Domain with custom document root -> Live site dev.website.com -> Addon-Domain with custom document root -> Staging site, password protected So in the end, the folder structure of the account would look like: website.com - config - vendor - web -> public folder similar to public_html, Addon Domain documentroot will point here .env .gitignore CHANGELOG.md composer.json composer.lock LICENCE.md README.md wp-cli.yml dev.website.com - config - vendor - web -> public folder similar to public_html, Addon Domain documentroot will point here .env .gitignore CHANGELOG.md composer.json composer.lock LICENCE.md README.md wp-cli.yml public_html -> public folder of temp.website.com (NOT USED, primary domain, can be completely other domain, will not be used) ... other cPanel/account files on this level. So what I want is to be independent of cPanels folder structure, creating subfolders for different sites in one account, which contain each one a "public_html"-like folder called "web". I read using addon Domains is the best practice with cPanel for that and compatible with updates, account migration, etc. Do you think this is a clean solution in line with the possibilities of cPanel or would you recommend using another strategy to reach my goal?0 -
@cPanelLauren Can you confirm that the setup mentioned works seamlessly with all features of cPanel like Updates, Backups, Migration, etc? 0 -
Anyone? 0 -
If I understand correctly here's a simpler breakdown of what you're trying to do: /home/$user: website.com - web -> public folder similar to public_html, Addon Domain documentroot will point here dev.website.com - web -> public folder similar to public_html, Addon Domain documentroot will point here public_html -> public folder of temp.website.com (NOT USED, primary domain, can be completely other domain, will not be used) ...
There shouldn't be a problem with this, the only caveat is that the primary domain cannot be a subdomain of any other domain you're adding. For example I used the following to set this up: 59835 The Directory structure looks as follows: 598390 -
Cool thanks! I did not want to move all the emails etc. from the existing account (Live Site) under public_html. So I finally solved it like this (I post it here just for the case anyone wants to create a similar setup). From this post /var/cpanel/userdata/#USERNAME#/website.com /var/cpanel/userdata/#USERNAME#/website.com_SSL
2. Remove the existing cache files:rm /var/cpanel/userdata/#USERNAME#/website.com.cache rm /var/cpanel/userdata/#USERNAME#/website.com_SSL.cache
3. Rebuild the cache files and the Apache configuration file:/scripts/updateuserdatacache /scripts/rebuildhttpdconf
4. Restart Apache:/scripts/restartsrv_httpd
As I am using Apache FPM, the following additional steps had to be done: In /var/cpanel/userdata/#USERNAME#/website.com.php-fpm.yaml add the following entry in order to set the custom document root:php_admin_value_doc_root: { name: 'php_admin_value[doc_root]', value: /home/#USERNAME#/website.com/web }
Then rebuild PHP FPM Config and restart Apache FPM and HTTPD-Service./usr/local/cpanel/scripts/php_fpm_config --rebuild /usr/local/cpanel/scripts/restartsrv_apache_php_fpm /usr/local/cpanel/scripts/restartsrv_httpd
That's it, now working with the custom site structure which is open to adding more sites via addon domains or subdomains.0
Please sign in to leave a comment.
Comments
8 comments