WHMCS - Solved

10 posts / 0 new
Last post
#1 Sun, 07/05/2009 - 18:50
kenlyle

WHMCS - Solved

My original post: So far I am pretty underwhelmed with WHMCS viz. Virtualmin...

Update, a few days later: There is almost no documentation, true, but the operation mostly "just works", once you discover a couple of the details, two of which are posted just below. Overall, I like WHMCS, and am glad to have an option of such overall high quality. The issues seem kind of typical of version 1.0 modules and new business relationships...

I noticed today that WHMCS.com doesn't even list Virtualmin on the front page. In fact, there are few pages on the site which mention Virtualmin.

The sum total of documentation, when I search for Virtualmin on their site after clicking Documentation under "Help" is "Virtualmin Pro - The server module for Virtualmin Pro allows you to create, suspend, unsuspend and terminate accounts on a VirtualMin server. It also provides an automatic login link in the WHMCS client area for customers to use. "

Oh, and when I tried to post some reasonable questions to that Wiki page, they were scrubbed off.

Oops, it looks like accepting the Order, even with the "module create" checked on the Accept screen isn't automatically enough, unless you have checked the box to do the Module Create upon accepting a Pending Order elsewhere in the configuration of that Product/Service. That just seems like a quirky 1.0 kind of thing, not that bad, really.

OK, experimenting more...the Login to Control Panel button doesn't work, so I figure that the field labelled IP Address should really be the IP Address AND the port number.

I am still getting 500 errors, and the Apache log shows: Premature end of script headers: orders.php, referer: http://nextwavetech.us/whmcs/admin/orders.php?action=view&id=1&backpendi... [Mon Jul 06 00:19:00 2009] [emerg] mod_fcgid: server is restarted, 28456 must exit

I don't know how to interpret these, but at least my new virtual server got created, and I can Preview the website. I think that I need to not use FCGI in my Template - But am open to more intelligent and experienced input.

This

Thanks, Ken

Sun, 07/05/2009 - 21:08
andreychek

I'm not sure about the errors you're getting any why you're getting them. It sounds like mod_fcgid is erroring, but I don't know why.

You could always try going into Server Configuration -> Website Options, and switching from FCGID to straight CGI to see if that makes a difference.

-Eric

Sun, 07/05/2009 - 22:07
kenlyle

Thanks, Eric.

I think it's the weird thing where if you have your WHMCS machine on the same VPS, and it's waiting for a success message from Virtualmin, but Virtualmin reboots the VPS or restarts PHP or something...then it all goes bad.

There is some discussion of this at https://www.virtualmin.com/node/9027#comment-38118

I have re-set my WHMCS domain from fcgid to CGI, but that was in the middle of the WHMCS session, so when it gave me a blank page on trying to accept the order, I was not surprised.

Even now, starting a new session, I am getting blank pages with the URLs like cgi-bin/php5.cgi when trying to place an order.

There seem to be alot of variables...Joe mentioned possibly writing a tutorial on how to run one domain on a separate instance of Apache- maybe that's part of the answer, I don't know.

Actually, just now, I set the domain back to FCGI and created an order, and Accepted it, and the domain was created, but WHMCS threw a 500 error on orders.php?action=view&id=3&activate=true - but I don't mind as much, because the domain got created...

Still looking for good advice...

Thanks, Ken

