Nginx Error.log Permission Denied
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta nginx open() failed (13 permission denied) Discuss the workings and policies of this site About Us Learn more /var/run/nginx.pid" failed (13: permission denied) about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Starting Nginx Nginx Emerg Open() /etc/nginx/nginx.conf Failed (13 Permission Denied)
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping
Nginx Permission Denied Static Files
each other. Join them; it only takes a minute: Sign up nginx on Ubuntu: Permission denied up vote 16 down vote favorite 6 I am new to system administration. After installing nginx via puppet on Ubuntu I get the following output: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) [warn] 1898#0: the nginx connect() to failed (13 permission denied) "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 [emerg] 1898#0: open() "/var/log/nginx/access.log" failed (13: Permission denied) How do I get rid of all of these messages? I don't want to use command line directly (chown / chmod) and repeat it every time I create a new server. Therefore, I am thinking of what has to be added to the puppet manifest. What is the best sysadmin practice in this case: to change owner / permissions for /var/log/nginx or to store logs in different location? If chown / chmod is the way to go, which specific permissions would ensure the highest level of security? I tried this, but it didn't help: file { '/var/log/nginx': ensure => directory, mode => '0755', owner => 'www-data', group => 'www-data', recurse => true } Edited: vagrant@precise64:~$ ps aux | grep [n]ginx root 1001 0.0 0.1 62908 1388 ? Ss 08:47 0:00 nginx: master process /usr/sbin/nginx www-data 1002 0.0 0.1 63260 1696 ? S 08:47 0:00 nginx: worker proce
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You previously marked this answer
Open() "/run/nginx.pid" Failed
as accepted. Are you sure you want to unaccept it? Yes, I'm sure. nginx log permissions Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups nginx: [emerg] bind() to 0.0.0.0:80 failed (13: permission denied) Main Site Sign Up Log In submit View All Results By: Saphiria Subscribe Subscribed Share 0 Nginx Warnings - How to fix? April 29, 2016 1.8k views Nginx Hey! When I I http://stackoverflow.com/questions/18714902/nginx-on-ubuntu-permission-denied try to restart nginx, after editing sudo nano /etc/nginx/sites-available/default, I get this fail response: Restarting nginx nginx [fail] I then do nginx -t and get this message: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2016/04/28 20:06:07 [warn] 6121#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 2016/04/28 20:06:07 [emerg] https://www.digitalocean.com/community/questions/nginx-warnings-how-to-fix 6121#0: unexpected "}" in /etc/nginx/sites-enabled/default:84 nginx: configuration file /etc/nginx/nginx.conf test failed So what am I doing wrong and how can I fix it? It seems there is two things going wrong? Thanks in advance. 3 comments 0 Saphiria April 29, 2016 By the way, I was following [https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04](http://) guide. 0 Saphiria April 29, 2016 nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2016/04/28 20:18:01 [warn] 6275#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2016/04/28 20:18:01 [emerg] 6275#0: open() "/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed NEW MESSAGE 0 BrookDO MOD April 29, 2016 Hi, What happens if you do sudo nginx -t ? Log In to Comment Leave a Comment Add comments here to get more clarity or context around a question. To answer a question, use the “Answer” field below. Log In to Comment 1 Answer 0 Saphiria April 29, 2016 [deleted] Reply Log In to Comment Have another answer? Share your knowledge. Log In to Answer Related Questions Nginx HTML5 Video not sho
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://serverfault.com/questions/370337/run-nginx-as-a-non-root-user Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. http://davidad.github.io/blog/2014/04/06/minimal-nginx-configuration Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Run nginx as a permission denied non-root user up vote 14 down vote favorite 5 I followed this process to installing nginx on my Ubuntu 10.04 Lucid Server http://library.linode.com/web-servers/nginx/installation/ubuntu-10.04-lucid I got lost after the point of creating an init script to start nginx, and then calling /etc/init.d/nginx start. When I did that, I got the following error: Starting nginx_main: Starting /opt/nginx/sbin/nginx... nginx: [alert] could not open error log file: open() "/opt/nginx/logs/error.log" failed (13: Permission denied) 2012/03/16 18:17:27 [emerg] failed (13 permission 859#0: open() "/opt/nginx/logs/access.log" failed (13: Permission denied) The only way I can run it is if I use sudo and it runs the process as root, which is what I don't want. I've chown'd the entire directory (chown -R nginx:nginx /opt/nginx) and I've also chmod -R 755 the directory as well. Adding the user directive as suggested by CS3 also gives me this error, but with an additional line. Starting nginx_main: Starting /opt/nginx/sbin/nginx... nginx: [alert] could not open error log file: open() "/opt/nginx/logs/error.log" failed (13: Permission denied) 2012/03/16 18:48:34 [warn] 1606#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /opt/nginx/conf/nginx.conf:2 2012/03/16 18:48:34 [emerg] 1606#0: open() "/opt/nginx/logs/access.log" failed (13: Permission denied) Any ideas? ubuntu permissions ubuntu-10.04 init.d share|improve this question edited Mar 16 '12 at 5:49 asked Mar 16 '12 at 5:20 John 3161413 and I've also chmod -R 755 the directory as well Keep doing this and you'll pay a price for it eventually. It's scary to witness how many people there are on the internet suggesting this as a first port of call to "fix" any problem. Unix won't give friendly feedback if you do something moronic. –user181093 Jul 10 '13 at 20:44 add a comment| 3 Answers 3 active oldest votes up vote 1
for the majority of my adult life, I find nginx an absolute joy to set up. I’m completely sincere about that. But, for those who are just getting into Web development, nginx is just about as much of a struggle as Apache used to be—in fact, probably more so, because there’s less abundant learning material out there on the Internet. So, here’s an attempt to make that situation just the slightest bit better. If you don’t already have nginx installed, I encourage you to follow these directions for building OpenResty, an enhanced version of nginx that enables building entire Web apps within the nginx process using the beautiful programming language Lua. But, from here on, I’m going to assume that you already have a stock version of nginx installed. Verify that if you run $ nginx -v you get some kind of reasonable response, like nginx version: nginx/1.2.3 Success! Now, make a file called hi.conf: hi.conf error_log stderr; pid nginx.pid; http { access_log off; server { listen 4945; location / { return 200; } } } events {} I’ve chosen the number 4945 so as to hopefully not conflict with any services that may already be running on your machine for one reason or another. Now, let’s launch nginx using this configuration file and test it: $ nginx -p `pwd`/ -c hi.conf nginx: [alert] could not open error log