WHM Plug-In

From PhpCOIN Documentation

Jump to: navigation, search

Developer: Keith D. Holler (azcappy) - bugs@azcappy.com

Current Version: v1.6.0


The WHM Plug-In and this documentation assumes that you have at least a basic knowledge of and rudimentary skills in PHP, HTML, MySQL & cPanel operations. Before installing the WHM Plug-In, you MUST completely configure phpCOIN. It gathers all of its information for operation from phpCOIN. If you do not have it completely configured, IT WILL NOT WORK!


Contents

About The WHM Plug-In

The WHM Plug-In began life in 2003 as the brain-child of Jeremi Bergman. He continued development until the final v1.3.4 released on August 2, 2005 and it continued in wide use until February 23, 2008. Then the powers that be at COINSoft (you know who you are) made some major code changes, security changes and a complete overhaul of the database access routines in the phpCOIN v1.4.0 release, completely breaking the WHM Plug-In. A rewrite was required and Keith Holler picked up the torch and ran with it creating v1.4.0 (coded completely overnight) released on March 4, 2008 that was completely phpCOIN v1.4.0 compliant. With many fresh great ideas, combined with the new features added to cPanel/WHM since 2005, development continues.

  • What the WHM Plug-In is:
    1. An interface within phpCOIN to perform basic server functions such as add, delete, suspend and unsuspend accounts using a remote access key within cPanel/WHM on the server
    2. A form of automation to automatically create new accounts based on payment completion using client/domain data collected during the order process by means of the built in API system in phpCOIN
  • What the WHM Plug-In is NOT:
    1. It will not automatically suspend or unsuspend server accounts based on past due invoices (we are working on it though)
    2. It will not support more than one server at a time (we are working on that too)
    3. It will not make beds, change diapers, feed the cat or make coffee (sorry lightman)
  • In a default installation, the WHM add-on will use the phpCOIN API system to:
    1. Delete an existing domain in WHM when an admin manually deletes an existing domain in phpCOIN
    2. Add a new domain to WHM when an admin manually creates a new domain in phpCOIN
    3. Add a new domain to WHM when a client "returns" to your phpCOIN site from a billing vendor such as PayPal during the order process. This means that if a client does not "return", WHM cannot be triggered. An alternative is to trigger WHM on order-create instead of order-return


How To Install

Step 1: Completely Configure phpCOIN

  • You must set your default server IP. This is the IP WHM Plug-In uses to access your server:
  • Admin -> parameters -> domains -> Domain Account Default IP Address
    
  • Then make sure you have the server configured in:
  • Admin -> Server Info
    

If you don't have phpCOIN completely configured... WHM will not work properly. It depends on phpCOIN for all of its information.

 
Step 2: Extract The Archive:

  • Extract all files from the zip, making sure you maintain the folder structure.
  • Copy the folder /coin_modules and the contents of that folder to your phpCOIN installation.
  • Copy the folder /coin_lang and the contents of that folder to your phpCOIN installation.
  • Copy the folder /coin_overrides and the contents of that folder to your phpCOIN installation. If you already have a /coin_overrides/constants_override.php file, then instead of overwriting your file with ours, simply add the lines in ours to your own.
  • Copy the folder /coin_includes and the contents of that folder to your phpCOIN installation. If you have made any changes to /coin_includes/api.php, then instead of overwriting your file with ours, simply compare the two files and insert into your file the code found in the following functions of our file:
  •  APIO_order_ret_proc
     APIO_domain_new
     APIO_domain_del
    
  • The sql schema files and the README.txt in the root folder of the zip do NOT need to be copied anywhere.

 
Step 3: Modify the phpCOIN Database:

  • Log into cPanel and use phpMyAdmin to execute the queries in setup.sql on your phpCOIN database. You do this by selecting your phpCOIN database in the left pane of phpMyAdmin.

    Image:Myadmin1.jpg

    and then click the SQL tab. Copy & paste the contents of the setup.sql file into the space provided and click go.

    Image:Myadmin2.jpg

 
Step 4: Configure the WHM Plug-In:

  • In the file /coin_modules/whm/config.php replace the contents of the variable $_CCFG['WHM_RAK'] with your hash remote access key from WHM on your server. It can be found at: Cluster/Remote Access -> Setup Remote Access Key. Then save and close /coin_modules/whm/config.php
  • Browse to Admin -> Parameters -> Group: ALL SubGroup: WHM and change the settings as necessary. (See the WHM Plug-In Parameters section below for details)

 
Step 5: Match Your WHM Packages to phpCOIN Products:

  • When you are logged-in as an administrator, browse to http://my.phpcoin.com/mod.php?mod=whm&mode=match_prods

 
URLS for Usage:
(Beginning in WHM add-on v1.4.3 these links will automatically be added to the Administrator menu block during installation.)

  • View: mod.php?mod=whm
  • Quick Add: mod.php?mod=whm&mode=add
  • To alter package matching in future: mod.php?mod=whm&mode=match_prods


