2014-03-05 74 views
0

在我的Ubuntu 12.04 VM上,本地使用時,應用程序(Tryton)在端口8000上正常運行。但是,從外部,我無法通過Internet連接到端口8000。 (在此之前,我使用的Windows Azure具有用戶友好的端點配置。)如何在Ubuntu 12.04上打開端口8000?

的Netstat,在本地運行,報告端口作爲偵聽: (我叫這個VM「NoConnection」,從下面來區分)

[email protected]:~# netstat -tupan | grep 8000 
tcp  0  0 127.0.0.1:8000   0.0.0.0:*    LISTEN 
10051/python 
tcp  0  0 127.0.0.1:8000   127.0.0.1:58160   ESTABLISHED 
10051/python 
tcp  0  0 127.0.0.1:58160   127.0.0.1:8000   ESTABLISHED 
10860/python 

使用nmap本地檢查似乎確定,以及:

[email protected]:~# nmap -v -A -PN localhost 

Starting Nmap 5.21 (http://nmap.org) at 2014-03-05 09:55 EST 
NSE: Loaded 36 scripts for scanning. 
Initiating SYN Stealth Scan at 09:55 
Scanning localhost (127.0.0.1) [1000 ports] 
Discovered open port 22/tcp on 127.0.0.1 
Discovered open port 3389/tcp on 127.0.0.1 
Discovered open port 8000/tcp on 127.0.0.1 
Discovered open port 631/tcp on 127.0.0.1 
Discovered open port 5432/tcp on 127.0.0.1 
Discovered open port 5910/tcp on 127.0.0.1 
Completed SYN Stealth Scan at 09:55, 0.03s elapsed (1000 total ports) 


PORT  STATE SERVICE  VERSION 
22/tcp open ssh   OpenSSH 5.9p1 Debian 5ubuntu1.1 (protocol 2.0) 
631/tcp open ipp   CUPS 1.5 
3389/tcp open microsoft-rdp xrdp 
5432/tcp open postgresql PostgreSQL DB 
5910/tcp open vnc   VNC (protocol 3.8) 
8000/tcp open http-alt? 

端口8000是Tryton ERP的方式,但NMAP不知道。

然而,從不同計算機上的nmap的掃描 * *找到開放的端口:

[email protected]:~# nmap -v -A -PN IP_of_NoConnect_VM 

Starting Nmap 5.21 (http://nmap.org) at 2014-03-05 15:00 UTC 
NSE: Loaded 36 scripts for scanning. 
Initiating Parallel DNS resolution of 1 host. at 15:00 
Completed Parallel DNS resolution of 1 host. at 15:00, 0.08s elapsed 
Initiating SYN Stealth Scan at 15:00 
Scanning IP_of_NoConnect_VM [1000 ports] 
Discovered open port 22/tcp on IP_of_NoConnect_VM 
Discovered open port 3389/tcp on IP_of_NoConnect_VM 
Discovered open port 5910/tcp on IP_of_NoConnect_VM 
Completed SYN Stealth Scan at 15:00, 0.13s elapsed (1000 total ports) 

我想這是一件不特定的Tryton應用程序,但對方式Linux VM使用其端口進行設置。

作爲參考,在工作,不同的VM(在Windows Azure上),其中Tryton經由端口8000正確地和可訪問的配置,對於端口8000使用netstat輸出讀取:

[email protected]:~# netstat -tupan | grep 8000 
tcp6  0  0 :::8000     :::*     LISTEN 
1310/python 
tcp6  0  0 127.0.0.1:8000   127.0.0.1:36818   TIME_WAIT 
- 
tcp6  0  0 127.0.0.1:8000   127.0.0.1:36820   TIME_WAIT 
- 
tcp6  0  0 127.0.0.1:8000   127.0.0.1:36814   TIME_WAIT 
- 
tcp6  0  0 127.0.0.1:8000   127.0.0.1:36813   TIME_WAIT 
- 

而關於未連接VM它表明:

[email protected]:~# netstat -tupan | grep 8000 
tcp  0  0 127.0.0.1:8000   0.0.0.0:*    LISTEN 
10051/python 
tcp  0  0 127.0.0.1:8000   127.0.0.1:58160   ESTABLISHED 
10051/python 
tcp  0  0 127.0.0.1:58160   127.0.0.1:8000   ESTABLISHED 
10860/python 

當然是的,我已經檢查,兩臺機器的端口的應用程序特定的trytond.conf文件打開:

#This file is part of Tryton. The COPYRIGHT file at the top level of 
#this repository contains the full copyright notices and license terms. 
[options] 

# Activate the json-rpc protocol 
jsonrpc = *:8000 
+0

好像它只是在你的本地IP(127.0.0.1)的8000端口監聽,而不是在你的外部IP公司從 – RemcoGerlich

+0

支持回答的8000端口: #NMAP -PN -p 8000 188.226.146.149 端口狀態服務 8000/tcp關閉http-alt 當在nmap掃描中看到「關閉」時,這意味着該端口已打開,但應用程序未在該端口和/或公共接口上偵聽。 請確保您的Web服務正在偵聽公共接口,如果您已將其配置爲在端口8000上偵聽 --- – Wolfgang

+0

但是,afaik正在運行,並且就通常的檢查(netstat)報告,它正在傾聽。 – Wolfgang

回答