{"id":488,"date":"2010-01-24T06:37:58","date_gmt":"2010-01-24T10:37:58","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=488"},"modified":"2013-03-20T08:42:24","modified_gmt":"2013-03-20T12:42:24","slug":"how-to-install-suphpphpsuexec-on-plesk","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-install-suphpphpsuexec-on-plesk","title":{"rendered":"How to install SuPHP\/phpSuExec on Plesk?"},"content":{"rendered":"<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong>How to install SuPHP\/phpSuExec on a Plesk server?<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>SuPHP Or PHPSuExec is a module that increases the security of the server and executes PHP files under the ownership of the owner of the file instead of the Apache user i.e. &#8220;apache&#8221;.<\/p>\n<p><strong>The advantages of having suPHP are:<\/strong><\/p>\n<p><span style=\"color: #0000ff;\"><strong>1.<\/strong><\/span> Files and Directories those need 777 permissions to write into, via the browser will now need a maximum of 755 permissions. The files\/directories with 777 permissions will result in an &#8220;Internal Server Error&#8221;.<\/p>\n<p><strong><span style=\"color: #0000ff;\">2<\/span>.<\/strong> If you need to manipulate the value of a php directive for a domain, for ex. register_globals, it needs to be placed in the php.ini of a domain instead of the .htaccess file as it will result in an &#8220;Internal Server Error&#8221;.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>3.<\/strong><\/span> All the files and directories uploaded using a script will have the ownership of the user instead of user &#8216;apache&#8217; (i.e. the Apache user).<\/p>\n<p><span style=\"color: #0000ff;\"><strong>4.<\/strong><\/span> A user can edit\/remove the files using Ftp that are uploaded via the browser.<\/p>\n<p>In order to install SuPHP on the server, download and install the atomic script<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong># wget -q -O - http:\/\/www.atomicorp.com\/installers\/atomic | sh<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>Once the script is installed, install SuPHP module using yum<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong># yum install mod_suphp<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>The next step is to load the SuPHP module with Apache. The suphp installation automatically creates a &#8220;suphp.conf&#8221; file under the Apache configuration directory, if not create it.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong># vi \/etc\/httpd\/conf.d\/suphp.conf<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>and insert the following lines:<\/p>\n<blockquote>\n<pre dir=\"ltr\"><span style=\"color: #0000ff;\">#Load the Mod_SuPHP module\r\n<\/span><span style=\"color: #0000ff;\"><strong>LoadModule suphp_module modules\/mod_suphp.so\r\n<\/strong><strong>php_admin_value engine off<\/strong><\/span><strong><strong><strong><strong>\r\n<\/strong><\/strong><\/strong><\/strong><\/pre>\n<pre><span style=\"color: #0000ff;\"># Enable handlers\r\n<strong>suPHP_AddHandler x-httpd-php\r\n<\/strong><\/span><span style=\"color: #0000ff;\"><strong>AddHandler x-httpd-php .php .php3 .php4 .php5<\/strong><\/span><\/pre>\n<pre><span style=\"color: #0000ff;\">#Enable the SuPHP engine\r\n<strong>suPHP_Engine on<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>Apache calls all the configuration files from the \/etc\/httpd\/conf.d directory by default so there is no need to include the module in the httpd.conf file separately.<\/p>\n<p>Now,\u00a0 configuration file under \/etc should be present (if not create it)<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong>vi \/etc\/suphp.conf<\/strong><\/span><\/pre>\n<\/blockquote>\n<p>copy\/paste the following contents as it is:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong>[global]\r\nlogfile=\/var\/log\/suphp.log\r\nloglevel=info\r\nwebserver_user=apache\r\ndocroot=\/var\/www\/vhosts\r\nallow_file_group_writeable=false\r\nallow_file_others_writeable=false\r\nallow_directory_group_writeable=false\r\nallow_directory_others_writeable=false\r\ncheck_vhost_docroot=false\r\nerrors_to_browser=false\r\nenv_path=\/bin:\/usr\/bin\r\numask=0022\r\nmin_uid=500\r\nmin_gid=500\r\n\r\n[handlers]\r\nx-httpd-php=\"php:\/usr\/bin\/php-cgi\"\r\nx-suphp-cgi=\"execute:!self\"<\/strong><\/span><\/pre>\n<\/blockquote>\n<blockquote><p><span style=\"color: #0000ff;\"><strong> <\/strong><\/span><\/p><\/blockquote>\n<p>Make sure the <strong>&#8220;handle_userdir&#8221;<\/strong> directive is commented or removed from the file since it is deprecated from the latest version.<\/p>\n<p>At the end, we have to restart the httpd service for all these changes to take effect<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong># service httpd restart<\/strong><\/span><\/pre>\n<\/blockquote>\n<p><strong>Test the SuPHP installation<\/strong>: Create a phpinfo.php file with 777 permission and it should show you an &#8220;Internal Server Error&#8221; on browsing.<\/p>\n<p><strong> <\/strong><\/p>\n<p><span style=\"color: #0000ff;\"><strong>Related Links:<\/strong><\/span><br \/>\n<a title=\"How to install\/enable SuPHP on a cPanel server?\" href=\"https:\/\/linuxhostingsupport.net\/blog\/how-to-install-and-enable-suphp-on-a-cpanel-server\" target=\"_blank\">How to install\/enable SuPHP on a cPanel server?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install SuPHP\/phpSuExec on a Plesk server?<\/p>\n<p>SuPHP Or PHPSuExec is a module that increases the security of the server and executes PHP files under the ownership of the owner of the file instead of the Apache user i.e. &#8220;apache&#8221;.<br \/>\nThe advantages of having suPHP are:<br \/>\n1. Files and Directories those need 777 permissions to write into, via the browser will now need a maximum of 755 permissions. The files\/directories with 777 permissions will result in an &#8220;Internal Server Error&#8221;.<br \/>\n2. If you need to manipulate the value of a php [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[669,666,664,667,663,976,977,665,670,668],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/488"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":17,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":2189,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/488\/revisions\/2189"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}