cURL problem with Modernbill

webone

Verified User
Joined
Jan 17, 2004
Messages
61
I honestly wish I'd never started this!

I'm trying to use modernbill with Directadmin and having problems with cURL. Modernbill uses cURL when communicating between servers to set up user accounts on my DA box.

It basically sends the following string in order set up an account:

https://mywebhost.net:2222/CMD_API_...2=blah&domain=blahblah.com&package=fdspec&ip=[the ip address]

Now, in order for the script to user cURL I have to set the path in the config file. Typing whereis cURL at the command line gives me 2 versions one in /usr/local/bin/curl and another in /usr/bin/curl/ The script can also use PHP compiled cURL which I've tried too.

I asked modernbill to look at why it wasn't working and this is what they said:

Hi Gavin,

What I found:

PHP compiled curl is failing to connect with this error returned from curl.
"Connect failed; Operation now in progress"

I can't find any documentation on what that error would be.

From code, I found your path to curl to be:
/usr/bin/curl and it's a strange version that I've never seen: "Features: IPv6 SSL libz NTLM"

I removed the base_64 encryption on the username/password for the CLI curl call and this is the URL it is using now:
https://user:[email protected]:...2=blah&domain=blahblah.com&package=fdspec&ip=[the ip address]

When I paste that into a browser it just hangs. The only way it works is by removing the user/pass and loging in first.

The curl connections using PHP compiled and command line are both failing. The calls/data seem to be correct.

Can *I* do anything to help solve this? Why do I have 2 versions of cURL? I haven't touched the box since DA installed everything. Could 2 versions be conflicting? Any pointers would be much appreciated. Is the cURL version truly strange and abnormal?

Thanks

:D
 
Last edited:
Hey,

We've got MB working with DA...

In our config we use "PHP" as the path for cURL.

I noticed a lot of the times MB support (forums) seem to tell people to try that...

Could possibly be some other config issue...

What version of mod_diradmin are you using?

David
 
Make sure you are using mod_diradmin 1.0.7 or higher.
All previous versions did not work correctly with DA unless you were lucky

run
curl -V
the output should look similar to this:
curl 7.11.0 (i686-pc-linux-gnu) libcurl/7.11.0 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: IPv6 SSL libz NTLM

If you do not see libcurl and a version, run these commands.

cd /usr/local/directadmin/customapache/curl-7.11.0
CPPFLAGS="-I/usr/kerberos/include" LDFLAGS="-L/usr/kerberos/lib" ./configure --with-ssl
make
make install
/usr/local/etc/rc.d httpd restart

curl -V
curl 7.11.0 (i686-pc-linux-gnu) libcurl/7.11.0 OpenSSL/0.9.7a ipv6 zlib/1.1.4
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: IPv6 SSL libz NTLM


Hope that fixes it :)
 
Thanks for the support guys, but I'm still having problems. Modernbill have turned round and said its all my fault. I've not got cURL installed properly so I have to figure it out. Here's what their response to "what should I do?" was:

This version is how you login to a site by passing the username/pass in the url:

https://user:[email protected]

If you are already loged into DA, you don't have to add that. The without version isn't an option for our curl calls.

I can only recommend installing a different version of curl (CLI and/or PHP compiled).

Your curl calls might work for the remote connections, but the local connections aren’t working. I don’t know enough about it to be able to guess why. I don’t get a useful error from curl. It almost seems to time out. The call takes a very very long time to finish.

At the command line the following are produced:

which curl:
/usr/local/bin/curl

curl -V
curl 7.11.2 (i686-pc-linux-gnu) libcurl/7.11.2 OpenSSL/0.9.7a zlib/1.2.1
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: SSL libz NTLM Largefile

whereis curl
curl: /usr/bin/curl /usr/local/bin/curl /usr/include/curl /usr/share/man/man1/curl.1.gz

On the features notice that IPv6 is missing - does that make a difference? Also Modernbill (from my first post in this thread) said that the pat to curl was /usr/bin/curl NOT /usr/local/bin/curl - and he DOES list IPv6 in curl's list of features? I'm so confused!!

I'm using the latest version of cURL - it's compiled into my PHP, their enom module which also uses cURL to communicate with my server works perfectly.

I'm also using the latest mod_diradmin module. I've tried the PHP method and that doesn't work either.

Anyone got any ideas? Thanks for the help so far!
 
This is from the error logs from the server trying to connect to my DA box and set up an account:

* About to connect() to myserver.net port 2222
* Connect failed; Operation now in progress
* Closing connection #0
password:
curl: (7) socket error: 110
password:
curl: (7) socket error: 110
sh: line 1: php: command not found
sh: line 1: php: command not found
sh: line 1: php: command not found
* About to connect() to myserver.net port 2222
* Connect failed; Operation now in progress
* Closing connection #0
* About to connect() to myserver.net port 2222
* Connect failed; Operation now in progress
* Closing connection #0
password:
curl: (7) socket error: 110

Any ideas at all??

Thanks!
 
If you want to setup a temp account and PM me the login, I'll be happy to take a look.
 
That's a very kind offer, but I think i might be closing in on the issue see what you think . . .

I disabled (temporarily) both firewalls on both the server where modernbill is installed and on the server where modernbill was connecting to to create the account.

This time it worked! Previously i'd only disabled the firewall on one server at a time.

Do you know anything about KISS? How do I enable kiss to allow a connection from an IP address - I've tried googling but nothing so far apart from how to install it.

Thanks for any help!
 
I've never worked with Kiss myself, I prefer full control using iptables directly. Chances are Kiss has a config file, which has a bunch of lines saying what to allow and deny by default. Look for lines that look similar to:

$IPTABLES -A INPUT -i eth0 -p udp --sport 53 --dport 53 -m state --state NEW -j ACCEPT

and add a line right above or below it similar to this:

$IPTABLES -A INPUT -i eth0 -s modernbill_server_ip_address -p tcp -dport 2222 -j ACCEPT

chances are no changes are required to the iptables setup on the modernbill server
 
Last edited:
KISS doesn't have a separate config file because it's just a script that controls iptables.

Sure you can write one yourself (I presume that's what you've done; I doubt you go in and do it manually each time you reboot your system), but KISS works very well for most of us.

When I installed KISS for webone it was before ModernBill was installed; it's hard to be prescient and figure out in advance just what to block and unblock.

I'll be happy to make the changes that webone needs.

Jeff
 
Last edited:
Back
Top