• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Suexec Problem

G

Greenhorn2013

Guest
Since Update from Plesk 8.2 to 8.3 all virtual host runs on www-data and not under suexec.
Need support

Server: Debian
 
not if you have mod_suphp :). We run now on all servers mod_suphp, see my HOW TO about this.
 
Well, then his configuration's been overwritten ;)

Where's this how to anyway? suphp always sucks for me.
 
his how to is as follows

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.
 
I am having the same situation, have followed the instructions from lvalics, but have had the following problems:

1) After creating the vhost.conf file as shown in the instructions I would receive the following error when restarting Apache: "Syntax error on line 11 of /var/www/vhosts/domainname.com/conf/vhost.conf", "Invalid command 'suPHP_UserGroup'".

(FIX) If I "comment" out the suPHP_UserGroup ftpuser psacln line it works just fine. However, isn't the whole point of using suPHP to allow you to choose which username you want PHP scripts run as? I read the part about "if you compiled suPHP with setid-mode "force" or "paranoid" you can specify the user and groupname" - but the instructions tell you to use YUM to install an already compiled mod_suphp package. How would you "go back" and recompile using the "force" or "paranoid" switch?

2) Once if made the above fix and suPHP was "apparently" installed and working correctly I tried to upload a new Joomla template. I received the following error message: "Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 82 bytes) in /var/www/vhosts/httpdocs/includes/domit/xml_domit_lite_parser.php on line 913".

(FIX) After Googling the error I was led to upping the allocated memory by adding "memory_limit = 12M" to my php.ini file. However, I tried to upload the exact same template on another vhost that is NOT using the suPHP fix and it uploaded just fine. Any thoughts?
 
1. Is not necessary to use Force Paranoid mode, there you can specify username and group, other then regular user if you like. If not specified (not compiled into module for example) then will use regular FTP user and group psacln, which is fine for PLESK envir.

2. Seems that some things in mod_suphp must be in own php.ini as well. This one is memory_limit, wich we will add into our next release. So if you add to your own php.ini will be ok, the domains which are not use mod_suphp will use /etc/php.ini by default.
 
Thanks for the followup! Can you explain to my why this happens with Plesk and not with other products like CPanel?
 
I installed libapache2-mod-suphp under Debian 3.1

Problem:
suphp using php4 instead of php5.

There is no suphp.conf, so how could I say suphp to use php5.

suphp Version is 0.5.x

Do you have a Debian 3.1 package for suphp 0.6.x?
 
Want suphp enabled for every domain

Hello. I am setting up a new server, and I want suphp enabled for each domain, without having to setup a new vhost.conf for each new domain. Any ideas?
 
Try the search function in the forums, it works wonders for trying to find things.....
 
Back
Top