ToughRADIUS在windows下的安裝配置

ToughRADIUS在windows下的安裝配置

ToughRADIUS爲windows提供了一個快速部署的模式,幫助使用者快速部署ToughRADIUS服務。mysql

最新版本下載

從如下連接能夠下載最新的ToughRADIUS版本:git

github.com mirror https://github.com/talkincode/ToughRADIUS/archive/master.zipgithub

coding.net mirror https://coding.net/u/jamiesun/p/ToughRADIUS/git/archive/masterweb

oschina.net mirror https://git.oschina.net/jamiesun/ToughRADIUS/repository/archive?ref=mastersql

數據庫安裝配置

ToughRADIUS主要採用MySQL(5.0以上版本)存儲數據,在部署ToughRADIUS以前請自行安裝MySQL(安裝步驟請參考MySQL相關文檔),安裝MySQL後確保MySQL爲運行狀態。數據庫

  • 修改配置文件 config.json,請修改數據庫地址用戶名密碼等選項與實際相符。json

    { "mysql": { "maxusage": 10, "passwd": "root", "charset": "utf8", "db": "toughradius", "host": "127.0.0.1", "user": "root" } }windows

  • 運行createdb.bat建立數據庫表,ToughRADIUS採用腳本工具自動建立數據庫,無需SQL腳本。瀏覽器

在windows環境下,雙擊createdb.bat便可進行數據庫建立過程。工具

createdb.bat

#按提示進行操做

Z:\github\ToughRADIUS>toughrad.exe createdb.py    || pause

starting create and init database...

drop and create database ?[n]y

init database ?[n]y

init testdata ?[n]n

注意

運行腳本會嘗試刪除原有數據庫並重建,若是非首次安裝,建議備份數據,init testdata是建立測試數據選項,通常不須要。

運行radiusd服務

radiusd提供提供了RADIUS核心認證計費受權服務,在windows環境下,雙擊radiusd.bat腳本便可運行。

radiusd.bat內容

toughrad.exe radiusd/server.py -c config.json  -dict radiusd/dict/dictionary || pause

你能夠新建一個debug的腳本,加上 -d 或者 --debug 參數便可。

toughrad.exe radiusd/server.py -c config.json  -dict radiusd/dict/dictionary -d || pause

你能夠經過參數指定端口

toughrad.exe radiusd/server.py -auth 1812 -acct 1813 -admin 1815 -c config.json  -dict radiusd/dict/dictionary -d || pause

示例:

radiusd.bat

Z:\github\ToughRADIUS>toughrad.exe radiusd/server.py -c config.json  -dict radiu
sd/dict/dictionary    || pause

['radiusd/server.py', '-c', 'config.json', '-dict', 'radiusd/dict/dictionary']

logging to file logs/radiusd.log

默認狀況下,日誌會打印到logs/radiusd.log文件裏,在debug模式下將會打印系統更詳細的日誌,並會在控制檯實時輸出。

運行console服務

console是Web管理控制檯系統,在windows環境下,雙擊console.bat腳本便可運行。

console.bat腳本內容

cd console && ..\toughrad.exe admin.py -c ../config.json || pause

你能夠新建一個debug的腳本,加上 -d 或者 --debug 參數便可。也能夠指定端口運行(默認的http端口是1816)。

cd console && ..\toughrad.exe admin.py -http 8080 -admin 1815 -c ../config.json || pause

示例:

console.bat

Z:\github\ToughRADIUS>cd console   && ..\toughrad.exe admin.py -c ../config.json || pause
Z:\github\ToughRADIUS\console
Z:\github\ToughRADIUS\console
ToughRADIUS Console Server Starting up...
Listening on http://0.0.0.0:1816/
Hit Ctrl-C to quit.

當啓動web控制檯服務後,就能夠經過瀏覽器訪問管理界面了,在瀏覽器地址欄輸入:http://127.0.0.1:1816

注意

admin端口是radiusd的管理監聽端口,在console中會經過該端口調用一些管理服務,好比實時查詢跟蹤用戶消息等。
相關文章
相關標籤/搜索