So, I'm just getting started with Drupal and just installed the Backup and Migrate module. When I tried a backup to a folder on the same server it came up with an error. It was basically saying that this folder was not private and anyone can access it.
Thought I'd take a quick look into it. Turns out that the folder in question - sites/default/files/private/backup_migrate/manual/
can be read by anyone, therefore files are not safe.
So, how do you make it 'private'. Well, a good test is to try and navigate to the file:
sites/default/files/private/backup_migrate/manual/test.txt
which automatically gets made. I typed it into a browser and it loaded up. Simple.
So, to limit access depends on you hosting provider. I'm with Daily.co.uk, and they suggest using .htaccess files. I found this nice article on the subject, worth reading through properly.
I found that this command at the top of the .htaccess file (which was already in the folder) solved the problem:
AllowOverride All
I figure it's telling the Apache server to override all options.
A catalogue of 'stuff' which somehow will help me through life by helping me remember problems I've solved, how I solved them and thoughts which will be otherwise forgotten (some of which might be of use later on).
Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts
Sunday, 30 March 2014
Monday, 10 March 2014
OS X Mavericks and Active Directory Home drive problems (NHR)
So, I'm going to document what problems I currently have with Active Directory home drives stored on windows SMB shares.
In the past when we put our macs on the active directory logins, I always untick the "Force local home" in the active directory options. The main reason is so that users take with them all of their account settings and preferences where-ever they login. This does however come with problems. It seems the mounted home drive has some permission issues which some applications have real problems with.
In the past I have installed Network Home Redirection (NHR). At login, this script runs whenever it detects the user to be a network user. It then creates a local temporary folder and creates alias' from particular folders on your home drive to the local folder. From the perspective of an application running, it thinks that these folders are normal local folders which they tend to prefer.
The default NHR setup redirects folders of known problems in OS X 10.6. But I don't think it is updated anymore. I have been constantly adding and taking away folder re-directions for the application we use in the computer suites.
Here I shall document current problems with network home preferences where NHR has worked.
Adobe Acrobat Pro 9
Seems to Crash when opening a document
Redirected folder: ~/Library/Application\ Support/Adobe/Acrobat
Seems to have fixed the crash
In the past when we put our macs on the active directory logins, I always untick the "Force local home" in the active directory options. The main reason is so that users take with them all of their account settings and preferences where-ever they login. This does however come with problems. It seems the mounted home drive has some permission issues which some applications have real problems with.
In the past I have installed Network Home Redirection (NHR). At login, this script runs whenever it detects the user to be a network user. It then creates a local temporary folder and creates alias' from particular folders on your home drive to the local folder. From the perspective of an application running, it thinks that these folders are normal local folders which they tend to prefer.
The default NHR setup redirects folders of known problems in OS X 10.6. But I don't think it is updated anymore. I have been constantly adding and taking away folder re-directions for the application we use in the computer suites.
Here I shall document current problems with network home preferences where NHR has worked.
Adobe Acrobat Pro 9
Seems to Crash when opening a document
Redirected folder: ~/Library/Application\ Support/Adobe/Acrobat
Seems to have fixed the crash
Tuesday, 15 October 2013
Deleting 'forced' local home folders created from OS X 10.7 Active Directory Logins
When users log in to the apple macs at the college it creates a local home on the machine to save preferences and files, and mounts their home drive too.
After a year these fill up. After a few searches and researches, looks like the easiest way is to write a script which deletes all folders except certain ones. Looks like you can use the 'find' command. Found a good example here:
Here's the man page for find
So, I don't want to delete the folders:
Guest
Shared
administrator
media
So:
Actually, I found here that the slightly better way to do it was to use the -exec rm instead of -delete. This then tells you which directories were actually deleted:
After a year these fill up. After a few searches and researches, looks like the easiest way is to write a script which deletes all folders except certain ones. Looks like you can use the 'find' command. Found a good example here:
find . -maxdepth 1 -not -name 'filename.gif' -iname '*.gif' -delete
Here's the man page for find
So, I don't want to delete the folders:
Guest
Shared
administrator
media
So:
find . -maxdepth 1 -not -name 'Guest' -not -name 'Shared' -not -name 'administrator' -not -name 'media' -name '*' -delete
I tried '*.*' but it only then deletes files with '.' in them, not folders. '*' selects everything including foldersActually, I found here that the slightly better way to do it was to use the -exec rm instead of -delete. This then tells you which directories were actually deleted:
find /Users/Shared -maxdepth 1 -mindepth 1 -not -name 'administrator' -not -name 'Guest' -not -name 'Shared' -not -name 'media' -exec rm -Rvf {} \;
The -mindepth 1 option makes sure it doesn't delete the parent directory.
A longer term solution would be to delete these folders on logout, so the students and staff could get used to not relying on these folders.
Labels:
10.7,
Active Directory,
Apple Remote Desktop,
ARD,
Command Line,
delete,
find,
folder,
local home,
Login,
OS X,
remove,
terminal
Subscribe to:
Posts (Atom)