Sometimes when you move things around on a Linux/Apache server — or what is more often the case, when someone at your (new) hosting company moves stuff for you from one server to another, the file permissions get messed-up. When that happens, so can this:
So what am I talking about with file permissions? Because Linux is a UNIX-Like operating system, and because both support multiple-users and multiple-processes, the system has to keep track of who owns a file, and who is allowed to do various things with a file. Meaning, I can write a document that you can read, but not edit. You can write a program that only you can run. And that’s what I think happened here, the file permissions got changed so only the file owner can read/view the file. Meaning, you and I are forbidden to view the web page. I know this is a bit confusing,so let me break this down a bit more.
There are three basic levels of file ownership:
- User – the owner of the file, such as the person who FTPs the file up onto a server.
- Group – groups of known users on the server, not really an issue here.
- Other – everyone else in the known world.
These ownership classifications are often abbreviated as U, G and O.
These ownerships are combined with levels of access to both files AND directories, which are as follows:
- Read – read the file.
- Write – modify or delete the file.
- eXecute – execute (or run) the file.
These permissions are often abbreviated to R, W and X on most space-cramped displays. They are also referred to ordinally on every *nix system I’ve ever worked on. Here’s how the number game is played:
- Read = 4
- Write = 2
- eXecute = 1
And if that’s not confusing enough, you can create a matrix of permissions by mixing and matching the permissions. For example, what the good folks at Our Lady of Lourdes need to do is chmod 755 their public files and directories. Here’s why:
- U: RWX= 4 + 2 + 1 = 7 = you the user/owner can read, write and execute the file.
- G: R-X= 4 + 0 + 1 = 5 = means users in your defined group can read and execute the file
- O: R-X= 4 + 0 + 1 = 5 = means the entire world in your defined group can read and execute the file
What I suspect happened is either the system administrator moved the account in such a way that he/she became the user/owner of the file — either that, or the read permissions were incorrectly set, or the default web page is a .PHP or .CGI type program which has not been set to execute.
Whatever the case, this is a good example why you need outside people outside of your network testing your site.