File and folder permissions required for SMF 1.1 to operate properly?

Started by scottws, May 09, 2006, 10:30:39 AM

Previous topic - Next topic

scottws

My SMF 1.1 RC2 forum is hosted on a Linux server, which I run.  The entire forum directory and all its subdirectories and files are owned by user "smf" and group "forum."  This user has FTP access.  All files in the forum directory and its subdirectories have permissions of 644 and all directories and subdirectories have permissions of 755, except where noted below:


  • Packages = 777
  • Packages/backups/ = 777
  • Packages/installed.list = 666
  • Packages/server.list = 666
  • Smilies/ = 777
  • Themes/ = 777
  • attachments/ = 777
  • avatars/ = 777
  • agreement.txt = 666
  • Settings.php = 666
  • Settings_bak.php = 666

Under these permissions, my forum was operating just fine until I tried to install the Users Online Today mod (v 1.4.0 beta 2).

After typing in my FTP information ("smf", password), the mod downloaded successfully, and SMF's package manager reported that it passed all installation tests.  When I clicked Apply Mod, I was met with a message stating the installation completed successfully, and that whatever feature had been added is now available.

I went to the main board index, yet there was no "Users Online Today" section (yes, I was using the default Core theme).  I tried refreshing the page, logging out and logging back in, deleting all temp files, history, and cookies and refreshing, yet nothing worked... the section was not there.

So I went to uninstall the mod.  I was greeted with a message that said that there would be a problem uninstalling the mod.  It failed all tests.  When I tried to uninstall it, I received the following message:

QuoteYou cannot download or install new packages because the Packages directory or one of the files in it are not writable!

Again, as I said, the Packages directory - as well as its subdirectory backups - is chmodded to 777, and files installed.list and server.list inside Packages are chmodded to 666.  The only file that isn't group or world writeable in Packages is index.php, which is 644.  So I don't know what that error message is talking about.

Now, I wanted to test something regarding permissions and installing packages.  So I went to the root of the forum directory, and did rm -R *, thus wiping out the whole forum.  I then restored a backup I had of the forum from the previous day.  Then, in the root of the forum directory, I did chmod -R 777 *, which of course changes every single file, directory, and subdirectory of the entire forum to 777 permissions.  Then I tried to again install the Users Online Today mod.

Again the forum said that it was downloaded properly, and passed all tests.  Applying the mod resulted in the same message as before, stating that it was installed successfully and could now be used.  Lo and behold, the "Users Online Today" section was there on the board index!  I tested uninstalling the mod, and this time it passed all tests and uninstalled fine.

So clearly, 755 permissions for directories and 644 permissions for files, with the exceptions noted in the bulleted list above is not the truly correct permissons to run the forum at.

Also, I noticed that the package manager wants the FTP information so it can chmod the files it needs to.  I thought the root user only had permission to use chmod.

So maybe that is my problem instead... access to the chmod tool.

So is there some sort of definitive guide on how to set up my forum's file and directory permissions so that I don't run into these problems?  If it is truly a problem related to the "smf" user's access to chmod, then what do I need to do to provide that access?

scottws

I checked the error log, and I'm getting like a bazillion permissions denied errors on Sources/Subs-Package.php

Here are some examples of the errors:

Quote2: file_get_contents(/var/www/public_html/docs/forum/Packages/temp/./Users_Online_Today_Mod.xml) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory
File: /var/www/public_html/docs/forum/Sources/Packages.php
Line: 526

Quote2: fclose(): supplied argument is not a valid stream resource
File: /var/www/public_html/docs/forum/Sources/Subs-Package.php
Line: 1918

Quote2: fopen(/var/www/public_html/docs/forum/Themes/default/languages/Stats.english.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied
File: /var/www/public_html/docs/forum/Sources/Subs-Package.php
Line: 1911

Remember, based on what I said above, Sources/ is 755 and Subs-Package.php is 644.

sawz

not sure if this will help, but read this thread, personally i am
a folder is 755 and php is 644 and configs are 600 kinda guy. :)

http://www.simplemachines.org/community/index.php?topic=2987.0
keep smiling, they'll always wonder what your up too.....

winrules

also, are you using a custom theme, because if you are you will have to manually install the mod.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


scottws

Well, I have about 10 themes installed, but I personally use the default Core theme.

Advertisement: