View Full Version : Safe mode host problem
February 3rd, 2005, 11:22 PM
First off I would like to say that Im extremly content with both products and services at vBulletin and vBadvanced. My prob however is that my reluctant host (surftown.se) has PHP safe_mode switched ON, which renders my vBgallery non-functioning. (At least that seems to be the general opinion as Im writing this)
My question is if anyone has got vBgallery to function with safe_mode switched ON?
February 4th, 2005, 05:41 AM
February 4th, 2005, 07:06 AM
The only way to get around safemode at current time would be to store images in the database, and it would greatly limit vB Gallerys features and could pose a rather big server issues for anyones database who grows beyond a few megs.
February 5th, 2005, 03:12 AM
Thankyou oldengine> Ive looked into your thread, but I dont understand what to change and where to do that? Sure it has to do with the properties of files and folders, and with user and/or script priviligies, but I cant seem to compile that into my brain. :confused:
In addition I have recieved information from my host about a workaround, here goes the translation:
"There is a solution on the safe mode issue that deals with the creation of files and folders through script (I assume thats your problem?) The solution is safe_mode_gid, which we HAVE implemented at Surftown.
With the safe_mode_gid setting the group have access to files created by script (which has owner Root/httpd), which is normally not possible under safe mode. What creates the problem is that if you change read and write permissions on a folder/script through a regular ftp program, then the file/folder loses its g+s setting, which makes a user that differs from root not being able to access to folder/file, even if the user is part of the group.
So when you check the permissions on a file or folder through normal chmod (eg chmod 777) then you have to make sure that the symbolic rights (unix/linux user symbolic rights) g+s remains."
February 5th, 2005, 03:17 AM
What I dont understand with the above is
1) how to change the symbolic rights, and
2) how to make sure the values stay the way they need to be (apparently g+s) for everyone using my vBgallery.
February 5th, 2005, 10:49 AM
Your host is onto a different workaround than I used. I compiled apache in phpsuexec for two reasons:
1) All my vBulletin system email goes out under the username rather than nobody. This helps prevent email from being bounced as junk, since email coming from a nobody script user has long been associated with bulk mail.
2) All php scripts are executed as cgi and run under the username instead of nobody. Therefore, all directories and files written by the script are created and written under the username.
For example: /home/username/public_html/gallery/files is a chmod 755 directory owned by username. All photo files are chmod 644 and owned by the username. It works absolutely fine!
These above facts are true whether "safe mode" is on or off and I find that phpsuexec is a secure way to operate a server. Vbulletin has taken the easy path by telling users to chmod 777 their directories and to not use safe mode.
The vBulletin detriments to this are running attachments as files and the lack of an archive setup. However, once past the conversion of attachments from the database to files, there is no reason not to chmod the directories to 755 and the files to 644. It is a "forced" issue. As to the archive, Google and Msn has now indexed my entire board, without the archive deal.
I come from the old school where a chmod 777 directory in web space is to be avoided and it can be done. In that earlier thread, Brian gave me the script locations to change 777 to 755 and 644.
Your mileage may vary.
February 5th, 2005, 12:27 PM
running php as cgi is more resource intensive, and using phpsuexe has caused quite a few problems.
Theres no realistic reason to run in safemode.
February 8th, 2005, 02:00 AM
Thanks for replying. I guess Ill try to upload to the database manually as u said Zachery, yes it will hinder the functionality for my members, but at least there will be something there. Thanks!
February 8th, 2005, 08:25 AM
I wish I could get specific information on exactly what is being hindered by running PhpSuexec. I find comments about this only on vBulletin sites.
I have turned safe mode off because I am the only user on the server, but I didn't see any change there either. Stylesheets are now stored as files, but that could be done with PhpSuesec anyway with the files written under the username.
I have been running vBaGallery since its release with the data directory at chmod 755 and the photo files at chmod 644.
@chmod($dir . '/' . $file, 0755);
chown myusername:myusername gallery
chown myusername:myusername files
This is also true of every other file and sub-directory including the .php files.
February 20th, 2005, 05:55 PM
Just wanted to let you know that Brian (through a ticket) made it possible for me to run a vBgallery with safe mode=on. How? havent got a clue but it works. :-) Great support here at vBadvanced!
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.