私の Ubuntu 12.04 VM では、ローカルで使用すると、アプリ (Tryton) がポート 8000 で正しく実行されます。しかし、外部からはインターネット経由でポート 8000 に接続できません。(以前は、ユーザー フレンドリーなエンドポイント構成を持つ Windows Azure を使用していました。)
ローカルで実行される Netstat は、ポートがリッスンしていると報告します (以下と区別するために、この VM を「NoConnection」と呼びます)。
root@NoConnection:~# 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 を使用してローカルで確認しても問題ないようです。
root@NoConnection:~# 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 スキャンでは*開いているポートが見つかりません:
root@WorksRight:~# 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 がそのポートでセットアップされる方法にあると思います。
参考までに、Tryton が正しく構成され、ポート 8000 経由でアクセスできる、動作中の別の VM (Windows Azure 上) では、ポート 8000 の netstat 出力は次のようになります。
root@WorksRight:~# 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 では、次のように表示されます。
root@NoConnection:~# 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