<?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>SupportSages &#187; suPHP</title>
	<atom:link href="http://www.supportsages.com/blog/tag/suphp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Cast Control installation on a suPHP installed server fails</title>
		<link>http://www.supportsages.com/blog/2009/05/cast-control-installation-on-a-suphp-installed-server-fails/</link>
		<comments>http://www.supportsages.com/blog/2009/05/cast-control-installation-on-a-suphp-installed-server-fails/#comments</comments>
		<pubDate>Thu, 21 May 2009 13:27:18 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[cast control]]></category>
		<category><![CDATA[shoutcast hosting]]></category>
		<category><![CDATA[suPHP]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=380</guid>
		<description><![CDATA[Shoutcast hosting is one of the niche market for the hosting industry. But sometimes, issues like this creep in. So here is the solution for the issue. Even if you are offering unmanaged VPS web hosting, clients may not be able to easily solve this themselves. Please help them :)

Make sure that the files inside the <a href="http://www.cast-control.net">CastControl</a> folder,  files/1-9-8-linux-glibc6/sc_serv and files/1-9-8-linux-glibc6/sc_trans should have permissions 777 even if your server is running under suPHP. If installation fails after setting it to 777, with an error message as below,

<blockquote>There was a problem with the tested shoutcast server
While the SHOUTcast server ...]]></description>
			<content:encoded><![CDATA[<p>Shoutcast hosting is one of the niche market for the hosting industry. But sometimes, issues like this creep in. So here is the solution for the issue. Even if you are offering unmanaged VPS web hosting, clients may not be able to easily solve this themselves. Please help them <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Make sure that the files inside the <a  href="http://www.cast-control.net">CastControl</a> folder,  files/1-9-8-linux-glibc6/sc_serv and files/1-9-8-linux-glibc6/sc_trans should have permissions 777 even if your server is running under suPHP. If installation fails after setting it to 777, with an error message as below,</p>
<blockquote><p>There was a problem with the tested shoutcast server<br />
While the SHOUTcast server seems to have started, it was terminated unexpectantly</p>
<p>Click here to view the shoutcast log</p></blockquote>
<p>It&#8217;s time to check the apache error logs. Because shoutcast logs are empty or even the logs folder inside cast control. And the apache error log has tons of errors like below,</p>
<blockquote><p>[Thu May 21 03:11:37 2009] [error] [client xxx.xxx.xxx.xxx] sh: whoami: command not found, referer: http://www.shoutcastsage.net/shoutcast/install/install.php<br />
[Thu May 21 03:11:40 2009] [error] [client xxx.xxx.xxx.xxx] sh: whoami: command not found, referer: http://www.shoutcastsage.net/shoutcast/install/install.php<br />
[Thu May 21 03:11:40 2009] [error] [client xxx.xxx.xxx.xxx] Warning: bad syntax, perhaps a bogus &#8216;-&#8217;? See /usr/share/doc/procps-3.2.7/FAQ, referer: http://www.shoutcastsage.net/shoutcast/install/install.php<br />
[Thu May 21 03:11:40 2009] [error] [client xxx.xxx.xxx.xxx] sh: pgrep: command not found, referer: http://www.shoutcastsage.net/shoutcast/install/install.php<br />
[Thu May 21 03:11:40 2009] [error] [client xxx.xxx.xxx.xxx] ../temp/installation.conf.sh: line 3: nohup: command not found, referer: http://www.shoutcastsage.net/shoutcast/install/install.php
</p></blockquote>
<p>But pgrep and whoami are there in the server. What to do next ?</p>
<p>Time to edit suphp.conf. The culprit is the env_path setting in the conf file. </p>
<p>Current setting would be env_path=/bin:/usr/bin . Add double quotes there for the path setting and restart apache, like below</p>
<p><code>;PATH environment variable<br />
env_path="/bin:/usr/bin"</code></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Cast+Control+installation+on+a+suPHP+installed+server+fails+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F380" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Cast+Control+installation+on+a+suPHP+installed+server+fails+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F380" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/cast-control-installation-on-a-suphp-installed-server-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why are you getting 500 internal server error on your php pages</title>
		<link>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/</link>
		<comments>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:39:23 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[500 ISE]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[suPHP]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=85</guid>
		<description><![CDATA[Usually this happens in a suPHP environment. There could be few reasons why this could happen. We list here a few. The solution is intended for those with shell access.
<ul>
	<li><strong>Ownership issues</strong>
In a suPHP environment, depending on the mode of suPHP enabled on the VPS or server, there is a min_uid setting, which is configurable in suPHP.conf under /etc or /usr/local/etc or /opt/suphp/etc . By default the setting is 100, which means if the file is owned by a UID less than that value (100), it shouldn't parse the php code and will result in 500 Internal Server Error. In a ...]]></description>
			<content:encoded><![CDATA[<p>Usually this happens in a suPHP environment. There could be few reasons why this could happen. We list here a few. The solution is intended for those with shell access.</p>
<ul>
<li><strong>Ownership issues</strong><br />
In a suPHP environment, depending on the mode of suPHP enabled on the VPS or server, there is a min_uid setting, which is configurable in suPHP.conf under /etc or /usr/local/etc or /opt/suphp/etc . By default the setting is 100, which means if the file is owned by a UID less than that value (100), it shouldn&#8217;t parse the php code and will result in 500 Internal Server Error. In a cPanel server, the error will be shown @ /usr/local/apache/logs/suphp.log. This restriction would enable better security, since even if a php can do some privilege escalation, it wont affect the server. Solution would be</p>
<blockquote><p>chown your_username.your_username path_of_your_php_file</p></blockquote>
<p>If that fixes only that file and not your entire php files, use the below command to change all the php files.</p>
<blockquote><p>find . -type f -name &#8220;*.php&#8221; -exec chown username.username {} \;<br />
find . -type d -exec chown username.username {} \;</p></blockquote>
<p>Ignore &#8220;*.php&#8221; in the above command if it still errors out for a php file. If it still don&#8217;t fix, move on to other solutions below.</li>
<li><strong>Permission issues</strong><br />
It could be the world writable directories or files which is causing the issue. In a non-suphp environment, if a php script has to upload a file on a folder, (eg:  php based gallery script where customers are able to upload photos) inorder to get it uploaded to the folder, it needs to have world writable permissions. Or else apache can&#8217;t write to the folder. Here in suPHP, since the php is executed as the user itself who already have the permissions you don&#8217;t need to change it to 777 permissions and is happy with 755 (rwxr-xr-x) permissions. When a customer is moved from a non suPHP env to suPHP enabled server, we need to adjust the permissions then. Often a command like below should help</p>
<blockquote><p>find . -name &#8220;*.php&#8221; -type f -exec chmod 644 {} \;<br />
find . -type d -exec chmod 755 {} \;</p></blockquote>
<p>Often, you can do the above command without the -name &#8220;*.php&#8221; in the command.</li>
<li><strong>suphp.log exceeds 2GB size.</strong>If the entire servers&#8217; php application gives you internal server error, next chance is that the suPHP log has exceeded 2GB space. Just clear the file and you are on track again. To null it, execute the command below. Below command assumes you are having the issue in a cPanel server<br />
<blockquote><p>cat /dev/null &gt; /usr/local/apache/logs/error_log</p></blockquote>
</li>
<li><strong>suPHP log don&#8217;t exist </strong><br />
In a Plesk or Webmin or other servers, often the suPHP will be installed but /var/log/httpd or such folders where the suPHP.log can be created wont exist. suphp can understand and create a non-existent suphp.log, but you would need to manually create the folder /var/log/httpd. I hope you know how to create a folder though.</li>
<p>If you know any other cases which require another solution for this, please comment here or edit the blog.</ul>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Why+are+you+getting+500+internal+server+error+on+your+php+pages+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F85" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Why+are+you+getting+500+internal+server+error+on+your+php+pages+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F85" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

