Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 31st March 2007, 12:59
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default suPHP file permission

I follow the "How To Set Up suPHP On A Debian Based ISPConfig Server" to setup the suPHP.
Yes, I can install the suPHP but when I upload a photo to my website. The php scripts will create a folder with access right 600 only and the upload photo also is 600 only. So that I can't see the photo on my browser.

I have already set the suphp.conf to :
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false

What's wrong with my suPHP, How can I fix this problem? In fact, I want to suPHP to chmod 755 or 644 to the created folder and files.
Reply With Quote
Sponsored Links
  #2  
Old 31st March 2007, 13:23
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,736
Thanks: 840
Thanked 5,597 Times in 4,408 Posts
Default

Quote:
The php scripts will create a folder with access right 600 only and the upload photo also is 600 only. So that I can't see the photo on my browser.
This depends onyl on your PHP script and not on SuPHP, use the chmod function in PHP to change the mode to suit your needs.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 31st March 2007, 15:43
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till
This depends onyl on your PHP script and not on SuPHP, use the chmod function in PHP to change the mode to suit your needs.
Hi Till,

I have looked all over the php scripts, this is not related to the php script, because the script is already used 755 to set the permission.
Any other suggestion to fix this problem?
Thank you!
Reply With Quote
  #4  
Old 31st March 2007, 16:07
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Besides, I find the if the script chmod(filesorpath, 755), the output permission will be 0700.
If the script use imagejpeg(), the permission of the output file will be 0600.
Which configuration file should I modify it to fix this problem.
The created folder or file owner is web1_user1:web1

Thanks!
Reply With Quote
  #5  
Old 1st April 2007, 13:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,736
Thanks: 840
Thanked 5,597 Times in 4,408 Posts
Default

Quote:
chmod(filesorpath, 755)
In the php chmod command, you should always use chmod(filesorpath, 0755) and not chmod(filesorpath, 755), if the 0 is missing, the command might fail or set wrong permissions.

Quote:
Which configuration file should I modify it to fix this problem.
I think there are only 2 possible files. The suphp.ini and the php.ini file where such a config value might be set.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 1st April 2007, 14:15
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes! I just ignore the '0' here. But inside the scripts, it use 0755.
I have tried install a fresh Ubuntu again. I just put the a test script inside it,
which is as the following (test.php)
<?php
chmod("test1.php", 0755);
mkdir("test", 0755);
?>

I find that the first command is working properly which can change the permission of test1.php to 0755.
But the second one can only created a folder with 0700 only.

I have checked the suphp.ini and php.ini and can't find any hits to change permission.

Any idea where can I fix it?
Thank you!
Reply With Quote
  #7  
Old 1st April 2007, 15:25
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,736
Thanks: 840
Thanked 5,597 Times in 4,408 Posts
Default

Have you tried something like this too?

mkdir("test");
chmod("test", 0755);
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 1st April 2007, 15:37
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till
Have you tried something like this too?

mkdir("test");
chmod("test", 0755);

NO! Because the scripts also use imagejpeg() to create images. The created images also with permission 0600. Then I can't read the images on the browser too. I don't want to modify anything in the scripts because there are quite many place in the scripts use the imagejpeg, mkdir, function.
In the past, I use a server without any website control panel, there is not problem for the permission issues.
Reply With Quote
  #9  
Old 1st April 2007, 15:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,736
Thanks: 840
Thanked 5,597 Times in 4,408 Posts
Default

Quote:
In the past, I use a server without any website control panel, there is not problem for the permission issues.
But this has nothing to do with the fact of using a website controlpanel or not. ISPConfig creates just a apache config file for you, nothing more.

Have you used suphp with your manual configuration too?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #10  
Old 1st April 2007, 16:24
catalyst catalyst is offline
Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by till
But this has nothing to do with the fact of using a website controlpanel or not. ISPConfig creates just a apache config file for you, nothing more.
OK! In fact, ISPConfig is a great tools. But how can we fix the permission problem? But I use a server without any control panel, the scripts can set the permission correctly with the default "apache" user.
Can ISPConfig integrate with suPHP with an option for us to select it when we are installing ISPConfig.
I don't know how to fix the existing permission problem with suPHP.
Besides, I don't know whether I have setup it correctly or not. But I follow the perfect installation of linux in this website and the latest suPHP document here.

Have you used suphp with your manual configuration too?
I didn't modify any configuration which is generated by suphp.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 04:40
Dspam planet_fox General 6 20th January 2007 19:42
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 18:17
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 06:19
jamed up my table borders?? Boon-Dog-Danny Installation/Configuration 5 23rd September 2006 17:12


All times are GMT +2. The time now is 02:33.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.