Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

open port 9000 on Centos 5.9 Linux

Posted on 2014-01-27
17
Medium Priority
?
3,011 Views
Last Modified: 2014-01-27
Hi,

when I use this command:
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT -m comment --comment "Xdebug port"
iptables: Unknown error 4294967295
root@ip-184-168-116-73 [~]#

I researched and some said it could be related to the virtualization like OpenVZ. But I contacted Godaddy tech for the VPS and he couldn't tell me the virtulization. BTW, just my two cents the tech for Godaddy and in general I find it terrible. Don't use them. I've used other VPS providers and the other providers like Bluehost are much, much more helpful when things go wrong. But Godaddy's support is pretty poor and their general reply is find the solution yourself.

the tech said that a simple iptables INPUT will work. So what is a simpler version of this command to open up this port?

Thank you =)
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 23

Accepted Solution

by:
Patrick Bogers earned 2000 total points
ID: 39812992
Familiar command :)

Just a simpler command? Try


iptables -A INPUT -p tcp --dport 9000 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 9000 -j ACCEPT

D= destination so incoming
S= source so outgoing.
0
 

Author Comment

by:Victor Kimura
ID: 39813039
@Patricksr1972,

ok, that worked without errors.

1) What's wrong with the long version then?

2) How can I update an iptables entry? Just curious.

3) How do I make sure that port is opened for outbound and inbound?
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813048
Hi

The long one is brilliant and clear for future maintenance but if they dont support it iTS their bad.

What do you mean by update an entry?
0
The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

 

Author Comment

by:Victor Kimura
ID: 39813055
Oh, like update and add an comment to it so I know why I opened that port.

I tried to telnet from my Windows 7 machine:

telnet 184.168.116.73 9000 and it states that it can't connect. So does this mean that the VPS still cannot accept connections on port 9000?
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813062
Exactly. This is why i gave you the long version before, right?

Did you give both comments and the save statement?   Iptables save
0
 

Author Comment

by:Victor Kimura
ID: 39813083
Opps. forgot to save it.

service iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
root@ip-184-168-116-73 [/lib/modules]#


But when I telnet from my Windows 7 machine, my machine still states it cannot connect. Is there some other issue at hand?
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813089
Is there a service active on port 9000?
0
 

Author Comment

by:Victor Kimura
ID: 39813101
How do I find out? iptables are still new to me. :)
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813108
Nono iptables is for the firewall, is there a service active and running on the server listening for port 9000?
0
 

Author Comment

by:Victor Kimura
ID: 39813120
Oh, I see. How can I get the xdebug to be active?

I've been trying to set up my IDE (use PHPStorm from jetbrains) and it was failing. But is there a manual way to have the xdebug or some other service to test for the listening port?
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813128
Before we go there, it looks you need to restart iptables on centos before rules become active, did you run the restart command?
0
 

Author Comment

by:Victor Kimura
ID: 39813135
service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: mangle filter             [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]
0
 

Author Comment

by:Victor Kimura
ID: 39813140
I tested telnet from my windows and still failing. Do I need to start a service for listening on that port?
0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813189
From what i read you need Some work done in phpstorm.
If you are going to run and debug an application directly on a remote host, the only thing you need is register access to this host in PhpStorm to enable synchronization.

Please read about it Here
0
 

Author Comment

by:Victor Kimura
ID: 39813225
Ok, am reading it now. Thanks for that link. I just wanted to narrow down the problem to see if it was the port that wasn't open before. I don't think it was because I was receiving an error  in the PHPstorm IDE that it couldn't connect to port 9000 but I don't see that error now.

So I believe it's fixed. Just wanted to be sure. Thanks for that link. I didn't see that link for some reason. I read the text docs but I never saw the video that they have available. Will watch them and see how I can set up my remote debugger to work.

http://www.jetbrains.com/phpstorm/documentation/index.html

This has been a weekend project trying to get the port opened and the debugger to work.

thanks, Patrick.

BTW, the simpler iptables command works but this one doesn't:
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT -m comment --comment "XDebug port dport INPUT"

I get that same error. So I guess it's on their part then.

But I'm curious on how I would be able to ensure that those ports are opened on the server for output and input.

Tried this command:

netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
tcp        0      0 184.168.116.73:53           0.0.0.0:*                   LISTEN
tcp        0      0 173.201.47.54:53            0.0.0.0:*                   LISTEN
tcp        0      0 184.168.28.15:53            0.0.0.0:*                   LISTEN
tcp        0      0 173.201.24.210:53           0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:7869              0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2077                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2078                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:993                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2082                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2083                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2086                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2087                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:783               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2095                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:2096                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:465                 0.0.0.0:*                   LISTEN
tcp        0      0 184.168.116.73:22           96.49.234.192:22206         ESTABLISHED
tcp        0      0 173.201.47.54:443           217.96.60.4:61850           TIME_WAIT
tcp        0      0 173.201.47.54:443           217.96.60.4:61864           TIME_WAIT
tcp        0      0 173.201.47.54:22            96.49.234.192:22037         ESTABLISHED
tcp        0   2584 184.168.116.73:22           96.49.234.192:17991         ESTABLISHED
tcp        0      0 173.201.47.54:443           83.24.120.66:62408          TIME_WAIT
tcp        0      0 173.201.47.54:443           178.36.124.161:49365        ESTABLISHED
tcp        0      0 127.0.0.1:34975             127.0.0.1:953               TIME_WAIT
tcp        0      0 127.0.0.1:2086              127.0.0.1:60534             TIME_WAIT
tcp        0      0 :::21                       :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 :::25                       :::*                        LISTEN
tcp        0      0 :::443                      :::*                        LISTEN
tcp        0      0 ::1:7869                    :::*                        LISTEN
tcp        0      0 :::5001                     :::*                        LISTEN
tcp        0      0 :::8009                     :::*                        LISTEN
tcp        0      0 :::587                      :::*                        LISTEN
tcp        0      0 :::8080                     :::*                        LISTEN
tcp        0      0 :::80                       :::*                        LISTEN
tcp        0      0 :::465                      :::*                        LISTEN

Open in new window

0
 
LVL 23

Assisted Solution

by:Patrick Bogers
Patrick Bogers earned 2000 total points
ID: 39813239
Hi,

The only way to tell now is to cat iptables and look if your exceptions are there.
Reason netstat is not showing 9000 as listening is because you have not yet configured a service to listen to it.
Once configured phpstorm it Will show 9000 as listening.
0
 

Author Comment

by:Victor Kimura
ID: 39813411
Ok, will thanks. Will post here shortly once I get it configured. Thanks, Patrick!
0

Featured Post

Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question