環(huán)境說明
- xubuntu-16.04.2
- Python 2.7.12
- tornado 4.5.1
Python和tornado的版本
python -V
python -c "import tornado; print(tornado.version)"
python_tornado
安裝
下載GateOne源碼:
git clone https://github.com/liftoff/GateOne.git
從源碼安裝GateOne 1.2摆霉,參考源碼中的INSTALL:
cd GateOne
python setup.py install
查看GateOne安裝到哪去了:
whereis gateone
/etc/gateone/conf.d
下是配置文件妙痹。
GateOne默認(rèn)是開啟https的变泄,此處是內(nèi)網(wǎng)環(huán)境食拜,關(guān)閉https共屈,修改端口號眯杏,配置origins允許其他應(yīng)用訪問GateOne(可以將GateOne嵌入到其他應(yīng)用中匾乓,下篇單獨(dú)介紹)录煤,修改配置文件10server.conf:
// 默認(rèn)false, 修改為true, 關(guān)閉https
"disable_ssl": true,
// 加入localhost:8080 允許localhost:8080訪問GateOne
"origins": ["localhost:8080", "localhost", "127.0.0.1", "ubuntu", "127.0.1.1"],
// 端口號默認(rèn)是443鳄厌,修改為80
"port": 80,
啟動(dòng)GateOne
sudo gateone
# or
sudo service gateone start # stop/start/restart
啟動(dòng)成功,訪問http://localhost
訪問驗(yàn)證
如果需要控制GateOne的訪問妈踊,也就是說只有通過某些驗(yàn)證才能進(jìn)入GateOne的界面了嚎,可以設(shè)置驗(yàn)證方式,修改配置文件20authentication.conf中的auth
:
# 默認(rèn)是none廊营,不需要驗(yàn)證歪泳,可以使用pam/api/Google
"auth": "api",
各種驗(yàn)證方式的參考資料:
API方式驗(yàn)證
PAM/Google方式
如果你需要在應(yīng)用中集成GateOne,可以參考應(yīng)用嵌入GateOne以及SSH自動(dòng)登陸露筒,會(huì)介紹如何嵌入以及如何自動(dòng)SSH到其他機(jī)器上呐伞。