LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2012, 11:08 PM   #1
Lumify
Member
 
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52

Rep: Reputation: Disabled
Help me open a port for my Minecraft server


Hai guise, I'm a noob, and I'm trying to set up a Minecraft server using Bukkit on my Debian computer. The port is 25565.

I used sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT to open it. iptables -L gives
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
It seems like everything should work fine, but the server spits this out at me:
Code:
$ java -jar craftbukkit.jar 
174 recipes
27 achievements
23:01:44 [INFO] Starting minecraft server version 1.1
23:01:44 [INFO] Loading properties
23:01:44 [INFO] Starting Minecraft server on *:25565
23:01:50 [WARNING] **** FAILED TO BIND TO PORT!
23:01:50 [WARNING] The exception was: java.lang.NoSuchMethodError: method java.net.ServerSocket.setPerformancePreferences with signature (III)V was not found.
23:01:50 [WARNING] Perhaps a server is already running on that port?
I found this website http://minecraft.codeemo.com/access.php that checks if the port is working, and it says:
Code:
Port 22 appears to be open.
Port 80 seems to be closed.
Port 8080 seems to be closed.
Port 25565 seems to be closed.
What gives?
 
Old 02-16-2012, 12:54 AM   #2
hallucinative
LQ Newbie
 
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18

Rep: Reputation: 5
Quote:
Originally Posted by Lumify View Post
Hai guise, I'm a noob, and I'm trying to set up a Minecraft server using Bukkit on my Debian computer. The port is 25565.

I used sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT to open it. iptables -L gives
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
It seems like everything should work fine, but the server spits this out at me:
Code:
$ java -jar craftbukkit.jar 
174 recipes
27 achievements
23:01:44 [INFO] Starting minecraft server version 1.1
23:01:44 [INFO] Loading properties
23:01:44 [INFO] Starting Minecraft server on *:25565
23:01:50 [WARNING] **** FAILED TO BIND TO PORT!
23:01:50 [WARNING] The exception was: java.lang.NoSuchMethodError: method java.net.ServerSocket.setPerformancePreferences with signature (III)V was not found.
23:01:50 [WARNING] Perhaps a server is already running on that port?
I found this website http://minecraft.codeemo.com/access.php that checks if the port is working, and it says:
Code:
Port 22 appears to be open.
Port 80 seems to be closed.
Port 8080 seems to be closed.
Port 25565 seems to be closed.
What gives?
I run a minecraft server myself on a ubuntu server (Based on debian) The error your getting "Failed to bind port" means that that port is in use for another application, if its a shared server edit your "server.properties" file with a different port...Otherwise you might have a zombie process roaming around keeping that port locked... restart the server and try again? XD


There are commands to find the program keeping that port open but off the top of my head i can't remember... and some one will post it below? \/

Last edited by hallucinative; 02-16-2012 at 12:56 AM.
 
Old 02-16-2012, 12:58 AM   #3
hallucinative
LQ Newbie
 
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18

Rep: Reputation: 5
Here it is...


sudo netstat -anltp|grep :25565

Looks like this on my server.. When actually working mind you.. Notice that its running Java..
Code:
user@LoM:~$ sudo netstat -anltp|grep :25565
][sudo] 
[sudo] password for user:
tcp6       0      0 :::25565                :::*                    LISTEN      1962/java
tcp6       0    339 10.0.0.2:25565          174.51.241.93:50119     ESTABLISHED 1962/java
tcp6       0   4569 10.0.0.2:25565          110.32.151.228:18494    ESTABLISHED 1962/java
tcp6       0    385 10.0.0.2:25565          75.82.165.81:55030      ESTABLISHED 1962/java
tcp6       0      0 10.0.0.2:25565          58.166.84.42:63534      TIME_WAIT   -
tcp6       0   2817 10.0.0.2:25565          115.64.230.74:49934     ESTABLISHED 1962/java
tcp6       0    343 10.0.0.2:25565          121.217.45.155:1080     ESTABLISHED 1962/java
From:
http://ubuntuforums.org/showpost.php...09&postcount=2

Last edited by hallucinative; 02-16-2012 at 01:00 AM.
 
Old 02-16-2012, 04:21 AM   #4
Lumify
Member
 
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52

