<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>"Technically" Advanced &#187; CentOS</title>
	<atom:link href="http://www.lecaptain.org/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lecaptain.org</link>
	<description>Random thoughts, words, deeds, and sometimes, even something technical!</description>
	<lastBuildDate>Tue, 06 Jan 2009 03:22:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>suPHP on Plesk with CentOS 5.1</title>
		<link>http://www.lecaptain.org/tech/suphp-on-plesk-with-centos-51/</link>
		<comments>http://www.lecaptain.org/tech/suphp-on-plesk-with-centos-51/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 21:31:13 +0000</pubDate>
		<dc:creator>Curt</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[suPHP]]></category>

		<guid isPermaLink="false">http://www.lecaptain.org/?p=14</guid>
		<description><![CDATA[Since SuSE Enterprise does cost money, I&#8217;ve decided to also write this for a CentOS 5.1 install of Plesk.
Prerequisites:

PHP/LAMP Server installed by Plesk/Apache
PHP FastCGI Component
apr-1-util Component
httpd-devel Component
Development Tools (gcc/flex/bison)
suPHP 0.63
Plesk8.4

Procedure:

After all prerequisites are installed, download the suPHP 0.6.3 source to the directory of your choosing. For the purposes of this document, we&#8217;re using /usr/local/src
Untar the [...]]]></description>
			<content:encoded><![CDATA[<p>Since SuSE Enterprise does cost money, I&#8217;ve decided to also write this for a CentOS 5.1 install of Plesk.</p>
<p><strong>Prerequisites</strong>:</p>
<ul>
<li>PHP/LAMP Server installed by Plesk/Apache</li>
<li>PHP FastCGI Component</li>
<li>apr-1-util Component</li>
<li>httpd-devel Component</li>
<li>Development Tools (gcc/flex/bison)</li>
<li>suPHP 0.63</li>
<li>Plesk8.4</li>
</ul>
<p><strong>Procedure:</strong></p>
<ol>
<li>After all prerequisites are installed, download the suPHP 0.6.3 source to the directory of your choosing. For the purposes of this document, we&#8217;re using /usr/local/src</li>
<li>Untar the suPHP application, it should install into a directory named  suphp-0.6.3</li>
<li>Run configure with the following options (or, change for your preferred environment:)</li>
<p><em>./configure &#8211;with-apxs=/usr/sbin/apxs &#8211;with-php=/usr/bin/php-cgi &#8211;with-logfile=/var/log/suphp.log &#8211;with-min-uid=30 &#8211;with-min-gid=30 &#8211;with-apache-user=apache &#8211;with-apr=/usr/bin/apr-1-config &#8211;with-setid-mode=owner &#8211;prefix=/usr &#8211;sysconfdir=/etc</em></p>
<li>After configure succeeds, run the usual make:</li>
<p><em>make</em></p>
<li>All should go well with your make.  If so, then run make install:</li>
<p><em>make install</em></p>
<li>We&#8217;re not done yet. We&#8217;ve created mod_suphp.so, which is now located in /usr/lib/httpd/modules, but need to create a new file in /etc/httpd/conf.d/ called &#8220;suphp.conf&#8221;.  It should look like this:</li>
<p><em>LoadModule suphp_module modules/mod_suphp.so</em></p>
<p><em>&lt;Directory /var/www/vhosts&gt;<br />
php_admin_value engine off<br />
suPHP_Engine On<br />
AddHandler x-httpd-php .php .php3 .php4 .php5<br />
suPHP_AddHandler x-httpd-php<br />
&lt;/Directory&gt;</em></p>
<li>Now that we&#8217;ve added this file, we need to restart apache:</li>
<p><em>service httpd restart</em></p>
<li>We&#8217;re nearly finished. Now we need to create our configuration for suPHP. Create a file in /etc named &#8220;suphp.conf&#8221;. Add in the following lines to configure it:</li>
<p><em>[global]<br />
logfile=/var/log/suphp.log<br />
loglevel=info<br />
webserver_user=apache<br />
docroot=/var/www/vhosts<br />
allow_file_group_writeable=false<br />
allow_file_others_writeable=false<br />
allow_directory_group_writeable=false<br />
allow_directory_others_writeable=false<br />
check_vhost_docroot=false<br />
errors_to_browser=false<br />
env_path=/bin:/usr/bin<br />
umask=0022<br />
min_uid=30<br />
min_gid=30</em></p>
<p><em>[handlers]<br />
x-httpd-php=php:/usr/bin/php-cgi<br />
x-suphp-cgi=execute:!self</em></p>
<li>You need to edit /etc/httpd/conf/httpd.conf and either remove the following two lines, or comment them out:<br />
<em>AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</em></li>
<li>Restart apache one more time.</li>
<p><em>service httpd restart</em></ol>
<p>Voila! If you add a file into a directory, say named info.php that had permissions above 0644 &#8211; the execution should fail. Directories are required to be 755, files can be no more than 644. This is especially useful for things like Joomla that have their own installers that use incorrect permissions due to PHP running as the user that runs apache. There is only one file that CentOS uses for PHP configuration, which is /etc/php.ini</p>
<p>A great way to test this is by trying software like Joomla &#8211; files will execute as you&#8217;d expect them to, as the user in question. There may be some issues due to things like not supporting PHP-FastCGI support, but most files won&#8217;t notice the difference. Also, make sure you rotate that suphp.log file, as it will grow in info mode, as it logs each file execution.<span id="more-14"></span><!--more--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecaptain.org/tech/suphp-on-plesk-with-centos-51/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

