Jump to content
  • 0

How to configure API and Packages for Centos Web Panel


adamjedgar

Question

Hi guys,

I am not having a lot of success with setting up the Blesta Module for Centos Web Panel.

i have setup and configured modules for virtualmin and cyberpanel without too much trouble and they are both working, however CWP is not so easy.

I have gone into CWP and created an API key (also assigning some options using the checkboxes)

I have then gone into blesta and installed the CWP module

I am not really sure what to do from this point? (i have tried creating a package in Blesta that matches one on CWP and an order form, however, i get error 503 Service unavailable). I am able to select the CWP server, however, it doesnt show a dropdown list of available packages on the CWP server as i would have expected? 

Is there a step by step outline for this?

 

kind regards

Adam

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Wohooo....I have it working at last.

The procedure is as follows:

1. setup the Blesta Module on your web server where blesta is installed.

2. Create an API key in CWP which can then be added to the Blesta Module

3. Now for the stupid part and the easy fix to my complete waste of almost a week...

-Log into Centos Web Panel as Root 

-Open file manager and navigate to /usr/local/cwp/.conf/

-in the above directory create 2 new files (they most likely do not exist)

1. api_key.conf (open this file and copy and paste just the API key created in CWP into this file then save it)

2. api_allowed.conf (open this file and paste just the IP adress of the webserver where Blesta is installed...if blesta has its own IP address then i would imagine one should use that ip address)

 

Now your CWP module for Blesta should work provisioning new accounts in Centos Web Panel. 

Please note, i havent done any further testing at this point (ie i am not sure if all other functions of the module such as suspending, deleting, etc work).

 

Paul and Tyson, If you dont mind i will do a full write up of exactly how to do this (with screenshots) and forward that to you guys to add to the Blesta Wiki for this module.

 

Hope this helps others...it has been a very infuriating process for me and i have directed my anger at some people who really didnot fully deserve it. So to Paul and Tyson, i apologise for that. 

 

I think the moral of the story is, "ensure that modules have decent working tutorials on how to configure them before releasing for public use!" In this case, things fell in a heap because the CWP API does not actually work properly...anyone who would create such functionality should have realised that they also needed to add scripts that automatically inserted IP addresses and API key into new files and directory as i outlined above!

 

kind regards

Adam

 

 

Link to comment
Share on other sites

  • 0

Yes, as Tyson mentioned check the module log. Also check your firewall. Your Blesta server needs to make an outgoing connection to CWP, so your Blesta server should allow the egress connection and your CWP server should allow the ingress connection.

Link to comment
Share on other sites

  • 0
43 minutes ago, Paul said:

Yes, as Tyson mentioned check the module log. Also check your firewall. Your Blesta server needs to make an outgoing connection to CWP, so your Blesta server should allow the egress connection and your CWP server should allow the ingress connection.

oh i hadnt thought of that...i just assumed that because blesta is working on my two other servers using the same network firewall rules (set at my Vultr.com dashboard), it would also use those same ingress and egress rules to connect with the CWP instance?

 

hmmm thats strange...I installed this yesterday(as you can see in image number 2...shows CWP at the top of installed list), however, the CWP module does not have any entries in my Blesta>Tools>logs???

 

Blesta CWP Module Logs - no log recorded.png

Blesta Installed Modules.png

Link to comment
Share on other sites

  • 0
On 4/2/2019 at 9:36 AM, Paul said:

Yes, as Tyson mentioned check the module log. Also check your firewall. Your Blesta server needs to make an outgoing connection to CWP, so your Blesta server should allow the egress connection and your CWP server should allow the ingress connection.

Can someone proivde me with an outline of how to setup CWP module with Blesta?

Currently there doesnt appear to be any guidance on this?

Link to comment
Share on other sites

  • 0
19 hours ago, Paul said:

The screenshot you posted from Tools > Logs > Module log had a CyberPanel entry. Click the row (Not the link) and it will expand and show you the raw input/output with the API, which may be helpful in determining what the issue is.

Is the Cyberpanel information going to be useful in helping me setup CWP Module (Centos Web Panel)?

 

Seems to me that they have very different installation requirements?

 

Can I have something to help with CWP? (It has no documentation listed in Blesta docs)

 

I now have the pro version of CWP and need to get this working urgently.

Link to comment
Share on other sites

  • 0
On 4/9/2019 at 3:37 AM, adamjedgar said:

Is the Cyberpanel information going to be useful in helping me setup CWP Module (Centos Web Panel)?

 

Seems to me that they have very different installation requirements?

 

Can I have something to help with CWP? (It has no documentation listed in Blesta docs)

 

I now have the pro version of CWP and need to get this working urgently.

