In this article we detail the steps required to remove the Getting Started Wizard. Someone may want to do this for the purpose of delivering servers in a “Configured” state. Continue reading
As mentioned in A General Overview of Database Mapping , DB Mapping is available with the launch of cPanel 11.25.1. Let’s recap what DB Mapping is and then we can chew on the details:
- DB Mapping is core code in 11.25.1
- DB Mapping exposes DB Prefixing behaviors
- DB Mapping provides an interface for importing non-cPanel accounts
As of today, cPanel’s API1 and API2 are fully documented. cPanel’s x3 interface is entirely API-driven, meaning that every action you can perform in the cPanel interface is now documented and can be automated through our XML-API or reimplemented in a unique theme.
Accompanying the complete release of our API documentation is a guide called Writing cPanel Plugins. These documents cover all of the steps required to create a cPanel plugin, in addition to some tools you can use.
These tools include:
- LivePHP – A PHP class that allows you to use object-oriented programming to access cPanel’s APIs
- cPanel Template Toolkit (cptt tags) – A template-driven API2 parser that utilizes the Template::Toolkit library, making API2 easier to use.
As always, if you need help, don’t hesitate to post in the Developer Discussion forum.
Inside of 11.25.1 we are introducing a new feature called “database mapping” . Despite the vague name, this feature has huge implications for integrated applications, transfers from non-cPanel servers and custom themes. What this does is remove the restraint of MySQL database and usernames having to be prefixed by the cPanel account’s username.
The benefit of the DB Mapping feature is that when transferring accounts from non-cpanel systems, the database name will now be preserved rather than having to hunt it down in configuration files and waste extra time on account migrations. The other benefit is that users will not longer have the confusion of having their username automatically prefixed to the database name. When they create a database it will be the string that they type into cPanel.
The core DB Mapping functionality has been factored into the cPanel code, however the new behavior is not exposed in the cPanel interface until you enable it, i.e. ‘opt-in.’ This design provides two key benefits. 1) If you’re migrating from a non-cPanel system the database names will stay perfectly intact and 2) It eases the transition from the old, username prefixes, to the new non-prefix database names; you can chose when the best time is to offer this functionality and it’s just a click away.
To enable DB Mapping and remove the prefix behavior, a Tweak Settings toggle as been added. Enabling ones cPanel system will have no effect on pre-existing databases. CPanel interfaces and database creation will still continue to function as it has until you ‘opt-in’ from this Tweak Setting.
The affect of this on themes and integrated applications is that there will be the addition of new API calls to handle the new system of managing databases. Some backwards compatibility may be broken in the move to the new system, so please beware!
We will have a blog post detailing the technical details of this system around the same time that we release 11.25.1 to EDGE.
In my last post I talked about how to create the CentOS/cPanel installer ISO. This information is good, but what if you want to do something more? What if you wanted to pre-configure cPanel? What if you wanted cPanel to automatically use a certain EasyApache profile?
You can easily accomplish this in a way that can be used with any kickstart-based deployment method, not just the ISO image method.
Kickstart works by passing a kickstart file to anaconda (the Red Hat® installer application). This application specifies certain installation options, such as what packages need to be installed, the partitioning layout, etc. Red Hat has documentation on this here and CentOS has a nice “Tips and Tricks” guide here.
These articles cover how to handle the OS configuration aspect of kickstart. But what about the cPanel configuration? Continue reading
Over the past few weeks I have been working on a custom spin of the CentOS installation image that automatically installs cPanel. This ISO also performs some pre-installation configuration and installs updated packages as well as installing cpanel. I think this information is handy for anyone who wants to create a CentOS installation image, whether for cPanel or for something else. To create the installation image, we will modify the CentOS installation DVD; adding in a kickstart file, removing unneeded packages, and updating the remaining packages. Continue reading
Working on the front lines, I have an opportunity to see how cPanel/WHM customizations are implemented in practice. Often, I encounter novel ways of assembling our hooks and APIs to provide functionality. However, there are times when I wonder if I saw this in the CodeSOD segment on a popular developer website that offers free stickers.
You want to automate or customize cPanel, what should you do?
Before beginning your project, I recommend that you ask for guidance. Our Developer Discussions forum is located at http://forums.cpanel.net/developer-discussions.html. Here, you can learn from the experience of others who have written similar applications and apply their insight to your project. Continue reading
As most of you probably know, we released 11.25 to our RELEASE branch this week. This is a major change to cPanel/WHM which presents some issues with integration. I have been trying to track as many integration support requests as possible so that I can get an idea of what common issues have arisen. Here is a summary of the issues and what we are doing about them. Continue reading
At this point, cPanel’s APIs are not 100% documented. We are working on it and hope to have complete API docs up in a few months. I’ve written a CustomEventHandler that will print every API call made into cpanel’s error_log (/usr/local/cpanel/logs/error_log).
To use the API Tracer, you will need to download it, then place the Dumper.pm file at /usr/local/cpanel/perl/Dumper and the CustomEventHandler.pm file at /usr/local/cpanel/Cpanel.
Once this has been put into the proper location, cPanel will automatically start logging API calls to the error_log. To view each call, you simply need to run tail -f /usr/local/cpanel/logs/error_log and login to a cPanel interface to start seeing data. Continue reading
We have had a flurry of integration tickets over the past week, which is awesome to see. Most of these tickets have come down to a couple of basic problems. The first of which is due to some confusion about how to utilize HTTP to call an API function.The second problem appears to stem from a lack of information API troubleshooting tools that come with cPanel/WHM.
The first of our common problems stem from some basic confusion about how to utilize HTTP to call our API functions. The second of problem seems to come from a lack of information about how to use the tools that are available within cPanel and WHM for troubleshooting these API calls. Continue reading