搭建Jetbrains授權idea服務器
一、下載服務器搭建軟件
本軟件作者Lanyu,在此表示由衷感謝!
當前版本(v1.5)下載:點我 提取密碼: 7gje
官方各版本下載: http://blog.lanyus.com/archives/314.html
二、安裝
下載完成後進行解壓,裏面幾乎涵蓋了所有操作系統的版本,所以不管你是Win、Mac或是Linux都可以放心使用,這裏使用的是v1.5版本,其他類似。
1.windows版本安裝
選擇對應的32位/64位可直接運行
IntelliJIDEALicenseServer_windows_386.exe //32位
IntelliJIDEALicenseServer_windows_amd64.exe //64位
2.linux版本安裝
2.1 根據自己服務器的操作系統選擇對應的32位/64位拷貝到服務器上
IntelliJIDEALicenseServer_linux_386 //32位
IntelliJIDEALicenseServer_linux_amd64 //64位
2.2 進入到軟件存放的位置,運行以下命令,授予可執行權限
cd /root //進入文件所在目錄,這裏放的是root目錄
chmod a+x IntelliJIDEALicenseServer_linux_amd64 //這裏用的64位
2.3 啓動
/root/IntelliJIDEALicenseServer_linux_amd64 -p1029 -prolongationPeriod999999999999
2.4 通過supervisor實現進程守護
vi/etc/supervisord.conf
#添加以下內容
[program:idea-server]
command=/root/IdeaServer -p1029 -umoonce -prolongationPeriod999999999
autostart=true
autorestart=true
startsecs=3
2.5 配置nginx進行反向代理,實現域名遠程連接
server
{
listen 80;
server_name xxx.xxxxx.com;#自己準備好的域名
root /home/wwwroot/;
location / {
proxy_pass http://127.0.0.1:1029;#指定監聽的端口
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
access_log off; #access_log end
error_log /dev/null; #error_log end
}
3.mac版本安裝
3.1 根據自己服務器的操作系統選擇對應的32位/64位拷貝到服務器上
IntelliJIDEALicenseServer_darwin_386 //32位
IntelliJIDEALicenseServer_darwin_amd64 //64位
3.2 添加文件執行權限
chmod +x IntelliJIDEALicenseServer_darwin_amd64
3.3 用screen在後臺執行,避免關閉terminal激活失敗
screen -dmS IntelliJIDEALicenseServer_darwin_amd64 -d -m
3.4 啓動
sudo ./IntelliJIDEALicenseServer_darwin_amd64 -p1029 -umoonce -prolongationPeriod999999999
三、相關參數
-l #指定綁定監聽到哪個IP(私人用)
-u #用戶名參數,當未設置-u參數,且計算機用戶名爲^[a-zA-Z0-9]+$時,使用計算機用戶名作爲idea用戶名
-p #參數,用於指定監聽的端口
-prolongationPeriod #指定過期時間參數
四、使用
本地可直接用 172.0.0.1:端口號 使用。遠程服務器也可使用 ip:端口號 的形式,注意前面要加”http://”,我這裏用得域名重定向解析,重新指向帶端口號得ip,所以不用加端口號