Sun, 07/05/2009 - 22:36 (Reply to #3)
andreychek

Well, I've never setup WHMCS before, so I'm not really familiar with all the moving parts here.

That said -- getting blank screens whenever you load pages just doesn't sound right :-)

Are you seeing any error messages in the Apache logs at that point?

-Eric

Mon, 07/06/2009 - 08:04 (Reply to #4)
kenlyle

Yep, like this:

[Mon Jul 06 12:58:27 2009] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error. [Mon Jul 06 12:58:27 2009] [error] [client 24.125.118.169] Premature end of script headers: orders.php, referer: http://mydomain.com/whmcs/admin/orders.php?action=view&id=5 [Mon Jul 06 12:58:27 2009] [emerg] mod_fcgid: server is restarted, 12231 must exit

I suspect that the key is [emerg], which sounds like "Emergency!" (reminds me of 'kernel panic'), where something is pulling the rug out from under my app and/or my domain.

Thanks! K

Mon, 07/06/2009 - 08:13 (Reply to #5)
andreychek

Hmm, I'd only expect to see that error if FCGID were still processing the requests there.

It sounds like it may not be out of the picture yet -- perhaps you need to restart Apache after switching from FCGID to CGI to get rid of any lingering processes?

-Eric

Mon, 07/06/2009 - 10:19
ronald
ronald's picture

You definately need to run the domain with whmcs in CGI mode. Not fcgid. That is because you run the whmcs on the same server and virtualmin restarts the server during creation of a new domain. Thats what's causing the errors. WHMCS gets interrupted during the graceful restart of Apache.

Did you update whmcs to version 4? Cause that version has also the updated module for virtualmin.

The WIKI pages are not for asking questions though, thats why they have a forum and a support section under help in whmcs admin panel.

Once WHMCS is correctly installed and configured, there should be no errors. I'm running it too and until now I'm very happy with how things work (except the creation of the username).

When customers pay with paypal, eveything goes automated the way I want it to (again except the username). I have virtualmin create the username as the domainname. WHMCS takes the first 8 characters. There is not a solution yet.

It took some time to configure WHMCS to work the way I want it to work, I suspect you need to do the same. Creation of a domain, suspend, unsuspend and terminate will work perfectly as that is in the calling of the virtualmin API

Tue, 07/07/2009 - 23:22
kenlyle

Thanks, Ronald. I just switched my WHMCS domain to CGI in Server Configuration - Website Options.

After that, when I try to place an order, I get these errors:

Security Alert! The PHP CGI cannot be accessed directly., referer: http://mydomain.com/whmcs/admin/ordersadd.php , referer: http://mydomain.com/whmcs/admin/ordersadd.php

This PHP CGI binary was compiled with force-cgi-redirect enabled. This, referer: http://mydomain.com/whmcs/admin/ordersadd.php means that a page will only be served up if the REDIRECT_STATUS CGI variable is, referer: http://mydomain.com/whmcs/admin/ordersadd.php set, e.g. via an Apache Action directive.

, referer: http://mydomain.com/whmcs/admin/ordersadd.php

For more information as to why this behaviour exists, see the manual page for CGI security.

, referer: http://mydomain.com/whmcs/admin/ordersadd.php

For more information about changing this behaviour or re-enabling this webserver,, referer: http://mydomain.com/whmcs/admin/ordersadd.php consult the installation file that came with this distribution, or visit , referer: http://mydomain.com/whmcs/admin/ordersadd.php the manual page.

, referer: http://mydomain.com/whmcs/admin/ordersadd.php Premature end of script headers: php5.cgi, referer:

Same result, whether Firefox or IEtab, a blank page.

Even after Stopping and restarting Apache on the domain, and trying again in IE...maybe better...actual 500 errors now instead of blank pages, but still the same error messages as above in the log.

This is WHMCS 4.02, if that helps.

There seem to be a lot of "moving parts" here- I have to agree with Eric- and it would be great to have some actual, tested, written instructions.

Thanks, Ken

Wed, 07/08/2009 - 10:43
ronald
ronald's picture

this thread is marked as solved but Ill assume it is not

So this is what I have in the apache < virtualhost > for the domain running cgi

the forum messes up this code and adds html so you have to read through it. Is this what you have in your directives?

SuexecUserGroup "#502" "#503"
ServerName domain.com
ServerAlias www.domain.com
ServerAlias domain.nl
ServerAlias www.domain.nl
DocumentRoot /home/domain.com/public_html
ErrorLog /home/domain.com/logs/error_log
CustomLog /home/domain.com/logs/access_log combined
ScriptAlias /cgi-bin/ /home/domain.com/cgi-bin/
ScriptAlias /awstats /home/domain.com/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain.com/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
</Directory>
<Directory /home/domain.com/cgi-bin>
allow from all
</Directory>
RemoveHandler .php
RemoveHandler .php5
<Files awstats.pl>
AuthName "domain.com statistics"
AuthType Basic
AuthUserFile /home/domain.com/.awstats-htpasswd
require valid-user
</Files>

This is a .htaccess file in the root of the domain

RewriteEngine On



# Announcements

RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC]

RewriteRule ^announcements$ ./announcements.php [L,NC]



# Downloads

RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC]

RewriteRule ^downloads$ ./downloads.php [L,NC]



# Knowledgebase

RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC]

RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC]

RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC]

<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
Wed, 09/22/2010 - 04:01
kthxbai2u

"OK, experimenting more...the Login to Control Panel button doesn't work, so I figure that the field labelled IP Address should really be the IP Address AND the port number."

Is the above correct? Do we have to put the ip in IP:PORT format? Should my IP be xxx.xxx.xxx.xxx:10000 ?

Also, what about the hostname? Does it need a port there or no? I just put the URL that points to my virtualmin control panel (without the port)... I also tried it with the port but the login to control panel button doesn't work still...

Neither Virtualmin or WHMCS tell you what to do clearly... Although I know its WHMCS's responsibility to document that, shouldn't Virtualmin document that because WHMCS didn't?

Virtualmin is the best, thanks to everyone who helped code it!

Topic locked