1)
Configuring the module
a. General
Settings: ( plesk.setup.php )
b. Crontab
Settings: ( plesk_cron.sh )
c. Hosting
Plans: (
provision_plesk_plans )
d. Copying the
files
2)
Copying the Files
3)
Crontab Configuration
4)
Setup the Module in HostAdmin
5)
Setup of Hosting Plans in HostAdmin
6)
Testing
If you are
reading this file, we can only assume you download and extracted the Plesk 5.0
Module for HA. That being said, let us lay out the requirements to finish
setting this module up. You will need:
a) A
server with PSA 5.0 and PSA Creation Utilities Installed,
b) HostAdmin
v3.0 Installed.
c) Root
access on the PSA machine, to create the crontab job.
The actions that can be automated
using HostAdmin with the Plesk Module:
-
Account Creation
-
IP Based Domain Creation
-
Virtual Domain Creation
-
Hosting Plan Update to Existing Domains
-
Suspension Of Existing Domains
-
Unsuspension of Existing Domains
-
Deletion of Existing Domains not supported - Domains are Suspended
Instead.
When you unzipped the Plesk Module download, it should have
created a directory containing this file and a license agreement file, as well
as a /provision/ directory.
In the
/provision/ directory, you will see the following files:
-
plesk.setup.php
-
provision_plesk_5.x.php
-
provision_plesk_plans.php
-
plesk_cron.sh
We will
need to change some of the configuration settings in plesk.setup.php. With a
text editor, open the "plesk.setup.php" file.
You need to
find the following lines for configuration and configure them as instructed.
define(ALLOWED_IP,
'127.0.0.1');
> Locate
this line and change '127.0.0.1' to the IP of the machine that HostAdmin is
installed on. Setting this variable limits access to the provisioning script to
that only IP address.
>
EXAMPLE: '207.44.147.144'
define(KEYCODE,
'test');
> Locate
this line and change 'test' to another password of your choice. This same
password will be entered into HostAdmin later, so write it down somewhere.
Setting this variable acts as further validation to prevent unauthorized access
to the provisioning script.
>
EXAMPLE: 'password-1’
define(BIN_PATH,
"/usr/local/psa/bin/");
> This setting should
not need to be changed, unless for some reason your PSA creation utilities are
in another directory. If they are not, do not change this setting.
define(JOB_PATH,”/usr/local/psa/home/vhosts/<YOUR_SITE>/httpdocs/wherever/");
> Locate this line and
change the path to wherever you will be copying these files after configuration
is complete. This has to be a web-accessible location, so that HostAdmin can
post the account/domain provisioning variables as needed. Write this down somewhere and make a note
that it is the JOB PATH, because we will
need it in little bit! Also, as a consideration, this path will need to be
writable by PHP, so it will need CHMOD settings of 777. It should also be a
path nobody will just stumble across; it should be created for these files alone!
> EXAMPLE:
“/usr/local/psa/home/vhosts/hostadmin.com/httpdocs/hidden1/”
After
making these changes, close and save the file.
With a text editor, open the "plesk.cron.sh
" file. When this file has been configured, it will be set up as a crontab
job and will run all the provisioning task sent to it by the HostAdmin queue.
You will need to find the following lines in the file and
modify them.
> Locate
this line and change the path to the JOB PATH
from step1.a. This will be where the jobs_new file is written; it will contain
the commands to be sent to the PSA creation utilities.
>
Example: “/usr/local/psa/home/vhosts/hostadmin.com/httpdocs/hidden1/new/”
> This
will be where the completed jobs files are written; it will contain records of
all the commands that were sent to the PSA creation utilities. It can be the JOB PATH from 1.a, or another directory. This
directory will need to be writable by PHP, so CHMOD it to 777.
>
Example: “/usr/local/psa/home/vhosts/hostadmin.com/httpdocs/hidden1/old/”
After
making these changes, close and save the file.
With a text editor, open the "provision_plesk_plans.php
" file. When this file has been configured, it will contain a set of
templates that HostAdmin can use to set up preconfigured hosting plans in
PSA. This will allow you to define
bandwidth limitations and all the other PSA settings that can be controlled,
such as FTP, Telnet, PHP, CGI, etc…
For each plan you wish to configure, you will need to define
a template, and give it a name so that HostAdmin can associate it with a hosting
plan.
There will be an example template in this file, you can copy and paste it to
create other plans. For each plan you create, you can associate it to a hosting
plan in the administration area of HostAdmin by entering the “name” you
specified in the file into the “Corresponding Package” field in the Hosting
Plan detail page.
After
making these changes, close and save the file.
Now we need to copy all the files in the provision directory
to the JOB PATH from steps 1.a and 1.b.
You can use and FTP program if they are being copied to a remote location, or
just using your server’s copy command if you are local to where the files are
going.
Be sure all
the following files get copied:
- plesk.setup.php
-
provision_plesk_5.x.php
-
provision_plesk_plans.php
-
plesk_cron.sh
Also, since PHP needs write
access to create the jobs_new file for the crontab job, make sure the directory
is set to CHMOD 777. You can do this with command line commands from
shell/telnet, or by FTP with most FTP programs.
This step explains how to setup HostAdmin so it can
communicate with the Plesk module.
Open your web browser and login to your HA3 admin area.
> Example: http://www.domain.com/hostadmin/admin/
Go to: Administration > Add Server
This will bring you to the “Server Details” form, where you
can configure your server details. An explanation of the required fields and
their usage are below:
Name:
> Usage: This will be the name used by
HostAdmin to reference this server.
You will be
able to select this server when adding/updating new hosting plans
in
HostAdmin.
> Example: Plesk
Server 1
> Required: Yes
Description:
> Usage: This is can be used to enter notes about this server,
only the admin can view this.
> Example: This
is our first Plesk Server
> Required: No
IP List:
> Usage: If you will be selling IP Based hosting plans on this
account, then you will need
to enter
your IP list here. HostAdmin will automatically maintain this list, removing
used IP
when new IP based domains are provisioned.
HostAdmin
uses this field so it knows the IP address of the IP based domain
when it emails the customer their account
details after provisioning.
Enter only
one IP per line, and leave no empty lines.
> Example: 127.0.0.1
127.0.0.2
127.0.0.3
> Required: Yes,
if you are selling IP based hosting.
Server Virtual IP:
> Usage: This will be the servers base IP
that it uses for virtual hosting accounts.
HostAdmin
uses this field so it knows the IP address of the virtual domain
when it emails the customer their account
details after provisioning.
> Example: 127.0.0.1
> Required: Yes
API Host Name:
> Usage: This will be the host name to
the JOB PATH were you copied the Plesk
Module in step 2.
All you
enter here is the hostname.
Assuming
you copied the module to http://www.domain.com/secret/
you would
enter “domain.com”
here.
> Example: domain.com
> Required: Yes
API Script Location:
> Usage: This will be the web-accessible script location of
the JOB PATH were you copied
the Plesk
Module in step 2. All you enter here is the hostname.
Assuming
you copied the module to http://www.domain.com/secret/
you would
enter
“/secret/provision_plesk_5x.php” here.
> Example: /secret/provision_plesk_5x.php
> Required: Yes
API Password:
> Usage: This needs to be the same value
as you defined in step 1.a.
> Example: password-1
> Required: Yes
Provisioning API:
> Usage: This associates this server with
a defined provisioning type, so HostAdmin will know
what actions the server is capable of, and which
ones must be done manually.
You must
select “Plesk 5.0” from the menu.
> Example: Plesk
5.0
> Required: Yes
Mode:
> Usage: Your options here are:
Provision Manually:
If you want
all the queue items sent to this server to be sent to the queue for manual
addition.
Test Mode:
All queue
items sent to this server will be automatically returned as “Complete” to
emulate a
successful transaction
Live (Full Automation)
All
queue items will be sent to the server for actual completion.
This is the
required selection if you want hostadmin to really do the provisioning.
> Example: Live
(Full Automation)
> Required: Yes
Debug:
> Usage: Selecting this box will echo the results returned
from the server.
We recommend you turn this on while in the testing stage,
then unselect it before your site goes live.
> Example: Checked
> Required: No
CP URL:
> Usage: This is where you enter the PSA control panel URL
where your customers can
Login to the PSA control panel
and view their account/domain details. This
URL will be included in the
email that is sent when provisioning is complete.
> Example: https://www.domain.com:8443/
> Required: No,
but recommended!
MISC URL:
> Usage: This URL is included in the
email default email template sent to the customer
when their domain has been
provisioned. You can enter the URL to where your
customer service page, help
files, or other usage information for your hosting
is located.
> Example: http://webhost.com/help.html
> Required: No,
but recommended!
Email Text:
> Usage: This optional field can be used
to send your customers specific details for this
server, in addition to the
standard email that is sent when a domain is
provisioned.
> Example: na
> Required: No
Now click the “submit” button to add your server to
HostAdmin.
In order to begin provisioning new domains, you must define
at least one hosting plan in HostAdmin that will be associated with server
record you created in the last step. This step will explain how to do so.
Open your web browser and login to your HA3 admin area.
> Example: http://www.domain.com/hostadmin/admin/
Go to: Administration > Add Hosting Plans
This will bring you to the “Hosting Plan Details” form,
where you can configure your new hosting plan details. An explanation of the
required fields and their usage are below:
> Usage: This will be the name of the
hosting plan displayed to your customers.
> Example: Standard
Plan
> Required: Yes
Description
> Usage: Description of the hosting plan
displayed to customers, HTML and PHP are ok.
> Example: Your hosting
plan information
> Required: Yes
Base Price
> Usage: This is the base price of the
hosting plan before any setup fees, if any. This will
also be the
price that is charged in a recurring basis if this is to be a recurring
charge.
> Example: 49.99
> Required: Yes
Setup Price
> Usage: This is the one-time setup fee
that will only be charged for this plan.
> Example: 14.99
> Required: No
Recurring Charge
> Usage: Check this box if this is to be
a recurring charge, or if you want this plan to expire after
a
predefined period of time.
> Example: Checked
> Required: No
Billing Frequency
> Usage: This defines how often the ‘base
price’ is to be re-billed for recurring charges, in days.
> Example: 30
(same as monthly)
> Required: Yes,
if recurring.
Billing Periods
> Usage: How many times the recurring
charge is to bill before this plan expires, if ever.
The plan to
expire after one billing period set the value to 1, if you want it
To expire after 12 billing
periods, set it to 12. If you want it to bill for infinity,
Set it to 9999
> Example: 36
> Required: Yes,
if recurring
Available to Shoppers
> Usage: Uncheck this if you want it to
be a special plan that your customers
do not have
access to. Then, it can only be setup from the admin area.
Also, your
can come back and uncheck it if you wish to discontinue the
Plan at a
later date.
> Example: Checked
> Required: Yes,
if you want it to display to your customers.
IP Based
> Usage: Check this if the it is an IP
based plan, as apposed to a virtual hosting plan.
> Example: Checked
> Required: No
Provision On Server
>
Usage: From
the menu, select the server that this hosting plan is associated with.
When a
customer orders this plan, the provisioning will be sent to this
Server.
> Example: Select
the server you just set up in the previous step.
> Required: Yes
Corresponding Package
> Usage: This field is very important for
provisioning, you must enter the name of a
plan you
defined in step 1.c. Otherwise, the provisioning script will not know
what
settings to define when provisioning the new domain, and will fail.
> Example: standard
> Required: Yes
Now click the “submit” button to add your new hosting plan
to HostAdmin.
Congratulations, you have finished the configurations!
You can now test your setup to see if you have everything configured correctly.
Open your web browser and login to your HA3 admin area.
> Example: http://www.domain.com/hostadmin/admin/
Go to: Domains > Add
Select an account from the menu, and then click select to continue.
In the hosting plan menu, select the plan you just added.
Enter any domain name (example: test.com )
Next, click the add button to continue.
You should see the debug info returned by the “plesk_provision_5x.php” script
on your server. If not, check that debug mode is turned on for the server you
added, and that the “API Host Name” and “API Script Location” in the server
details are both entered as instructed.
When you get a “TRUE” result from the server, the domain should be provisioned
after the cron job runs the next time.
If you get any error messages or are having trouble at this point, please post
your issues in the forum, or submit them to the dreamcost.com support team by
email support@dreamcost.com.