Free radius Plugin for WHMCS

下载地址:

Installing

WHMCS
  • Create a folder called freeradius in WHMCSROOT/modules/servers/
  • Copy freeradius.php and clientarea.tpl into the newly created WHMCSROOT/modules/servers/freeradius folder
  • Copy freeradiusapi.php into the WHMCSROOT/include/api/ folder
FreeRADIUS servers
  • Create a folder anywhere with whatever name you like. For example, on Linux mkdir /opt/whmcs-freeradius
  • Copy cron.php and config.php.example into this folder
  • Rename config.php.example to config.php
  • Edit config.php as per your needs/requirements
  • Create a Cron task for the cron.php file. If your cron.php file is in /opt/whmcs-freeradius then your cron task shold look something like this, if you want it to run every 5 minutes:*/5 * * * * PATH_TO_PHP/php -q /opt/whmcs-freeradius/cron.php
  • On Linux, you can find the PATH_TO_PHP by running which php

安装方法:
1,复制freeradius.php和clientarea.tpl 到 (WHMCS目录)/modules/servers/freeradius/

注意:如果之前安装过别的版本的freeradius插件,你需要先删掉原来的插件,同时删掉有关产品(包括用户已经开通的产品,全部删掉,否则会出现缓存错误!

2,复制freeradiusapi.php 到 (WHMCS目录)/include/api/

3,把cron.php和修改后的config.php放到Freeradius服务器所在主机上的同一个目录下面。

处理config.php:

  • $general_timezone = ‘Asia/Shanghai’; //将时区设置为中国
  • $freeradius_db_username //radius填写数据库的用户名,注意安装radius时的那个mysql用户只有SELECT权限,这里需要新建一个对radius数据库有完全控制的用户。
  • $whmcs_api_url //填写你WHMCS的API的地址,例如:http://lalal.com/includes/api.php
  • $whmcs_api_username //是你的WHMCS后台用户名,权限越高越好,反正我填的是amdin
  • $whmcs_api_key //这个蛮重要的,需要和你的WHMCS的configuration.php对应。默认情况下WHMCS的configuration.php没有这个值,需要你手工添加一个,保证两个key的代码一致。

处理cron.php:

  • 把cron.php变成Linux调度任务,例如php -q /home/admin/freeradius/cron.php
  • 注意config.php必须和cron.php在同一个目录下面,例如/home/admin/freeradius/config.php
  • 完成后立即运行一次检查是否有错误,如果没有包mysql错误则说明radius服务器这边没问题。

4,配置WHMCS

Servers里面:

简单版本:假设Radius服务器和VPN服务器是同一台,新建一个服务器,IP Address填freeradius所在服务器的地址,本地就是127.0.0.1,Type选Freeradius,Username和Password是mysql用户名和密码,最后Access Hash填写数据库名,例如radius。

复杂版本:首先新建一个Radius服务器,IP Address填freeradius所在服务器的地址,本地就是127.0.0.1,Type选Freeradius,Username和Password是mysql用户名和密码,最后Access Hash填写数据库名,例如radius。再次新建VPN服务器,把IP挨个儿填上,Type为空。

Groups里面:

简单版本:新建一个组放刚才新建的服务器,命名例如:VPN_SERVER

复杂版本:新建一个Group专门存放所有VPN服务器,并把这些VPN服务器分配给新建的组。再次新建一个Group来保存Radius服务器,并把这些VPN服务器分配给新建的组。

Products/Services里面:新建产品

  • Details里面需要关掉强制域名选择,取消勾选Require Domain:  Tick to show domain registration options
  • Module Settings里面,Module Name选择Freeradius,Server Group选择VPN服务器组,例如VPN_SERVER,Radius Group填Radius服务器组,如果是简单版本,填写VPN_SERVER即可。如果是复杂版本,各填各的。
  • Usage Limit是字节,需要转换,例如1G是1073741824,Session Limit最大同时连接数。参考:http://www.whatsabyte.com/P1/byteconverter.htm
  • Rate Limit还没测试,看起来是限速的。
  • 其他按需设置即可。

最后:

各种信息都会显示在这里。想汉化去freeradius.php

用户名不再是域名,而是你的账户名

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据