Advertisment

Sunday 30 March 2014

Billing Application

Billing Application

In order to properly manage a hosting service you will need a billing application capable of processing subscription accounts on a recurring billing basis. Most hosting operators want a billing application that can accept payments and create new accounts in real-time unattended. I’m not sure why that so important to them, since real-time provisioning of hosting accounts can’t realistically make web pages available in real time. After all, it normally takes 48 hours for DNS changes to propagate anyway. But that’s what people want, and such a free application is available so that’s what we’ll cover here.

We will be installing TheHostingTool in this tutorial. TheHostingTool is free and capable of adding & removing accounts & domains in Kloxo. Probably the biggest drawback is that it only accepts payments from PayPal. If that’s what you want then it’s an asset, but otherwise it could be a drawback. If you want to accept major credit cards directly then you will need to look for something else. But at the time of this writing no other billing application is known to be capable of automatically provisioning accounts in Kloxo.

You can still provision accounts manually, so you can accept payments from check draft customers. Check drafts are checks that you print and deposit. The way it works is that you ask a customer for his checking account information over the phone or in a sign-up page (customer name & address, bank name & address, routing number, and account number), then you print a check draft each month to cover subscription payments and deposit into your checking account. The customer does not need to sign the check draft, and there are usually no processing fees (except that sometimes banks charge 10 cents or so apiece if you exceed a certain number of items). In fact, check drafts are so inexpensive that you might consider offering a discount for drafting checking accounts instead of using PayPal or a merchant account. All banks accept check drafts, and you don’t need a special account to deposit them. Any checking account will do, even a personal account. You can learn more about check drafts and find check draft software to help you create check drafts by Googling for more information.

That said, you can get TheHostingTool application software from the developer’s website, thehostingtool.com, or from a link at my server. Currently the version of TheHostingTool for Kloxo is a branch of TheHostingTool called “Reworked.” However, the people supporting the Reworked project are still at TheHostingTool website. It’s a very active software community so I expect future versions to be updated quickly, to track Kloxo updates when necessary. These instructions are aimed at installing TheHostingTool for Kloxo 6.1.12. If Kloxo comes out with a newer version before I can update this tutorial I suggest you visit the forum at TheHostingTool’s website.

Before installing the billing application you may want to wait a day or two until the nameservers propagate for your primary business domain. You won’t be able to test and configure your installation until that happens. You can come back to this section of the tutorial at any time to install the billing application, since it operates independently from other server functions.

To begin the install, create a directory in your web site for the billing application using PuTTY (substitute your domain name for yoursite.com below).
# mkdir /home/admin/yoursite.com/billing
Then download the billing application
cd /home/admin/yoursite.com/billing
wget http://entomy.com/THT-1.3.5-Reworked.zip
Staying in the billing directory, issue the following commands to begin the install.
# unzip THT-1.3.5-Reworked.zip
# cd ..
# chmod -R 755 billing/
# chown -R admin:admin billing/
# cd billing/includes
# touch conf.inc.php
# chmod 666 conf.inc.php
# chown admin:admin conf.inc.php