How To Upgrade

Step 1: Extract The Archive:

  • Extract all files from the zip, making sure you maintain the folder structure.
  • Copy the folder /coin_modules and the contents of that folder to your phpCOIN installation.
  • Copy the folder /coin_lang and the contents of that folder to your phpCOIN installation.
  • Copy the folder /coin_overrides and the contents of that folder to your phpCOIN installation. If you already have a /coin_overrides/constants_override.php file, then instead of overwriting your file with ours, simply add the lines in ours to your own.
  • Copy the folder /coin_includes and the contents of that folder to your phpCOIN installation. If you have made any changes to /coin_includes/api.php, then instead of overwriting your file with ours, simply compare the two files and insert into your file the code found in the following functions of our file:
  •  APIO_order_ret_proc
     APIO_domain_new
     APIO_domain_del
    
  • The sql schema files and the README.txt in the root folder of the zip do NOT need to be copied anywhere.

 
Step 2: Configure the WHM Plug-In:

  • In the file /coin_modules/whm/config.php replace the contents of the variable $_CCFG['WHM_RAK'] with your hash remote access key from WHM on your server. It can be found at: Cluster/Remote Access -> Setup Remote Access Key. Then save and close /coin_modules/whm/config.php
  • Browse to Admin -> Parameters -> Group: ALL SubGroup: WHM and change the settings as necessary. (See the WHM Plug-In Parameters section below for details)

 
Important Note:


Beginning in phpCOIN v1.4.0, the array value numbering changed in the domain status setting. They are now:

1 - n/a
2 - hosted
3 - parked
4 - other

If upgrading from 1.3.x to 1.4.x, you must change the setting in Admin -> Parameters -> Group: ALL SubGroup: WHM -> "Status of Domain to be in for the mod to compare" to 2 for hosted or 2 3 for hosted and parked domains for them to appear on the WHM page correctly. Of course you have to set the status on each domain accordingly.


 
Step 3: Update Database (If Necessary):

  • Log into cPanel and use phpMyAdmin to execute the queries in upgrade_to_v160.sql on your phpCOIN database. You do this by selecting your phpCOIN database in the left pane of phpMyAdmin.

    Image:Myadmin1.jpg

    and then click the SQL tab. Copy & paste the contents of the upgrade_to_v160.sql file into the space provided and click go.

    Image:Myadmin2.jpg

 
Step 4: Match Your WHM Packages to phpCOIN Products:

  • When you are logged-in as an administrator, browse to http://my.phpcoin.com/mod.php?mod=whm&mode=match_prods

 
URLS for Usage:
(Beginning in WHM add-on v1.4.3 these links will automatically be added to the Administrator menu block during installation.)

  • View: mod.php?mod=whm
  • Quick Add: mod.php?mod=whm&mode=add
  • To alter package matching in future: mod.php?mod=whm&mode=match_prods

WHM Plug-In Parameters

To access the WHM parameters, browse to:

Admin -> Parameters -> Group: ALL SubGroup: WHM

Beginning in WHM add-on v1.4.3 a wrench button was added to the end of the title and version that will take you straight to it without browsing through all of those pages.

The available settings are:

Check and report suspended accounts

If Yes, whm will attempt to report if an account is suspended or not. We've managed to get this to actually work with only one version of cPanel/WHM. They keep changing the status variables on us. If we can't get it to work consistently, this feature will be removed in future versions of the plug-in.
(Default: Yes)

Debug WHM

This will show extra details about WHM that will help determine common errors.
(Default: No)

Default path to home dir

When the account is not listed in phpCOIN or the dom_path is not set, this path will be used to determine if the account is suspended or not.
(Default: /home/%username%/public_html/)

Delete Domain from WHM when domain is deleted?

(Default: Yes)

Send Order Acknowledgement on WHM insert

Possible values: on/off
(Default: on)

Status of Domain to be in for the mod to compare

This is tied directly to the status field on the domain records in phpCOIN. Set this to the numeric representation of the statuses you would like WHM to use when pulling accounts from phpCOIN (1=n/a, 2=hosted, 3=parked & 4=other). You can separate more than one value with a space. (ie. 1 2 4)
(Default: 2)

WHM Auto Create on Order

Automatically create the account on the server when an order is returned successfully from the vendor paylink.
(Default: Yes)

WHM Host Domain (Deprecated)

This is the host address for WHM on your server. It can be localhost if the same server phpCOIN is running on or an IP address.
(Default: localhost)

Depreciated beginning in WHM add-on v1.4.3: WHM now points to the current default server used for domain account creation in phpCOIN. It will use the IP address stored in:

Admin -> parameters -> Group: operation SubGroup: domains -> "Default: IP Address"

This will be one less parameter to set when installing the WHM Plug-In. A working install of phpCOIN should already be configured to the right server IP address... just set the WHM User parameter and paste the correct remote access key in /coin_modules/whm/config.php and you will be ready to rock-n-roll!

