Well, the answer is "kind of". First, there is another element to the question of "rights". The attributes on the files and folders. These attributes control what any local user account (or group) can do within the filesysytem itself.
If a file looks like this:
--r--r--r apache.apache index.html
Then, the apache user and apache group and every other local system user can READ that file, and nothing more.
--r--r--- apache.apache index.html
Now the apache user and apache group are the ONLY non-root users who can read the file!
The difference between these is "chmod 444" vs "chmod 440"
It obviously goes on from there to extend Read, Write, and Execute priviledges on files.
Folders require the Execute priviledge to read from within them.
So that determines what a local user can do from a console or FTP client (and a few other ways).
NOW, once Apache takes control of what is exposed to Browser-based users, you have additional controls to prevent or authorize access to files...
DirectoryIndex creates a way to ensure that a file like "index.html" or "index.php" or "foo.bar" is always regarded as something the Apache server should render if a web folder is specified.
This is why
returns the result from "index.php" and DOES NOT display a file folder list. If you remove "index.php" and you have no other files present that are defined as DirectoryIndex, then Apache WILL display the folder listing. HOWEVER, this generally does not mean that someone will be able to view your code.
You can go on from here with other Apache controls in .htaccess files and such.
An easy way to compromise yourself and/or Apache is to run untested or untrustworthy scripts. This is generally the way your Apache gets hacked. But this would be of your own carelessness, not by Apache's default posture towards security.
Whew...
I think the message I'd close with is that Apache essentially runs the Internet (as measured by web servers). Just like many things related to "security", the security of your system requires some educated effort and an understanding of the risks you can tolerate.
You can lock down your Apache to where it's so secure that nothing can get out, but then that's not very useful.
There are PLENTY of "how to secure Apache" web pages and books out there. This has all been said before.
Good luck!
D.E.R. Management - IT Project Management Consulting