Go to Kloxo admin panel and create a MySQL database. Name the database "billing" and use a password you can remember. Go to the following address with a web browser, substituting your domain name for "yourdomain.com." http://yourdomain.com/billing/install Follow instructions for the installation. For database info, enter the info from the database you just created. The database username will be the same as the database name (billing, in the example). Accept localhost for hostname and tht_ for prefix. Click next, then create an administrative account (usually admin) with a password you can remember. Enter your email and your real name (or something like administrator). Click next to finish install. Issue these Linux commands. # cd /home/admin/yourdomain.com/billing # rm -r install (answer y to all questions) # cd includes # chmod 444 conf.inc.php The install is now complete, but you will need to fix a few things to make it work properly. You will need to enable curl_exec in PHP by removing it from the disable_functions list. I suggest that you remove it from the main Kloxo admin control panel, and also in the domain control panel for the domain you are hosting THT on. To do that open the PHP Config icon, select the Advanced PHP Config tab, then remove "curl_exec," from the Disable Functions list. After changing that in both the main admin panel and in the domain panel, edit the disable_functions parameter in the following php.ini files. You will find it about 20% of the way down. /etc/php.ini /home/httpd/yourdomain.com/php.ini Restart the httpd server. # service httpd restart There is a bug in the /includes/class_main.php script that prevents packages from being displayed. To fix that, you will need to patch that file according to this guide. http://thehostingtool.com/forum/thread-2043-post-11253.html# pid11253 Finally, you will need to disable ssl connections to the control panel, since ssl connections won't work between THT & Kloxo. To do that, login to the billing application by going to this link, substituting your actual domain name. http://yourdomain.com/billing/admin Click General Settings. Click Security Settings. Change "Connect to WHM via SSL" to No. Create an auxiliary admin user in Kloxo for TheHostingTool (THT from now on) to use for connecting to Kloxo. Login to Kloxo and click the Auxiliary Logins icon and create a new login. To use that login you will always need to use a suffix of ".aux". For example, if you create a login name of tht, then the username you will need to use in THT will be tht.aux. In THT, create a server. To do that, click Servers from the admin menu, then click Add Server. Call your Kloxo server Master. Enter the Kloxo IP address. Enter 7778 for both the reseller and CP ports. Enter the name servers you want your customers to use, one per line. Username will be the auxiliary login we created in the previous paragraph. Enter the name if the DNS template you normally use to create domains in Kloxo, and be sute to include the .dnst suffix. Set email to Yes, and set the server type to Kloxo. Create a test package in Kloxo. Click the Resource Plans icon, then create the test plan. Notice the name after you create it. If you names the plan "test" then it should look something like: test___client-admin You can now create a test package in TheHostingTool. Click the Packages link, then Add Package. The name might be test, and the Backend will be the full name of the test package you created in Kloxo (test___client-admin). Test the package by making it free, and select Master as the server. You can now test the signup link. It should create a new client and domain for you in Kloxo.

Without a doubt, the biggest sticking point in making THT work properly is in making sure that curl_exec is enabled. That's particularly true since curl_exec is disabled by default when Kloxo is installed. The classic symptom of curl_exec being disabled is seeing the following error in Step 5 of the signup process. An error has occurred. Please inform your system administrator. The problem is that a number of configuration glitches can generate the same error message. So before you go off on a wild goose chase searching THT for configuration glitches, you should first make ABSOLUTEY SURE that curl-exec is enabled. To do that, create a file named testcurl.php and paste the following contents. <?php echo '<pre>'; var_dump(curl_version()); echo '</pre>'; ?> Save the file, then run it as a php script. # php testcurl.php If curl_exec is not enabled then you will see this error. Fatal error: Call to undefined function curl_version() in testcurl.php on line 2 If you see that error then you still need to remove curl_exec from the disabled list from one of the php.ini files. Don't forget to restart httpd to make sure that php changes are applied. If curl_exec is enabled properly then you will see a large output with the curl parameters. When you have curl_exec enabled you should be able to get past Step 5. If the Step 5 problem persists then you probably have a problem authenticating with your hosting package or your Kloxo aux login credentials.

There are a lot of other problems that can cause the step 5 error. Usually the culprit is a leading or trailing space in a setting. If you continue to get the error check for leading & trailing spaces in the aux user, package name, server IP address, and in just about everything else. It’s usually something minor.

Before you can start charging for packages you will need to edit your PayPal information. To do that, click Paid Configuration. Enter your PayPal email address and select "live" for mode. Check your cron jobs, since the install should have added a command to run /includes/cron.php. Make sure it is active and test run the script to verify that the path is correct. It set mine to run every 5 minutes, which is a whole lot more than needed. Really, once per day should be enough. I set mine to run once per hour. Create your actual commercial packages, and direct customers to the signup links. Problems and advanced questions should be posted at the THT forum for the Reworked application.

No comments:

Post a Comment