suphp owner + apache problem

tim874536

Verified User
Joined
Nov 24, 2006
Messages
73
My Config:
Apache: 2.2.14
Dovecot: 1.2.6
AWstats: no
exim.conf update: yes
MySQL: no
MySQL backup: yes
PHP: 5.2.11 as CLI and 4.4.9 as CGI (default: PHP 5.2.11) with mail() header patch
phpMyAdmin: 3.2.2.1-all-languages
ProFTPD: 1.3.2b
Atmail webmail: no
RoundCube webmail: 0.3
SquirrelMail: 1.4.19
UebiMiau: 3.11
Zend Optimizer: 3.3.3

I have installed the suphp with
./build suphp with setting
"--with-apache-user=apache --with-setid-mode=paranoid"

After all installed, I tested whether the suphp is working.
However, it seem not working.

Test with 1.php:
<?php
system("id")
?>
ls -lh /home/user1/public_html/test/1.php
-rw-r--r-- 1 user1 user1 22 Oct 27 16:56 /home/user1/public_html/test/1.php

and got:
uid=48(apache) gid=48(apache) groups=48(apache)
Which means not running with the username - user1


http.conf of user1
<VirtualHost 123.234.123.234:80>
ServerName www.test.userdomain.com
ServerAlias www.test.userdomain.com test.userdomain.com
ServerAdmin [email protected]
DocumentRoot /home/user1/domains/userdomain.com/public_html/test
ScriptAlias /cgi-bin/ /home/user1/domains/userdomain.com/public_html/test/cgi-bin/
UseCanonicalName OFF
SuexecUserGroup user1 user1
CustomLog /var/log/httpd/domains/userdomain.com.test.bytes bytes
CustomLog /var/log/httpd/domains/userdomain.com.test.log combined
ErrorLog /var/log/httpd/domains/userdomain.com.test.error.log
<Directory /home/user1/domains/userdomain.com/public_html/test>
Options +Includes -Indexes

php_admin_flag engine ON
<IfModule !mod_php6.c>
php_admin_flag safe_mode OFF
</IfModule>
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
php_admin_value open_basedir /home/user1/:/tmp:/var/tmp:/usr/local/lib/php/
suPHP_Engine ON
suPHP_UserGroup user1 user1

</Directory>
</VirtualHost>

May i know what is the problem of my situation??


P.S. what I want to do is that to prevent some folder being set to 777 in order to allow some php program to work and write cache into some folder like "forumdata/cache, cache/"

Thank You.
Tim Leung
 
Are you sure test/1.php was executed using PHP4 (which in your situation is installed as CGI-suPHP) and not PHP5 (default)?
 
after you said that, i futher include
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php4 .php
</FilesMatch>
and rebuild php with ./build php n

It works with php4(cgi) w/ suphp and output:
uid=509(user1) gid=509(user1) groups=509(user1)

However, is that suphp can only be work on cgi mode which means the php4 in my current situation?
How I can using suphp in default w/ php5, zend..... etc.??


Thank you for your first reply.

Tim leung


old reply: (delete)
into test/.htaccess

and both 1.php and other script don't work..
what is the problem?
In addition:
i just test the 1.php without .htaccess, it is running in php5.
 
Last edited:
Code:
./build set php5_cli no
./build set php5_cgi yes
./build php n
 
Code:
./build set php5_cli no
./build set php5_cgi yes
./build php n
Which means I should set to???:

./build set php5_cli no
./build set php5_cgi yes
./build set php4_cli no
./build set php4_cgi no
./build php n
In order to only install php5 in my system (php4 is not needed for my situation)


P.S. As i remember, DA need at least one php version run @ cli mode, is that still true?
 
Your command set is correct. No, it's not true. DA just needs to have a CLI binary in /usr/local/bin (CustomBuild doesn't remove it).
 
Your command set is correct. No, it's not true. DA just needs to have a CLI binary in /usr/local/bin (CustomBuild doesn't remove it).

OH, that "CLI binary" confuse me to install both cli and cgi to serve DA and my client.....

Then, after i applied the command i said in the last post, should i need to run

./build suphp

afterward?

and do i need to set anything also to make use of suphp (solve the 777 permission problem/bug)
 
Back
Top