Since version 1.6.2, network admins hosting their network over a cPanel install no longer need to manually add mapped domains to the Add-on Domains panel. This tutorial will go over the necessary steps to configure this integration on your WP Ultimo network install.
Adding the config to your wp-config.php file
You’ll need to edit your wp-config.php file to include the custom configuration constants WP Ultimo needs to correctly connect to the cPanel API.
Add the following lines to your wp-config.php file, right above the /* That’s all, stop editing! Happy blogging. */ line. Replace the contents with the information obtained in the prior steps:
/* WP Ultimo: Adding automatically domain syncing to cPanel */
define('WU_CPANEL', true); // Tells WP Ultimo we should connect to cPanel
define('WU_CPANEL_USERNAME', 'username'); // The username you use to login on your cPanel
define('WU_CPANEL_PASSWORD', 'password'); // The password you use to login on your cPanel
define('WU_CPANEL_HOST', 'mi3-ss19.a2hosting.com'); // The URL of the cPanel hosting, do not include the port or the protocol (http or https)
define('WU_CPANEL_PORT', 2083); // (Optional) Port number, if different than 2083
/* end WP Ultimo */
After replacing the values, you should have something like this:
You’re all set!
Now, every time a new domain is mapped in the network (via the Aliases tab by the network admin or via the custom domain meta-box on the user’s Account page) it will be added to the cPanel’s Add-on Domains page automatically.
The same is true for domain removals. Every time a domain is deleted from the network, that change will be communicated to your cPanel account instantly!
Important: Changing the root directory of the add-on domain
This is not the case for the majority of cPanel installs, but if for any reason your network is not located on the /public_html directory of your install, you need to let WP Ultimo know about that, otherwise the add-on domains will be added pointing to the wrong place.
To do that, simply add the following definition below the other ones you have added before, changing the /public_html value with to the directory where your network is located (ex.: “/my_sub_dir_where_the_network_is“).
If for any reason the domains are not being automatically added to your cPanel after this setup, head to WP Ultimo > System Info > Logs and search for the cpanel.log file (not the cpanel-cookie.log). Errors like wrong credentials or access denied get saved to that file when they happen.