Raphael Fuchs <raphael.fuchs1@...> writes: > Hello, > as a complete newbie to running my own webserver I have a basic question on how to start the webserver corretly. > If I try to start the webserver as a normally priviledged user on port 80 I get a bind error. If I start myapp -p 80 as root it works fine and I can see the webpage in my browser without adding a port to the url. > > Is there a way to start the server on port 80 without beeing root? > > Thank you! > Raphael
On Linux you can use capabilities to start the server on port 80: http://wiki.archlinux.org/index.php/Using_File_Capabilities_Instead_Of_Setuid http://sites.google.com/site/fullycapable/ Here's a memo I did some time ago for using them with Java on Debian: ``` apt-get install sun-java6-jdk # Or any other JVM. apt-get install libcap2-bin setcap cap_net_bind_service+ep /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java ``` On FreeBSD you can use portacls to grant the port to a particular user. P.S. Whether you're running your application from root or not, I recommend using a system firewall, such as AppArmor, for extra protection. ------------------------------------------------------------------------------ _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
