2012-06-18 Update

Our last article brought you up to date on some aspects of our localization efforts. However the team working on integration with the translation service have not stood still. What have they accomplished since the last article? What are they currently working on? What do we intend in the future for localization in cPanel & WHM? Continue reading

Category: Product Development | 6 Comments

Localization Update

You’re probably wondering what’s going on with Localization in cPanel & WHM. In cPanel & WHM 11.32 we introduced a new login system with enhanced localization capabilities. More on these capabilities later. One thing notable about the login system is every piece of text, every string, is localized.

So why are these localized strings of such poor quality?

The current state of quality is because all the strings (in the login system) are machine translated (except for English). This is not the desired end state, only a step in the process. Continue reading

Category: Product Development | 2 Comments

Developing with LiveAPI

In earlier versions of cPanel, developers included a script called LivePHP. This technology is essentially an internal window on the server to make API 1 and API 2 calls to the local machine via a socket to cpsrvd. Through LivePHP, you could use API functions through API tags and our Remote XML or JSON API. This is the suggested best practice for accessing cPanel functionality from your Plugins for reasons of simplification and also reducing network overhead.

Where previously the Live environment only included PHP, we have now expanded it to include multiple languages, Ruby, Python, Perl, as well as PHP; and have renamed it LiveAPI.

cPanel ships with example scripts for both PHP and Perl. Both scripts can be found in the x3 directory (/usr/local/cpanel/base/frontend/x3/) of your cPanel installation. The scripts are named test.live.php and test.live.pl.

For reading about specific module usage for LiveAPI, please see our documentation. Or if you have usage questions along the way, please feel free to post in our developer forums where we have dedicated cPanel development staff available to help.

Category: Product Development | 2 Comments

Create Custom cPanel Modules

Nearly all cPanel actions are governed by cPanel API1 and API2 functions.

For your application, instead of creating your own API from scratch, we’re created the ability to add your application’s logic to the cPanel XML/JSON API. Essentially speaking, your custom cPanel Perl Module can create a remote window of access to your application’s functions to be used through the XML/JSON APIs, LiveAPI, or cPanel tags.

The ability to build and use Custom cPanel Modules is available in all current versions of cPanel.

We’ve updated our documentation and have provided a complete, working example of a custom cPanel Perl module, available for download on our Github account. This example Perl module, it's inline comments and POD documentation, along with prior existing documentation, should provide a great resource for anyone wishing to leverage the cPanel API!

, | Category: Product Development | 1 Comment

Test it in the User Interface

After spending time in the Developer section of the cPanel Community Forums, we’ve found a commonly asked question: “Why won’t my script work with XYZ function using the XML/JSON-API?”

Rewinding a bit, the purpose of the XML/JSON API is to allow usage of cPanel & WHM functions through applications or scripts. Naturally, the first question we often ask, when trying to figure out why a script isn’t working, is if the user is trying to do something that they couldn’t normally do through cPanel & WHM. Continue reading

Category: Product Development | Comments Off

Pointing two URLs to the same website

Introduction

Pointing two URLs to the same website is a good way to direct traffic to your site from several different domain names. You can accomplish this in two ways: either redirect one of the URLs to your primary domain, or park one of the URLs, which points that domain towards your primary domain.

Redirecting a website

A redirect occurs when typing a web address in the address bar sends a visitor to another website (or URL), different from the one typed in. For example, if you moved your website content to a new URL, you can direct your seasonal visitors (who may remember your old web address better than your new one) to your new location, using a redirect. Continue reading

Category: Tips & Tricks | 7 Comments

Managing Multiple Domains from a Single Hosting Account

Introduction

Managing multiple domains from a single hosting account is relatively easy but will require you to correctly configure some DNS settings and create addon domains.

For this post, I’m going assume you’ve already registered a few domains and have access to your hosting interface via a main domain.

Before going any further, let’s specify some working examples: Continue reading

Category: Tips & Tricks | 11 Comments

Making your script work with security tokens in cPanel & WHM

What is a security token?
“Security token” URLs were added in cPanel & WHM 11.25 as a security measure, and they were enabled by default in version 11.28. They help combat a common type of attack called a Cross-Site Request Forgery (XSRF).

So, what does a “security token” look like? Take, for example, this URL:
https://example.com:2087/i/love/cpanel

With security tokens enabled, this would become:
https://example.com:2087/cpsessYYYYYYY/i/love/cpanel

In that example, cpsessYYYYYYY is the token unique to that logged-in user on that browser. (You can learn more about security tokens in cPanel & WHM by reading our Security Tokens white paper.) In order for your custom script to work with cPanel & WHM, every URL involved needs to be compatible with the security token.

Creating security token-compatible URLs

Fortunately, it is very easy to do!

The token is available in the environment variable ‘cp_security_token’.

If security tokens are not in use, ‘cp_security_token’ will be an empty string.

If security tokens are in use, ‘cp_security_token’ will be, in terms of the above example: /cpsessYYYYYYY

Note the preceding slash! Since the variable has that slash, the examples will work whether cPanel & WHM has security tokens enabled or disabled.

  • Here’s how you’d use it in Perl code that calls one of our API URLS.
    Simply change this:

    my $APIurl = "http://127.0.0.1:2087/xml-api/$url";

    to this:

    my $APIurl = "http://127.0.0.1:2087$ENV{'cp_security_token'}/xml-api/$url";

  • Here’s how you might use it in JavaScript for, say, an AJAX call.
    First, make it available to your JavaScript. For example:

    print <<"END_SECURITY_TOKEN_JAVASCRIPT";

    if ( !("CPANEL" in window) ) CPANEL = {};
    CPANEL.security_token = "$ENV{'cp_security_token'}";

    END_SECURITY_TOKEN_JAVASCRIPT

    Next, make your URLs compatible by changing this:

    var ajaxURL = '/3rdparty/ZZZ/zzz.cgi';

    to this:

    var ajaxURL = CPANEL.security_token + '/3rdparty/ZZZ/zzz.cgi';

Category: Product Development | 5 Comments

Preview of the new Logaholic website analytics feature.

Logaholic is a new feature that is now available in the the 11.31.1 EDGE build. Logaholic is a web site statistics program that provides you with a visual representation of your web site visitors.

Logaholic is a powerful web analytics (log file processor) solution that delivers reliable, objective visibility reports about the performance of your web site traffic, content, keywords and marketing.

cPanel & WHM EDGE tier releases are development preview releases which allow users to test changes prior to production release. They are not intended for mission critical production environments.

Category: Partners & Customers | 10 Comments

LivePHP

Currently, if you want to write a Plugin for cPanel, you can write it in either LivePHP or cPPHP. Last year, we put some major effort into refactoring LivePHP. We added better debugging information, optimized the socket communication protocol, and added a few other tweaks. After a year of vetting by external developers, I can say with confidence: there is no longer any reason to use cPPHP when developing your application. Continue reading

Category: Product Development | Comments Off
Page 10 of 14« First...89101112...Last »