WHM User

This is the username to access WHM on your server used in conjunction with the remote access key to authenticate. Please note: If you are a reseller on someone else's server, your username will NOT be root. Please set it accordingly.
(Default: root)

WHM: Account file location

This is the path to your Accounting.php.inc file on your server. This include file contains all of the functions to perform the account actions. It is maintained by cPanel/WHM.
(Default: /usr/local/cpanel/Cpanel/Accounting.php.inc)

WHM: Number of domains on a page

This is the number of domains to show on a page when using the WHM View URL.
(Default: 25)

WHM: Variable to check upon order completion

This is the name of the variable that will either equal 1 or 0 when returning from a vendor paylink that you want to check before adding to WHM.
(Default: buy)

Troubleshooting

I just upgraded phpCOIN to a new version & the WHM Plug-In is broken

Whenever you upgrade phpCOIN, you will need to re-copy the files contained in the /coin_includes directory that came with the WHM Plug-In package back into your phpCOIN installation. During upgrade, phpCOIN restores the generic files which removes the sections needed by the plug-in to function.

I get a blank page when loading any of the WHM Plug-In pages

The versions you are running are mismatched. WHM v1.3.4 will only run on phpCOIN v1.3.1 and below. WHM v1.4.0 to v1.4.4 will only run on phpCOIN v1.4.0 to v1.5.1 R1 WHM v1.6.0 is for phpCOIN v1.6.0 or higher

If you installed phpCOIN via Fantastico or another automated installation utility, you may have to upgrade. Make sure you are running the most current version of phpCOIN and the newest version of the WHM Plug-In.

I get an accounting.php.inc error message

If you receive this error:

You will not be able to use this mod until you correct the path to the 
accounting.php.inc.
Check to make sure /usr/local/cpanel/Cpanel/Accounting.php.inc is the correct path, and 
that you do not have open_basedir security in effect. Contact your host to allow access
to this file.
There are two possible steps to take:
  • Check the path to Accounting.php.inc with your server administrator. By default it is /usr/local/cpanel/Cpanel/Accounting.php.inc
  • Check that you do not have "open_basedir security" enabled for your account which can be changed in WHM --> Security Center --> PHP open_basedir Tweak --> then tick your domain name. Again, if you are having difficulty in locating or making this change, consult your server administrator.

Domains that I know are in phpCOIN are showing up as not in phpCOIN

You need to go into:

Admin -> Parameters -> Group: All SubGroup: WHM

and change "Status of Domain to be in for the mod to compare" to 2 for hosted or 2 3 for hosted and parked domains for them to appear on the WHM page correctly. Of course you also must set each domain accordingly. Also, the WHM Plug-In will strip out phpCOIN domains that do not match the server currently being displayed. The server name and server IP fields on each domain must match the server that the plug-in is looking at.

I get a cPanel login box nested in my WHM Plug-In pages

Image:Whmissue.jpg

The ONLY cause of this is your server is refusing your login. This can be caused by two things. Either your key is wrong and doesn't match the key set on the server in WHM, or you have the wrong "WHM: User" set in the parameters. If you own the server and it is dedicated to you... the default setting of root should work. If you are an account holder on someone else's server with reseller rights... it would be your account username... NOT root.

The login you are seeing is being injected into your page by your server. It is NOT coded into the WHM Plug-In. Double check the "WHM: User" setting in parameters and set it according to your situation. Then log into WHM on your server and the key is located in:

Cluster/Remote Access -> Setup Remote Access Key

Verify that it matches what you pasted in the WHM Plug-In /coin_modules/whm/config.php file. If not, re-paste it so that they match. It must be in that format and do NOT tab lines or edit it in any way. Whenever you click the regenerate key button on your server, you must paste the new one in whm_admin.php over the old one for the plug-in to continue talking to the server.

My Server Info table at the top is empty or partially empty and

Domains in phpCOIN that I know are on the server are listed without a green check mark in the WHM column.

You do not have phpCOIN configured completely as stated in the first paragraph of these docs. You MUST have the server IP configured in the "Domain Account Default IP Address" setting in phpCOIN:

Admin -> parameters -> domains -> Domain Account Default IP Address

and the server MUST exist in the Server Info database on the admin menu:

Admin -> Server Info

Bug Reports, Development Tracking & Wish List

To report a bug, take part in the development of the WHM Plug-In or to let us know what features you would like to see in future releases, visit http://bugs.azcappy.com. All are welcome!

Technical Support

All technical support is handled on the forums at http://forums.phpcoin.com. E-mails sent for support or posted in the bug tracking system will be ignored. We want to help as many users as possible. Someone out there is having the same problem you are having and will benefit from the solutions and ideas posted on the forums. Plus it saves us from answering the same question 5,000,000,000,000,000,000 times.

Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com