Author Topic: WHMCS new module - 404  (Read 19897 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
WHMCS new module - 404
« on: March 05, 2018, 04:25:23 PM »
Hey CWP forum,

I just installed WHMCS including the cwp module. Followed the video tutorial.
https://www.youtube.com/watch?v=96dizYdi6WY&

Account creation is not working and I get 404 not found when I try the api manual.

Anybody who can give me a hint or a solution?
Thank you very much!

Offline
*****
Re: WHMCS new module - 404
« Reply #1 on: March 05, 2018, 05:22:17 PM »
what error throws you

Offline
*
Re: WHMCS new module - 404
« Reply #2 on: March 05, 2018, 05:29:16 PM »
Hey josemnunez

Thank you for your response.
I got the following error in WHMCS: Function not found

In the module log from WHMCS: the api response is empty.

But I think the problems seems to be the CWP api. You know a way to test it?
When I try to do a manual post to the CWP api I receive a 404 error.

Hope to hear from you soon.
Lexz

Offline
*****
Re: WHMCS new module - 404
« Reply #3 on: March 05, 2018, 05:33:51 PM »
Be sure to create an api key and autotize the ip involved

can do a php and test the api, replacing the values of the variables
Code: [Select]
$ data = array ("key" => "MYKEY", "action" => 'list');
$ url = "https: // IPSERVERAPI: 2304 / v1 / account";
$ ch = curl_init ();
curl_setopt ($ ch, CURLOPT_URL, $ url);
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ ch, CURLOPT_POSTFIELDS, http_build_query ($ data));
curl_setopt ($ ch, CURLOPT_POST, 1);
$ response = curl_exec ($ ch);
curl_close ($ ch);

Offline
*
Re: WHMCS new module - 404
« Reply #4 on: March 05, 2018, 05:44:19 PM »
I created a api key with the right permissions.

Also tried the php example you sended (found it under the API module in CWP)
But the result is empty.

Tried it on two different cwp servers. One of them is a CWP pro.
Other ideas?

Offline
*****
Re: WHMCS new module - 404
« Reply #5 on: March 05, 2018, 06:01:57 PM »
What does this script say?
Code: [Select]

sh /script/check_api


Offline
*
Re: WHMCS new module - 404
« Reply #6 on: March 05, 2018, 07:58:45 PM »
This is the output:

User API port 2302 check: OK
Oauth query check: OK
External API port 2304 check: OK
External API files and htaccess : OK
CSF Firewall status check: ENABLED
TCP_IN for port 2304 set in /etc/csf/csf.conf: OK
TCP_OUT for port 2304 set in /etc/csf/csf.conf: OK



Offline
*
Re: WHMCS new module - 404
« Reply #7 on: March 06, 2018, 10:05:01 AM »
Today I tested the example php code from another server and it worked.
The server I used for testing this time, is a simple LAMP server (no CWP)

So I think the problem is not the API from CWP but something in the webserver configuration.
Both servers I've tested yesterday run CWP.

I will let you know if I found the problem.


Offline
*
Re: WHMCS new module - 404
« Reply #8 on: March 07, 2018, 10:36:27 AM »
Found the problem!

The problem was in a firewall. The servers could not reach each other's API.

Thanks for the support!

Offline
*
Re: WHMCS new module - 404
« Reply #9 on: March 27, 2018, 08:24:39 AM »
So what did you do to the firewall

Offline
*
Re: WHMCS new module - 404
« Reply #10 on: March 27, 2018, 10:08:29 AM »
Nothing special. I had to open the ports on both sides.
Aswell on the requesting side as the server side. My requestging server wasn't allowed to use the API port for OUT traffic.

I thought it was port: 2304 (but it's good to check it, I'm not sure anymore)

Hope this will help you  :)

Offline
*
Re: WHMCS new module - 404
« Reply #11 on: January 23, 2019, 11:37:29 AM »
@lexz, When i do a curl of the https://myip:2304/v1/packages for instance i get:

<html><head><title>404 Page Not Found</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}s
trong{display:inline-block;width:65px;}</style></head><body><h1>404 Page Not Found</h1><p>The page you are looking for could not be found. Check the address bar to ensure your URL is spelled cor
rectly. If all else fails, you can visit our home page at the link below.</p><a href="/v1/">Visit the Home Page</a></body></html>You have new mail in /var/spool/mail/root

If i follow the link i get the same page.

Offline
*****
Re: WHMCS new module - 404
« Reply #12 on: May 08, 2019, 07:05:53 PM »
Please confirm that hostname has some valid ssl

Offline
*****
Re: WHMCS new module - 404
« Reply #13 on: May 25, 2019, 09:59:41 PM »
Hi

Can you show me what are you doing?

Offline
**
Re: WHMCS new module - 404
« Reply #14 on: June 09, 2019, 11:02:21 AM »
I was of the understanding that the port you set for cwp is what whmcs uses when provisioning.

So when configuring the cwp module and products in whmcs you assign domain.com:port and ipaddress:port

So whatever port your cwp uses is the same one you enter into whmcs.

(Perhaps i am confusing this with Virtualmin module) I will check mine tomorrow and post back if you haven't got a solution by then.
« Last Edit: June 09, 2019, 11:06:41 AM by adamjedgar »