Permission problem.

xciso

Verified User
Joined
Mar 7, 2008
Messages
11
Hi.
I have problems with file permission (chmod)
I run a OsCommerce store and i must have chmod 777 to get images and backup catalogs working.

I want to have this max 755.
If i set the catlogs to 755 or lower, i get a message like i dont have permission.

I have search and many says that this is beacuse people have php as CGI, but when i look in my custombuild i have php as CLI

My options in custombuild look like this:
Code:
Apache: 2.2.17
Dovecot: 1.2.16
AWstats: no
exim.conf update: no
SpamAssassin: no
MySQL: 5.1.54
MySQL backup: yes
PHP: 5.2.17 as CLI with mail() header patch
phpMyAdmin: 3.3.9-all-languages
ProFTPD: 1.3.3d
Pure-FTPd: no
Atmail webmail: no
RoundCube webmail: 0.4.2
Auto updates/notifications: no
Run "clean" every time: yes
Run "clean_old_webapps" every time: yes
Run "clean_old_tarballs" every time: no
Show texts in bold: yes
SquirrelMail: 1.4.21
UebiMiau: no
Zend Optimizer: no

What can i do? Thanks!
 
To switch to using suPHP (PHP-CGI) run this

Code:
cd /usr/local/directadmin/custombuild
./build update && ./build clean
./build set php5_cli no
./build set php5_cgi yes
./build php n

To use mod_ruid2, read a how-to for the module on this forum.
 
Yes, this will make PHP scripts to run not from Apache user (who need 777 to write), but from user (account owner).

If your PHP scripts are running from name of account owner, that's will be enough even 700 for directory to allow user's PHP scripts to write there, and 711 to allow others (apache) to read files from there.
 
To switch to using suPHP (PHP-CGI) run this

Code:
cd /usr/local/directadmin/custombuild
./build update && ./build clean
./build set php5_cli no
./build set php5_cgi yes
./build php n

To use mod_ruid2, read a how-to for the module on this forum.

What is mod_ruid2? Is it that I install if i do that u post above?
Or do u mean i should first install like it above, and then search about mod_ruid2?

I know im stupid.. but everybody has been newbie ;)
 
Hello,
I'd like to know what is the difference between CGI and apache Module Mode??
CGI stands for Common Gateway Interface (wikipedia.org); it's a method you can use to run PHP.

Or you can run PHP as an apache module.

If you run PHP as an apache module, it runs as user apache; since all sites would then have the same rights/permissions on PHP, this is now considered insecure.

When you run PHP as CGI, it's much more secure because each user runs his own PHP code as his own username. However this uses a lot more machine resources.

A better solution is the fairly new mod_ruid2, which allow apache to run php, but as the individual site username.

Jeff
 
try to do it from the WHM

Main //Service Configuration // Apache Configuration //PHP and SuExec Configuration

Note that for using the suphp the files permission must be 644 and the folder permission must be 755.
 
Did you just say WHM? I think you are mistaken on what website you are on.
 
Back
Top