|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
On my Mac (10.3.8) I created a folder in my Home User Dir. In this folder I keep the websites I work on.
Everything works great with Apache and MySQL. Only thing is, I don't like other users on my Mac to have access to these files (like they have no access to folders such as: Documents and Library). So I gave my directory which holds all websites the same rights as the other restricted dirs (Ownership & Permissions; Others : No Access). So far no problem. Other users can't access my files anymore. But Also Apache can't access my webfiles anymore!!! Bottomline: I like me, myself and Apache to have access to the files, and no other users. I think it's possible to do this via group-access. But I can't find the httpd user to add to this group. What user is Apache running under? Or does anybody has experience with this type of problem?? Thanks! Cheers, Frank |
|
#2
|
||||
|
||||
|
Maybe its better to only use the access in Apache ??
Have a look at this: http://httpd.apache.org/docs/misc/FAQ.html#remote-auth-only
__________________
Kenped |
|
#3
|
||||
|
||||
|
Quote:
What do the file permissions you're using now look like, if you've trurned of the the x-bit then Apache won't be able to access the folder. I would change the folders permissions to 711, if you haven't already and see if that works. .I'll test this out a little later today, Mark.
__________________
... > (define links (list google scheme ruby python others ...)) ; Read my blog at http://netytan.blogspot.com/. > _
|
|
#4
|
||||
|
||||
|
Ok I can now confirm this, provided that the user trying to access the folder isn't in your group or doesn't have super user privileges chmoding to 711 or 701 will be enough to keep them out
. And, provided that that last x-bit is turned on Apache still has access.The power of Unixs file permissions .Mark. |
|
#5
|
|||
|
|||
|
Thanks Mark!!!
this did the trick! excellent! Even other Administrator don't have access to it anymore, at least as far as I checked it in the Finder. Funny thing is, you can only do this with the Terminal, not via 'Get Info' on a folder in the Finder. thanks a lot!! |
|
#6
|
||||
|
||||
|
I've noticed that but I can't really tell you why that is. Maybe Apple didn't want to trouble users with an the x-bit when all most users only care about read and write
.I guess that adding "execute" permissions might be a little confusing . Luckily for me I enjoy playing with Mac OS Xs Unix underpinnings but maybe this will be added in Tiger.Anyway you should be able to write a simple Applescript to make this kind of thing easier. This of course lacks any GUI bits but the general idea is there. Code:
tell application "Finder" set pathName to POSIX path of (selection as string) -- Run the chmod +x command on the selected -- pathName in the Finder. Making the file -- executable. tell application "Terminal" to ¬ do shell script "chmod +x" & space & pathName end tell Note: this code is far from finished and is ment to ilustrate a point only. take care, Mark. |
|
#7
|
||||
|
||||
|
Ok so I got a little stalled and ended up playing around with the Applescript I posted above. Add about 10 more lines and we have something useful which can now turn the x bit on or off
.Code:
-- This simple AppleScript turns the the x bit for selected files/folders on
-- or off depending on the users choice in the dialog created below.
set the usersChoice to the button returned of (display dialog ¬
"Turn x bit for selection" buttons {"On", "Off"} default button 1)
if the usersChoice is "On" then
-- Sets the chmod command to turn the x bit on if the "On" button
-- was clicked.
set chmod to "chmod +x"
else
set chmod to "chmod -x"
end if
-- The section below does the actual work using the values set up
-- in the section above. Note: that this will apply your choice to all
-- of the selected files/folders.
tell application "Finder"
repeat with pathName in (selection as list)
-- Run the chmod +x command on the each of the selected
-- files and or folders, turning on there x bit.
do shell script chmod & space & POSIX path of ¬
(pathName as string)
end repeat
end tell
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Mac Help > Securing my Web Development Folder |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|