Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Oct 15, 2009 4:35 pm 
Offline
Junior Member

Joined: Wed Mar 04, 2009 11:10 pm
Posts: 29
I followed the guide in the linode library for Debian 5 with nginx and passenger. The init.d script was very nice, but it runs nginx as root. I want to run it as www-data, so I added -c www-data to the start-stop-daemon options. However, I'm getting this error when I try and start nginx:

Starting nginx: [emerg]: bind() to 0.0.0.0:80 failed (13: Permission denied)

Seems www-data doesn't have permissions to listen on port 80. How can I fix this?


Top
   
 Post subject:
PostPosted: Thu Oct 15, 2009 4:39 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Only root can bind to ports under 1024. For this reason, most daemons are run as root and then change user to a non-privileged user.

The correct way to get a daemon to run as a regular user, then, is to use the configuration system provided by that daemon.

In nginx's case, there appears to be a "user" parameter at the start of its configuration file.


Top
   
 Post subject:
PostPosted: Thu Oct 15, 2009 5:04 pm 
Offline
Junior Member

Joined: Wed Mar 04, 2009 11:10 pm
Posts: 29
Ah, I see. Thanks, that did the job. :)


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


Who is online

Users browsing this forum: No registered users and 4 guests


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