Permission Webserver Files

File Permissions in Your (Expanding) Web Space
Initially, your Web space might consist of a single HTML file. Typically, this file might be called index.html. Web sites are made of more than one file, of course, so you will no doubt want to add more HTML files and directories of files to your Web space.

In a Unix system, expanding your Web space requires that you know a little bit about how to manage files and directories. You should review this lesson on the Unix filesystem, this lesson on Unix filenames, this lesson on Unix file permissions.

When you create directories or files for your Web space, you need to make sure that they are viewable (and executable in the case of directories or Cascading Style Sheet (CSS) files) to the world.

To set these permissions, you can use the Unix chmod command. The setting 744 is appropriate for HTML files in your Web space and the setting 755 is appropriate for CSS files and subdirectories in your Web space.

So here is what I would do to make sure all my files are viewable to the world in my Web space. In this example, I have my Web files in a subdirectory, www.

I get to the Unix prompt, then issue these commands (the $ represents the Unix prompt–do not type the $):

$ cd www
$ chmod 744 *.html
$ chmod 755 *.css
When I make a subdirectory called portfolio, I do this:

$ mkdir portfolio
$ chmod 755 portfolio
$ cd portfolio
After I create files in portfolio, I do this:

$ chmod 744 *.html
$ chmod 755 *.css
If you run into any problems with your Web browser getting a “permission denied” error in displaying files in your Web space, issue these chmod commands again in the directories where the problem files reside.

### String Owner’s
Permissions
Group’s
Permissions
Other’s
Permissions
Directories
775 drwxrwxr-x Read
Write
Execute
Read
Write
Execute
Read
Execute
744 drwxr–r– Read
Write
Execute
Read Read
755 drwxr-xr-x Read
Write
Execute
Read
Execute
Read
Execute
711 drwx–x–x Read
Write
Execute
Execute Execute
Files
664 -rw-rw-r– Read
Write
Read
Write
Read
775 -rwxrwxr-x Read
Write
Execute
Read
Write
Execute
Read
Execute
755 -rwxr-xr-x Read
Write
Execute
Read
Execute
Read
Execute
744 -rwxr–r– Read
Write
Execute
Read Read

2 Reaktionen zu “Permission Webserver Files”

  1. Alex Gordon

    Что бы Вы стали делать на моём месте?…

    Менеджер по персоналу File Permissions in Your (Expanding) Web Space
    Initially, your Web space might consist of a single HTML file. Typically, this file might be called index….

  2. Kylie Batt

    Очень ценная фраза…

    Начальник отдела In a […….

Einen Kommentar schreiben