Symptoms
When a new domain is added onto an account using the "AutoDomain" feature, and the server's network is setup to be in a NAT, the newly created "AutoDomain" is incorrectly set to the public IP instead of the private IP. As a result, the domain is not accessible.
Cause
The "AutoDomain" feature is used when creating a new domain using the "Choose a domain later" option, when staging a website, or when cloning a website. Due to how these are created, the public IP is incorrectly assigned to the domain instead of the private IP in a NAT system.
We've opened an internal case for our development team to investigate this further. For reference, the case number is CPANEL-49781.
Resolution
Unfortunately, there is no method to prevent this from occurring. When a new "AutoDomain" is added to the server, manual steps will need to be taken to correct the new domain's IP.
Note: These steps will need to be performed any time that a new "AutoDomain" domain is added onto the server.
Backup current userdata:
# cp -a /var/cpanel/userdata{,-$(date +%s)}
Update all instances of the public IP to the private IP in the userdata:
# sed -i '/ip:/s/PUBIP/PRIVIP/g' /var/cpanel/userdata/*/*.site{,_SSL}
Note: Replace
PUBIPwith the Public IP, andPRIVIPwith the Private IP in the above command.If you are unsure of your current IP map, you can view this information via the following:
# cat /var/cpanel/cpnat
Rebuild the userdata caches:
# /scripts/updateuserdatacache && /scripts/updateuserdomains
Rebuild and restart NGINX:
# /scripts/ea-nginx config --all && /scripts/restartsrv_nginx
Rebuild and restart Apache:
# /scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
Comments
0 comments
Article is closed for comments.