A lot of people have problems with different PHP softwares like Joomla, different Gallery softwares, especially where need to upload pictures. Why? Because now in a new settings, PHP will work as apache:apache user and any files uploaded via a web interface will get this user rights. Any files uploaded via FTP clients, will get the domain ownership. SO, if you for example want to get all picture files added via WEB INTERFACE, you cannot download or overwrite via FTP because the file rights. Also on install a lot of people need to setup folders to 777 rights to uload in it.
So seems the mod_suPHP solution is nice and working with the following settings.
shell: yum install mod_suphp
(alternate
http://dag.wieers.com/rpm/packages/mod_suphp/)
After this, /etc/httpd/conf.d/mod_suphp.conf (imporatnt this line LoadModule suphp_module modules/mod_suphp.so, rest can be uncommented); /etc/suphp.conf (use default, except ; Security options allow_file_group_writeable=false allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false; )
If is PHP5, change in /etc/suphp.conf
[handlers]
;Handler for php-scripts
php5-script=php:/usr/bin/php-cgi
In some case, suphp.conf in /etc/httpd/conf.d will not work, so
shell: mv /etc/httpd/conf.d/suphp.conf /etc/httpd/conf.d/mod_suphp.conf
If you compiled suphp with setid-mode "force" or "paranoid", you can specify the user- and groupname to run PHP-scripts with.
Example: suPHP_UserGroup ftpuser psacln
The major things come with: httpd.include of each domain need to add, before < /VirtualHost >, the line Include /var/www/vhosts/fieldstonealliance.com/conf/vhost.conf
Then create vhost.conf. (We suggest to use for this Power Toys, this will suggest exacctly what you need to do and modify the file for you)
In vhost.conf you need:
< IfModule mod_suphp.c >
< Directory "/var/www/vhosts/DOMAIN/httpdocs/" >
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/var/www/vhosts/DOMAIN/httpdocs/"
AddHandler x-httpd-php .php
AddHandler php5-script .php
AddHandler x-httpd-php .php .php5 .php4 .php3 .phtml
suPHP_AddHandler x-httpd-php
suPHP_AddHandler php5-script .php
suPHP_UserGroup ftpuser psacln
php_value open_basedir "/tmp/"
php_value upload_tmp_dir "/var/www/vhosts/DOMAIN/tmp/"
< Files php.ini >
order allow,deny
deny from all
< /Files >
< /Directory >
< /IfModule >Need to focus on BOLD issues. DOMAIN is your domain, AddHandler one line is for PHP4, the other for PHP5, dunno if will work both together. Create in httpdocs/tmp directory, to write in it, as temporary upload dir. We still study this to move one directory up, but is not tested yet: DOMAIN/tmp/. After this, you need to add a php.ini file in your httpdocs directory, which will be use for that domain. this file cannot be read from outside because is restricted. To test if is work, create a file wit lines, < ?php phpinfo(); ? > and call it from web. You can see if is loaded new PHP.INI or not and mod_suPHP is on.