Apache Tips – suphp and changing permissions in bulk |
|
|
|
| Written by YCS admin |
| Tuesday, 17 November 2009 13:41 |
|
Have you installed Joomla and found all the folders locked? If you log into the administrative area and find under Help/System Info/Directory Permissions you can see which files and folders need to be writable. If you search for an answer you’ll find people suggesting you change these folder permission to 777 which leaves your site vulnerable. Here is a script the help you do this faster (and change them back). http://docs.joomla.org/How_to_solve_Installation_errors_Extension_Manager But you need to ask yourself why are they locked in the first place? You’ll also find the folders are owned by 99 (nobody) and you can’t change this to the site owner. What is happen is the scripts in Joomla install are being run as the owner but when apache is running as root and it tries to change things it is not able to. This is a solution if you have root access to your server (if you don’t get your web site provider to do it). Install suphp – suphp makes scripts run under your specific user account, as opposed to the Apache user account. If you have a server running WHM to install suphp is as easy as ticking a box. To change ownership of the public_html folder log into your site with a shell access and do a chown Chown –R owner:group directory-name ie Chown –R 545:545 public_html – only do this is you have suphp running as public_html needs group ownership of 99 without it. –R is recursive and changes every folder and file in the tree. Next you need to set the permission to 755 for folders and 644 for files. You can use the script above or you can use this For Directories Find “directory”/ -type d | xargs chmod 755 <enter> For File Find “directory”/ -type f | xargs chmod 644 <enter> PS this is only works on file with no spaces in their name. That it – own your site you can install and uninstall as it should be. |
| Last Updated on Friday, 18 December 2009 14:19 |