Original Poster
Rep: Reputation: Disabled
Debian and Ubuntu are practically the same, so it's good to hear from another user. One problem is I cannot restart the server because I'm rsyncing two local drives, and every time I restart it transfers everything over again. (see this thread: http://www.linuxquestions.org/questi....php?p=4603827)

I tried changing the port to a random 25784, and I get the same issue. I've also tried forwarding the used port in my router. Here's the output of # netstat -anltp:
Code:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:55403           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      709/portmap     
tcp        0      0 0.0.0.0:49107           0.0.0.0:*               LISTEN      1022/rpc.mountd 
tcp        0      0 0.0.0.0:37011           0.0.0.0:*               LISTEN      722/rpc.statd   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1609/sshd       
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1235/cupsd      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1498/exim4      
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:901             0.0.0.0:*               LISTEN      1577/inetd      
tcp        0      0 192.168.0.69:22         192.168.0.1:49010       ESTABLISHED 21880/sshd: server [p
tcp        0      0 192.168.0.69:47896      64.13.22.67:22          ESTABLISHED 27579/ssh       
tcp6       0      0 :::139                  :::*                    LISTEN      1592/smbd       
tcp6       0      0 :::80                   :::*                    LISTEN      1109/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      1609/sshd       
tcp6       0      0 ::1:631                 :::*                    LISTEN      1235/cupsd      
tcp6       0      0 ::1:25                  :::*                    LISTEN      1498/exim4      
tcp6       0      0 :::445                  :::*                    LISTEN      1592/smbd
 
Old 02-16-2012, 05:51 AM   #5
hallucinative
LQ Newbie
 
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18

Rep: Reputation: 5
This isn't a router \ firewall issue right now... first we must remove the "FAILED TO BIND PORT" issue since even if the router and firewall are setup correctly it'll still fail

ok the port isn't in use, look in your 'server.properties' file, perhaps your binding to your external ip address... make sure you have nothing in "server-ip=" unless your using multiple network interface cards XD

Also your config for your iptables shows accepting of all connections...so you don't need to open that up any further XD

Last edited by hallucinative; 02-16-2012 at 06:02 AM.
 
Old 02-17-2012, 08:27 AM   #6
Lumify
Member
 
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52

Original Poster
Rep: Reputation: Disabled
server.properties:

Code:
#Minecraft server properties
#Thu Feb 02 02:49:30 EST 2012
allow-nether=false
level-name=world
enable-query=false
allow-flight=true
server-port=25565
level-type=DEFAULT
enable-rcon=false
level-seed=
server-ip=
spawn-npcs=true
white-list=false
spawn-animals=true
online-mode=true
pvp=true
difficulty=0
gamemode=0
max-players=20
spawn-monsters=true
generate-structures=true
view-distance=15
motd=Lumify's epic server.
Maybe I could open it up more if I posted my IP address and root password. :P

Last edited by Lumify; 02-17-2012 at 08:29 AM.
 
Old 02-17-2012, 09:59 AM   #7
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
This could be as well a problem with java itself.
Make shure to have a java > 1.6
or, if more than one java is installed, use your "update-alternatives" to choose the proper one.

I dont know the name of "update-alternatives" on a debian box.
Albeit that I use Debian on some servers, I refuse to bother myself with java crap.
SCNR

If you managed to get the server running, make sure your router does proper port forwarding.

Last edited by uhelp; 02-17-2012 at 10:01 AM.
 
1 members found this post helpful.
Old 02-17-2012, 07:50 PM   #8
Lumify
Member
 
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uhelp View Post
Make shure to have a java > 1.6
YES!! That was it. I had 1.5, and updating to 1.6 fixed everything. Thanks both of you for the help.
 
Old 07-29-2012, 02:52 PM   #9
techis
LQ Newbie
 
Registered: Jul 2012
Location: Colorado
Posts: 7

Rep: Reputation: Disabled
OK so I was reading this post and I think that I have a similar issue. I have a server (ubuntu 12.04) and I have installed the Minecraft server, I was wondering if anyone knew what I have to do so that I can access the server externally to play on it. If you need specific info on the install I can get it to you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Minecraft Bukkit Server Console Window not showing up on cron in Ubuntu Chasingu Linux - Newbie 0 07-13-2011 09:29 PM
LXer: Minecraft Server on Ubuntu LXer Syndicated Linux News 0 06-11-2011 10:20 AM
[SOLVED] 1337 Minecraft Server enorbet Slackware 4 03-20-2011 06:45 PM
How to open port for some server? windstory Linux - Newbie 8 02-10-2011 12:28 PM


All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration