Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Oct 22, 2011 9:14 pm 
Offline
Senior Newbie

Joined: Thu Oct 20, 2011 6:35 pm
Posts: 6
Hi

I'm in the process of setting up Ubuntu 11.10 as a web server for a personal website plus testing and playing around. I've installed the Cherokee web server after reading positive reviews of it and am looking for a way to bind port 80 to localhost so that I can run the server as a non root user.

I have successfully run the software on port 8080. I have run
Code:
netstat -lp
to ensure nothing is running on port 80 already.

Here is the error that appears when trying to start cherokee via cherokee-admin when started as root

Could not bind() port=80 (UID=0, GID=0)
Most probably there is another web server listening to the same port. You will have to shut it down before launching Cherokee. It could also be a permissions issue as well. Remember that non-root user cannot listen to ports < 1024.

Perhaps this is just me being a bit thick but some advice as to how to proceed would be gratefully appreciated.

regards,
Richard


Top
   
 Post subject:
PostPosted: Sat Oct 22, 2011 9:28 pm 
Offline
Senior Member
User avatar

Joined: Wed Apr 20, 2011 1:09 pm
Posts: 63
Take a look at this: http://stackoverflow.com/questions/4138 ... -1024-on-l

To put it simply, you've got your work cut out for you.


Top
   
 Post subject:
PostPosted: Sun Oct 23, 2011 12:11 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Yup, ports below 1024 are considered privileged and cannot, by design, be bound to by non-root users (without root being involved, at least). It's a feature, not a bug.

The usual approach is either to start the web server as root (practically all modern web servers will immediately drop to a non-root uid after binding) or run it on a non-privileged port and have a proxy server redirect stuff up to it. iptables REDIRECT is worth some attention, as well.

On the bright side, everything above 1024 is free and clear for non-root users! :-)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group