If you want to PM me all the details (CWP and Blesta credentials) and steps to reproduce the issue I can take a look.

Link to comment
Share on other sites

  • 0

ok,

so because i have blesta on same server, i have setup a cron to run from Virtualmin...instead of blesta

Webmin> System > Scheduled Cron Jobs...create a new scheduled cron job

Execute cron job as = root

command = /usr/bin/php -q /home/user/domains/billing.mydomain.com.au/public_html/blesta/index.php cron > /dev/null 2>&1

When to execute= 5 minutes, all hours, all months, all weekdays

Date range to execute = Run on any date

 

Also, in looking at the cron jobs list for the server, i note that i also have the following on the billing virtual server (user is the virtual server owner...not root)

 

/usr/bin/wget -q -O /dev/null http://billing.mydomain.com.au/admin/cron.php

 

 

 

Isnt this already setup to run the cron? Why am i also being asked to adding another one as the root user?

 

which one should i delete?

 

Do i keep the "virtual server user" cron job, or the "root user" cron job?

Link to comment
Share on other sites

  • 0

oops got off topic with last post...i have two issues, one for virtualmin and one for CWP.

 

So to correct my previous post... in CENTOS WEB PANEL

I have created a new cron and when i check the Centos Web Panel services... service crond status (the cron scheduler is loaded and active)

If i type the following

tail -n 20 /var/log/cron

i note that Centos web panel is running the cron at 5 minute intervals as expected for root (even though cron code has /user/ ???)

 

However, when i check CWP, no new accounts are being created in CWP???

 

I still cannot find anything to do with CWP module in any Blesta logs either. 

 

Something is seriously wrong with this plugin...without any setup documentation, I am flying completely blind. Surely whoever wrote this plugin must have some idea of how to set it up correctly???

Link to comment
Share on other sites

  • 0

As an update to this issue, I viewed a competitors CWP Module (whmcs) video tutorial.

 

When I go through the WHMCS installation tutorial for their CWP module, in addition to inputting API key, a username and password fields also exist that must be filled out. The user inputted into these fields is the "Root" user for CWP itself!

 

So, In order for a WHMCS module on another server to provision services on a CWP VPS, the root user and password for the CWP VPS must be inputted into the WHMCS module.

 

Does this mean that the API key on its own is not enough? I don’t see anywhere in the Blesta CWP module where one can input root user and password.

 

In the absence of username and password fields in the Blesta CWP Module, my assumption is that Blesta is attempting to use its own “admin” user to provision services via CWP API? If CWP doesn’t allow admin as a user (or doesn’t have that user) can this autoprovisioning still actually work in CWP with just an API key and nothing else? (the WHMCS tutorial for their module seems to indicate that it will not work without also inputting CWP root user and password)

 

To make a comparison with some other modules we use in Blesta...

The Blesta Virtualmin module requires “root” user and “password” to be added (i realise it has no API Key). So Blesta is actually logging into virtualmin with high level access as root user (Cyberpanel is the same).

Vultr on the other hand, is same as CWP, it simply requires API Key only. However, perhaps CWP API is not programmed as well as Vultr and therefore the API key on its own is not enough...one still needs the root user and password entry?(those fields are missing in the Blesta CWP module)

 

So is a potential solution for me to somehow change the Blesta admin user to "root" with the identical password to that used in CWP? If the answer to this is YES, how do i achieve that?

 

Adam

Link to comment
Share on other sites

  • 0
On 4/17/2019 at 11:41 AM, adamjedgar said:

Wohooo....I have it working at last.

The procedure is as follows:

1. setup the Blesta Module on your web server where blesta is installed.

2. Create an API key in CWP which can then be added to the Blesta Module

3. Now for the stupid part and the easy fix to my complete waste of almost a week...

-Log into Centos Web Panel as Root 

-Open file manager and navigate to /usr/local/cwp/.conf/

-in the above directory create 2 new files (they most likely do not exist)

1. api_key.conf (open this file and copy and paste just the API key created in CWP into this file then save it)

2. api_allowed.conf (open this file and paste just the IP adress of the webserver where Blesta is installed...if blesta has its own IP address then i would imagine one should use that ip address)

 

 

Thank you,
I am almost frustrated setting the cwp module in Blesta. but can succeed with this method

Link to comment
Share on other sites

  • 0

CWP has recently (actually it's been a while) announced a User Panel, which is available at port :2082 (Non-SSL), :2083 (SSL).

However, Blesta provides a link (when we click Go To Panel(I guess)) to the Admin Panel, where the client cannot login anymore.

 

It will be good to change the link for the client from 2030/2031 to 2082/2083.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...