2017-01-30 11 views
0

我試圖在局域網上設置一個PyCharm License Server如何在8080上通過局域網訪問網頁(由Ubuntu上的Pycharm許可證服務器提供服務)

我有一臺Ubuntu 16.04服務器,hightower設置要做到這一點。我已經安裝了許可證服務器,它似乎在8080成功運行:

[email protected]:/opt/jetbrains$ sudo bin/license-server.sh start 
Starting JetBrains License Service... 
* Logging initialized @269ms 
* jetty-9.3.z-SNAPSHOT 
INFO Config:92 - Reading classpath resource config/base.conf 
INFO Application:60 - Recources scan took 61 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.floating.LSApplication 
INFO Server:64 - Initializing from server-config.xml 
INFO Server:81 - server-config.xml is missing or corrupt. /root/.jb-license-server/server-config.xml (No such file or directory) 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.config.Config 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.floating.upstream.LogQueue 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.floating.reporting.ReportingQueue 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.floating.reporting.ResultStorage 
MaxData ok 
SimpleKey okCounterKeys ok 
UsersAndIps ok 
IntervalResults ok 
INFO Storage:41 - Results: 30/01/2017 12:45 - 30/01/2017 13:23. Last uploaded: null 
INFO ApplicationContext:31 - Executing startup sequence on class com.jetbrains.ls.floating.state.StallTicketRemover 
* Started [email protected]{/,file:///opt/jetbrains/web/,AVAILABLE,localhost} 
* Started [email protected]{/,null,AVAILABLE} 
* Started [email protected]{HTTP/1.1,[http/1.1]}{hightower:8080} 
* Started @1055ms 
* JetBrains License Service is listening on {hightower:8080} 
JetBrains License Service is running 

但我不能從另一臺計算機訪問webpage at 8080在局域網上,爲了繼續這一進程。

從工作站,01-e局域網與GUI/Ubuntu的16.04上,試圖訪問hightower:8080http://hightower:8080/register192.168.0.7:8080hightower.domain.local:80801或任何組合給了我:

的Firefox無法建立到連接服務器在hightower:8080。

我可以ping陶瑋:

...-01-e:~$ ping hightower 
PING hightower.domain.local (192.168.0.7) 56(84) bytes of data. 
64 bytes from hightower.domain.local (192.168.0.7): icmp_seq=1 ttl=64 time=0.170 ms 

防火牆不上,在黑暗中的服務器hightower

[email protected]:/opt/jetbrains$ sudo ufw status 
Status: inactive 

刺痛,看看是否實際上是被服務的頁面:

[email protected]:/opt/jetbrains$ wget hightower:8080 
--2017-01-30 13:47:38-- http://hightower:8080/ 
Resolving hightower (hightower)... 127.0.1.1 
Connecting to hightower (hightower)|127.0.1.1|:8080... connected. 
HTTP request sent, awaiting response... 302 Found 
Location: http://hightower:8080/register [following] 
--2017-01-30 13:47:38-- http://hightower:8080/register 
Reusing existing connection to hightower:8080. 
HTTP request sent, awaiting response... 200 OK 

所以如何使此頁面在我的局域網中可見?

編輯:額外的挖掘,它看起來8080只被提供給本地主機。我猜這是問題所在。

[email protected]:/opt/jetbrains$ netstat -nl 
Active Internet connections (only servers) 
Proto Recv-Q Send-Q Local Address   Foreign Address   State  
tcp  0  0 0.0.0.0:22    0.0.0.0:*    LISTEN  
tcp6  0  0 127.0.1.1:8080   :::*     LISTEN  
tcp6  0  0 :::22     :::*     LISTEN  
tcp6  0  0 127.0.0.1:33247   :::*     LISTEN 

編輯:

[email protected]:~$ cat /etc/hosts 
127.0.0.1 localhost 
127.0.1.1 hightower 

# The following lines are desirable for IPv6 capable hosts 
::1  localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 
+0

問題的原因可能是許可證服務器設置爲127.0.1.1而不是機器的IP。 您可以查看安裝許可證服務器的計算機上的hosts文件,您可能可以解決該問題。如果沒有,你可以發佈你的hosts文件的內容嗎?添加了 – Ernst

+0

。所以我只需要將hightower IP更改爲其LAN IP? – 43Tesseracts

回答

1

固定它。我只好跑:

<license_server_home>/bin/license-server.sh configure --port 8080 --listen 0.0.0.0 

,而不是建議:

<license_server_home>/bin/license-server.sh configure --port 8080 --listen license-server.mydomain.com 

我可能也改變了/ etc/hosts來閱讀:

[email protected]:~$ cat /etc/hosts 
127.0.0.1 localhost 
0.0.0.0  hightower 

但它推薦給我這是不好的做法,因爲我只想要一個端口可以訪問。

相關問題