sentora / sentora-core

Sentora is a web hosting control panel written in PHP for *NIX
GNU General Public License v3.0
648 stars 446 forks source link

Custom ports break api connection. #78

Closed TheNigelist closed 9 years ago

TheNigelist commented 9 years ago

If I decide to use a custom port for my Sentora installation then the api connection breaks.

Not sure how to work around this but just thought that I should report it to see if it can be fixed.

Caffe1neAdd1ct commented 9 years ago

Just to make sure i'm looking at this right, does the panel works on the custom port?

TheNigelist commented 9 years ago

Yes the panel works fine on whatever port you like.

When I try to connect to my billing (using the current XMWS) I get a wrong request error.

I have tried this on all of my panels.

5050 commented 9 years ago

The panel works, but changing the port from sentora needs a few trick I'm correcting :

5050 commented 9 years ago

clicked on wrong button

5050 commented 9 years ago

The Sentora Port change would be effective and correct now, but I have had a think: You wrote "the api connection breaks" - can you explain more ?

What i means : changing the sentora port change the whole sub-domain port. So the API port is also changed because the API are on the same domain. May be you would want that they remains on another port ?

TheNigelist commented 9 years ago

@5050 The url to my panel is "panel.domain.com:customport", using this combination breaks the connection with the API, so as discussed in the forums, changing the port is of course possible (and it still works), but in it's current form it will have to remain on the standard port. I reported this bug because users (like myself) might not want port 80 or port 443 as a default port and change it to something more acceptable. If I use "panel.domain.com:standardport" then the connection is fine and the API works as it should be. I was thinking that a "port" directive could be added to the api somehow to keep it on "panel.domain.com:standardport"

TGates71 commented 9 years ago

Interesting it breaks if you use a custom port. If it works changing from 80 => 443 then I would think that the api would also change to use that custom port (since 443 is 'custom' by the installer standards) In short, isn't there a sentora_port (formerly zpanel_port) configured in the API? Or is there another typo in there that uses apache_port instead?

TheNigelist commented 9 years ago

There is a sentora_port now. Technically you don't actually need to change port 80 to 443 because it's done automatically when you setup your port override. I've tried overriding the ports inside sentora_config and this didn't work either.

5050 commented 9 years ago

I never used the API and it is a bit difficult to "imagine" only what may happen. I'm already too much loaded with tests of lasts changes in installer to plunge in api docs ... is there somewhere a "demo" script that I can use to do some basic tests with API ?

TheNigelist commented 9 years ago

@5050 I will sort something in the next couple of days for you.

allebb commented 9 years ago

Right guys, I'm picking this up and will get this sorted... Will be going investigation first as like others have said in this thread, the port override should just make this work on the new port. I assume you're not getting confused with the XMWS API client does not support custom ports? - Anyway.... I'll pick this up and do some testing and see what happens and apply fixes where required!

Cheers, Bobby

allebb commented 9 years ago

Silly question maybe but I need to check... @PS2Guy you have updated the API URL on your site/product that is trying to connect to the API yeah? - eg. changning from http://panel.youromdina.com to http://panel.yourdomain.com:8080?

eg. (if you're using my XMWS client):

 $xmws->InitRequest('http://localhost/sentora/', 'domains', 'DeleteDomain', 'ee8795c8c53bfdb3b2cc595186b68912');

has been changed to say (notice the additon of the port number after the hostname):

$xmws->InitRequest('http://localhost:8080/sentora/', 'domains', 'DeleteDomain', 'ee8795c8c53bfdb3b2cc595186b68912');

??

TheNigelist commented 9 years ago

I always just set it in the config file of my application.

allebb commented 9 years ago

Ok, yeah that should be fine as obviously the config variables should then be utilised in all method calls of the XMWS API client.... Could you confirm that you haven't hard coded any though? - Is this a script that you've written or did you download a script that utilises my XMWS client? - I'm just trying to ascertain that this issue is DEFIANTLY related to Sentora as opposed to a client/module code issue.

TheNigelist commented 9 years ago

https://github.com/EliteEng/zpanelx-signup

This is the billing module that I support.

allebb commented 9 years ago

I can confirm that after testing this evening, I've set my development VM to use TCP port 81 for Sentora CP and then used one of the out-the-box products that utilises my XMWS library and all appears to work correctly (screenshots below):

working_over_81_2 ^ Sentora CP running on port 81

working_over_81 ^ The API Client config being configured to conenct to port 81 and reporting services are 'up' and running fine.

Closing this 'issue' as it appears to have been fixed (testing using Sentora 'master' branch)