• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved [Solved] Server Permissions

nate88

Member


Messages: 33

#1
Hey everybody,

What would be the correct chmod command to allow users to access all the files inside the primary Nginx folder: would chmod 755 /usr/local/www/nginx be a correct syntax? I'm a graphics artist diving headfirst into BSD/ Unix permissions. I'm merely attempting to get rid of the standard “403 forbidden” error. I now suspect that my issue is not with the Nginx server configurations, but the O.S. permissions settings for ''others'' to read and execute the files inside the website folder. I'm at least one step away from having my streaming server up in my office. (At least it seems that way LOL.)

Any suggestions will be most appreciated.

Thanks again.
 

fonz

Son of Beastie

Thanks: 365
Messages: 2,560

#2
Re: Server Permissions

nate88 said:
Hey everybody,

What would be the correct chmod command to allow users to access all the files inside the primary Nginx folder: would chmod 755 /usr/local/www/nginx be a correct syntax?
The above command only allows people access to the directory(*) itself, not what's in there. I suggest you do chmod -R go+r /usr/local/www/nginx to give everybody read permission and then find /usr/local/www/nginx -type d -exec chmod go+x {} \; to add execute permission for directories(*).

Ad (*): You probably meant to say directory, not folder. Folders are for storing e-mail and for communicating with Windows people.
 

nate88

Member


Messages: 33

#3
Re: Server Permissions

Thanks. Oh wow, I would have spent another week hunting down that last command line hahah. I just typed those lines, restarted the computer, and I'm still receiving the 403 error after restarting the computer.

I may have a configuration issue still happening. I do know that the Nginx server is working because I attempted to access the index page while I was rebooting the server computer and on the second computer I'm typing on, I received a Firefox 404 error, instead of a 403 Forbidden error with Nginx written on it. So my issue could be in the configuration settings.

Thanks for clearing me up on "directory". They still refer to the term "folder" in Macintosh also. (That's probably just Southern U.S. slang where I originally learned OS X.)
 

drhowarddrfine

Son of Beastie

Thanks: 818
Messages: 2,608

#4
Re: Server Permissions

This isn't Windows. You don't need to restart the computer every time you change or update things (almost).

You need to find out what your Nginx configuration file is using for root. It should have a line in it for the root pathname beginning with the word 'root'. If your HTML files aren't in that path and directory, then that's the problem. The second thing you have to look at is what permissions are on the HTML files you're trying to access, ls -l in that directory will show who has permission to read/write/execute those files and, for that matter, if you can read/write/execute those files.
 

zodias

Member

Thanks: 3
Messages: 63

#5
Re: Server Permissions

Hi,

If you want to serve files with www/nginx you may put:
Code:
 autoindex on;
in /usr/local/etc/nginx/nginx.conf.

It is a good practice to check the configuration. You can do it with: # service nginx configtest.

You will need to restart (or only reload the configuration) the web server after changes in the configuration file with: # service nginx restart or # service nginx reload.
 

nate88

Member


Messages: 33

#6
Re: Server Permissions

Ok, here is my server configuration section in the nginx.conf text file:
Code:
server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root /usr/local/www/nginx;
            index  index.html index.htm;
            autoindex on;
        }
The website HTML pages are in /usr/local/www/nginx, so that part is correct. And the message I received has ended with
Code:
Performing sanity check on nginx configuration:
nginx: the configuratino file /usr/local/etc/nginx/ningx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
thus I may still be missing something.
 

nate88

Member


Messages: 33

#7
Re: Server Permissions

Here is the test website folder data:
Code:
$ cd /usr/local/www/nginx
$ ls -l
total 229936
-rw-r--r--  1 root  wheel          0 May 11 10:53 ?
-r--r--r--  1 root  wheel        537 May  8 03:07 50x.html
-rwxr-x---  1 root  wheel  233860403 Mar 12 17:43 Classic_Sci-Fi_-_Journey_To_The_Seventh_Planet_1962_.avi.mp4
-rw-r--r--  1 root  wheel          1 May  8 03:07 EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
-rwxr-x---  1 root  wheel    1420284 May  4 17:15 WEBPAGE_ICON.jpg
-rwxr-x---  1 root  wheel        772 May  4 19:29 coming_soon.html
-rwxr-x---  1 root  wheel       1389 May  4 19:30 index.html
It appears that for some reason I still haven't allowed the intranet/Internet users the ability to see the site. I must not have typed in the correct chmod. I'm not using xterm any more today. I'll use the easy cut and pasted functions of roxterm (yes I use as many training wheels as I can get my hands on haha because I'm still weak in the headless realm. but thanks to all of you, I'm learning. I'm not giving up, again thanks for your patience).
 

nate88

Member


Messages: 33

#8
Re: Server Permissions

Ok, so since I just feel as though I was cramming for a test in college hahah, let me stop laughing at myself for a moment; I was really over thinking the problem. All I had to do was to type in cd/ usr/local/www/nginx and then I merely typed for each of the items that I wanted to view: chmod 755 index.html (and just change the index html for each item that you wish to include once you're in the folder and bam it was all super).

Uh... how do I now add the forum "SOLVED" button LOL? Now that I have finally become a civilized person, I'd like to thank all you guys for helping a graphic designer look like a pro computer user. LOL.

Thanks again. Cheers mates, I'm popping a bottle top now hahaha. :beergrin
 

fonz

Son of Beastie

Thanks: 365
Messages: 2,560

#9
Re: Server Permissions

nate88 said:
Uh... how do I now add the forum "SOLVED" button LOL?
With the current forum software, edit the first post (so obviously you must be the topic starter) and change the subject line accordingly. In this case I've already done that for you :beer
 
Top