|
#1
|
|||
|
|||
|
For my baby croc account, as an experiment, I set the permissions to 600 for a php webpage that's in my public_html directory. I expected that I would not be able to view the page in my browser. Upon testing, however, I was able to view the page.
I went into Live Chat and was told that sometimes a page set to 600 can be viewed. I didn't press the matter, since I don't have a real world problem that I'm trying to solve right now. I was just testing to see if my mental model of how permissions work is correct. Evidently it is not. But now this is bugging me. Can anyone explain what's going on? |
|
#2
|
||||
|
||||
|
Depending on what your browser settings are, it's possible that you were viewing the page in its pre-changed state.
__________________
Hosting term analogies, revised and improved (?) |
|
#3
|
||||
|
||||
|
I don't think that permissions of 600 would prevent the file from being processed to be viewed. You aren't actually viewing the file?
__________________
best regards, George |
|
#4
|
|||
|
|||
|
Quote:
Quote:
I've done some further experimentation and it seems to work as above for php files, but not for txt or html files. In other words, if I chmod a txt or html file to 600 and then try to view with a browser, I get the forbidden message. However, if I chmod a php file to 600 and try to view in a browser, I see the output the php code produces. |
|
#5
|
||||
|
||||
|
On HG's server configuration, the entire thing is built for the webserver to run as YOU. Your account login name you chose at signup, the one that you use to access http://your.HG.IP.here:port/~accountname ... that's the username your webserver runs as. That's the username the system gives ownership of your files to.
Your experience with 600 on .php might be because HG used the official PHP recommendation for building a PHPsuExec, PHP as CGI environment. As I understand that, although PHP code does not 'execute', it is 'parsed' by a binary which is 'executing', in the case of the official PHP CGI method, the webserver does indeed think that the .php is executing. I'd like to be corrected on that, if I'm wrong, since I can not confirm that PHP SuExec does that, or that HG used the official method. Official way is wrong, btw. I'm not near my bookmark, but the basic flaw was AddType being used in httpd.conf, where AddHandler is correct. ThePlanet knows this, and they're HG's datacenter, so perhaps HG knows this. According to Symfony framework docs, I should be wrong about execution permission. According to this pdf, I should be quite wrong. Last edited by whatrevolution; 04-02-2008 at 03:45 PM. |
|
#6
|
||||
|
||||
|
I can confirm that the pdf file is correct in the way permissions work on HG, at least on the one I'm on.
Right now I have my index.php set to 400, it's been set to this for a month, and the site works fine, I've even set the public_html to 750 and still everything works just as it should. I'm glad this came up I've been thinking about this for a while and read over on cPanel forums about this very same thing and they say the same thing. If you think about it, anyone that found a way to inject php would have the same control as your user... *shivers*
__________________
“There is a principle which is a bar against all information, which is proof against all arguments and which cannot fail to keep a man in everlasting ignorance—that principle is contempt prior to investigation.” —Herbert Spencer
Last edited by kompreszor; 04-02-2008 at 06:21 PM. Reason: Added link to cPanel forum |
|
#7
|
||||
|
||||
|
That's why I have no sympathy for the cry-babies in the PHP5 upgrade thread...
|
|
#8
|
|||
|
|||
|
Quote:
Quote:
Does having public_html set to 750 work because the group for public_html is nobody? I've been wondering why the group is different for public_html than for all my other directories. Thanks to all for sharing your thoughts. I lurve the way this forum is helping to move my understanding forward. |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 12:58 AM.









