Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Please, observe:

markk@ip-10-203-82-54:~/work/gl$ uname -a
Linux ip-10-203-82-54 3.2.0-25-virtual #40-Ubuntu SMP Wed May 23 22:20:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
markk@ip-10-203-82-54:~/work/gl$ ls -la /etc/authbind/byport/80
-rwxrwx--- 1 markk markk 0 Aug 16 10:00 /etc/authbind/byport/80
markk@ip-10-203-82-54:~/work/gl$ authbind /usr/bin/java -Dcom.shunra.gl.ports=80 -jar server.jar
java.net.SocketException: Permission denied
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:137)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:77)
        at org.simpleframework.transport.connect.Acceptor.bind(Acceptor.java:171)
        at org.simpleframework.transport.connect.Acceptor.<init>(Acceptor.java:88)
        at org.simpleframework.transport.connect.Listener.<init>(Listener.java:78)
        at org.simpleframework.transport.connect.ListenerManager.listen(ListenerManager.java:90)
        at org.simpleframework.transport.connect.ListenerManager.listen(ListenerManager.java:73)
        at org.simpleframework.transport.connect.SocketConnection.connect(SocketConnection.java:106)
        at org.restlet.ext.simple.HttpServerHelper.start(HttpServerHelper.java:93)
        at org.restlet.Server.start(Server.java:585)
        at org.restlet.Component.startServers(Component.java:601)
        at org.restlet.Component.start(Component.java:528)
        at com.shunra.gl.Main.main(Unknown Source)
^Cmarkk@ip-10-203-82-54:~/work/gl$

The machine is located in the amazon cloud.

Worth to mention, that when ran as root the server works as expected.

Any ideas?

Thanks.

P.S.

Adding the --deep authbind option or -Djava.net.preferIPv4Stack java property makes no difference.

EDIT

I have installed tomcat6. It listens on port 8080. I can wget its index page locally, but not from the outside using the DNS provided name of the machine. However, if I change its port from 8080 to 11111, then I can get to it from the outside. Which means, that the tomcat server behaves exactly like my own with respect to this issue.

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

Serverfault may not be the best place for your question since we cannot download the program you are writing and debug it ourselves. You may want to ask your question on stackoverflow.

First: Verify that it's an actual sysadmin-related problem. You can do this by trying to run tomcat which does work in the configuration you're trying.

If you cannot get Tomcat to work, then ask about that- chances are good that solving that problem will solve the one you're having.

On the other hand, if you can get Tomcat to work easily, you can spend more time looking at your application, and maybe try to ask a programming-related question on Stack Overflow.

share|improve this answer
    
OK, Tomcat behaves exactly like my own server. I will look for a solution for tomcat. Thanks. –  mark Aug 27 '12 at 13:26
add comment

I had the same problem, using Ubuntu 12.04.3 and trying to start a Java application with authbind. Adding -Djava.net.preferIPv4Stack=true solved the problem for me.

Obviously java tried to open the port on a IPv6 address, which authbind doesn't seem to support yet.

share|improve this answer
add comment

You could check the permission as stated in the stacktrace. Most probably the markk user has no rights for your actions

share|improve this answer
    
Please, elaborate. markk has full access to /etc/authbind/byport/80 –  mark Aug 16 '12 at 13:40
    
In most cases this caused when the file system rights of your java application has not the corrects rights. You have proven this by running as root without any problem. is the markk user in the correct groups? –  Mark Bakker Aug 17 '12 at 7:17
    
It is in the groups markk and admin. The java binary has no sticky bits. –  mark Aug 17 '12 at 9:29
    
Seems like you need a professional to help you. Maybe read a book / get someone who knows what he/she is doing –  Mark Bakker Aug 17 '12 at 11:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.