Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx.conf (permission to write denied). How do I fix this?

So I am trying to follow the tutorial here: https://gorails.com/deploy/ubuntu/14.04 to deploy a Rails app. When I tried to edit the nginx.conf at (/etc/nginx/nginx.conf) file, it tells me I have read only permission, even though I followed the steps(with setting the permissions) previously. How do I fix this?

like image 266
user3477051 Avatar asked Jul 19 '14 21:07

user3477051


People also ask

How enable conf file in nginx?

We can enable a server block's configuration file by creating a symbolic link from the sites-available directory to the sites-enabled directory, which Nginx will read during startup. To do this, enter the following command: sudo ln -s /etc/nginx/sites-available/ example.com /etc/nginx/sites-enabled/

What permissions does nginx need?

Permissions ( chmod )Website user ( example ) can read, write all files, and read all directories. Website group (webserver user) can read all files and traverse all directories, but not write. All other users cannot read or write anything.

Is forbidden permission denied?

The 403 Forbidden error appears when your server denies you permission to access a page on your site. This is mainly caused by a faulty security plugin, a corrupt . htaccess file, or incorrect file permissions on your server.


1 Answers

you need sudo to edit that file, because it's owned by root user,

use sudo nano /etc/nginx/nginx.conf or sudo vim /etc/nginx/nginx.conf which ever editor you prefer.

like image 165
Mohammad AbuShady Avatar answered Oct 17 '22 08:10

Mohammad AbuShady