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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-15-2012, 10:08 PM
|
#1
|
Member
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52
Rep: 
|
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?
|
|
|
02-15-2012, 11:54 PM
|
#2
|
LQ Newbie
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18
Rep:
|
Quote:
Originally Posted by Lumify
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-15-2012 at 11:56 PM.
|
|
|
02-15-2012, 11:58 PM
|
#3
|
LQ Newbie
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18
Rep:
|
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 12:00 AM.
|
|
|
02-16-2012, 03:21 AM
|
#4
|
Member
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52
Original Poster
Rep: 
|
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
|
|
|
02-16-2012, 04:51 AM
|
#5
|
LQ Newbie
Registered: Feb 2012
Location: Western Australia
Distribution: Ubuntu Server
Posts: 18
Rep:
|
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 05:02 AM.
|
|
|
02-17-2012, 07:27 AM
|
#6
|
Member
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52
Original Poster
Rep: 
|
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 07:29 AM.
|
|
|
02-17-2012, 08:59 AM
|
#7
|
Member
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205
Rep:
|
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 09:01 AM.
|
|
1 members found this post helpful.
|
02-17-2012, 06:50 PM
|
#8
|
Member
Registered: Jan 2012
Distribution: Debian Stable
Posts: 52
Original Poster
Rep: 
|
Quote:
Originally Posted by uhelp
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.
|
|
|
07-29-2012, 01:52 PM
|
#9
|
LQ Newbie
Registered: Jul 2012
Location: Colorado
Posts: 7
Rep: 
|
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.
|
|
|
All times are GMT -5. The time now is 06:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|