Hi, I am running a dedicated Linux server and I need to open a port so I can connect a script to a port, the only ports I have open is my cpanel and some others which all require authentication and are private. I have looked everywhere for a tutorial but i cannot find one. I dont know if it is a simple task or a complex one but i just wonder if there is anyone out there who knows how to open a port, it probably will need to be TCP or UDP. Any help wouldn't go amiss Thanks,
This might help then ... http://www.google.co.uk/search?hl=en&q=IPTables+Open+Port&btnG=Google+Search&meta=
If your running linux it should be iptables. To open a port is very simple, logged in as root do this. iptables -A INPUT -p udp -m udp --dport PORT -m state --state NEW -j ACCEPT Where i have written PORT this is the port number you want opened This example is when opening a sensite port such as ssh, for security you can have only your IP address access it. iptables -A INPUT -s YOURIPHERE -p tcp -m tcp --dport PORT -m state --state NEW -j ACCEPT YOURIPHERE = your ip address PORT = port you want opened
When ever I enter the above commands into SSH when i've logged in, and i've edited the port it says command not found.
Sorry about been a pain, The commands do work but when i go to http://www.myurl.com:Theport it says it cannot be connected. After i run the commands to open the port i use the command service iptables save to save the new configurations, Any help where im going wrong guys?
Try to telnet locally to see if the application is actually working. For example: telnet localhost THEPORT just replace THEPORT with the port Jay
The next step would be to determine if something is listening on that port. Log in to the box and type this: netstat -a | grep LISTEN Code (markup): What you will see is a lot of output that should include IP addresses and ports. The ports may be translated into the services that usually run on that port so "80" becomes "http". Your port should be listed there. If it is not listed, this means that your script is not listening on the port you have opened and you won't be able to communicate with it.