<?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>Ecommy - your ecommerce support for your online business &#187; Linux</title>
	<atom:link href="http://www.ecommy.com/c/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ecommy.com</link>
	<description>the path to your business success</description>
	<lastBuildDate>Fri, 16 Jul 2010 07:28:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Cpanel: change ssl port for apache</title>
		<link>http://www.ecommy.com/linux/cpanel-change-ssl-port-for-apache</link>
		<comments>http://www.ecommy.com/linux/cpanel-change-ssl-port-for-apache#comments</comments>
		<pubDate>Fri, 16 Jul 2010 07:28:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=546</guid>
		<description><![CDATA[The title it&#8217;s choosen to have cpanel word in it because changing ssl port from 443 to something else directly in http.conf will bring trouble when you create a new account for instance (cpanel rebuilds http.conf automatically) so keeping things short go to /var/cpanel and: sudo vi cpanel.config change apache_ssl_port=0.0.0.0:443 to apache_ssl_port=0.0.0.0:new_port then: sudo /usr/local/cpanel/whostmgr/bin/whostmgr2 [...]]]></description>
			<content:encoded><![CDATA[<p>The title it&#8217;s choosen to have cpanel word in it because changing ssl port from 443 to something else directly in http.conf will bring trouble when you create a new account for instance (cpanel rebuilds http.conf automatically)</p>
<p>so keeping things short go to /var/cpanel and:<br />
<code><br />
sudo vi cpanel.config<br />
</code><br />
change apache_ssl_port=0.0.0.0:443 to apache_ssl_port=0.0.0.0:new_port<br />
then:<br />
<code><br />
sudo /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/cpanel-change-ssl-port-for-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>protect server from high load</title>
		<link>http://www.ecommy.com/linux/protect-server-from-high-load</link>
		<comments>http://www.ecommy.com/linux/protect-server-from-high-load#comments</comments>
		<pubDate>Fri, 25 Jun 2010 10:37:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=536</guid>
		<description><![CDATA[Bellow is a bash script that will save you a lot of energy and headaches when your server gets a high load. For instance if some of your clients / websites is going in an infinite loop because of a php programming bug it&#8217;s not worth waiting until your server crashes, you can use the [...]]]></description>
			<content:encoded><![CDATA[<p>Bellow is a bash script that will save you a lot of energy and headaches when your server gets a high load.  For instance if some of your clients / websites is going in an infinite loop because of a php programming bug it&#8217;s not worth waiting until your server crashes, you can use the script bellow to restart apache and all the php-cgi processes. (I use fastcgi on my server) </p>
<p>#!/bin/bash<br />
 MAXLOAD=&#8221;5&#8243;<br />
 L05=&#8221;$(uptime | gawk -F&#8221;load average: &#8221; &#8216;{ print $2 }&#8217; | gawk -F&#8221;, &#8221; &#8216;{ print $1 }&#8217;)&#8221;<br />
 if [ $(echo "$L05 > $MAXLOAD"|bc) -eq 1 ]<br />
 then<br />
 unlink /tmp/message.txt<br />
 MESAJ=&#8221;/tmp/message.txt&#8221;<br />
 echo &#8220;I have restarted apache and all php-cgi processes&#8221; >> $MESAJ<br />
 /bin/mail -s &#8220;load mare $L05&#8243; &#8220;mail@mymailserver.com&#8221; < $MESAJ<br />
 kill -9 `ps -ef |grep php-cgi |grep -v grep | awk &#8216;{print $2}&#8217;`<br />
 /etc/init.d/httpd restart<br />
 fi</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/protect-server-from-high-load/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimize your hosting server</title>
		<link>http://www.ecommy.com/linux/optimize-your-hosting-server</link>
		<comments>http://www.ecommy.com/linux/optimize-your-hosting-server#comments</comments>
		<pubDate>Sat, 19 Dec 2009 11:16:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=499</guid>
		<description><![CDATA[A quick info of how you can optimize your hosting server if you are using a LAMP (Linux Apache Mysql PHP) environment. I am keeping the info for reference, I will also try to update it but please not that&#8217;s not a complete list. Please comment if you have any opinions 1. use php as [...]]]></description>
			<content:encoded><![CDATA[<p>A quick info of how you can optimize your hosting server if you are using a LAMP (Linux Apache Mysql PHP) environment.</p>
<p>I am keeping the info for reference, I will also try to update it but please not that&#8217;s not a complete list. Please comment if you have any opinions</p>
<p>1. use php as a fcgi module not as a dso module for apache<br />
2. compile apache with mpm (Multi-Processing Module) worker that is capable to serve a large number of requests with less system resources than a process-based server.<br />
3. use php eaccelerator it&#8217;s proven to be faster than apc and other cache systems<br />
tweak it based on http://eaccelerator.net/wiki/Settings</p>
<p>that&#8217;s basically it <img src='http://www.ecommy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>now some configuration parameters:<br />
1. don&#8217;t use SymLinksIfOwnerMatch in your httpd.conf a lstat system call is made for each directory and it&#8217;s not cached<br />
2. Tune MinSpareServers and MaxSpareServers so that Apache need not spawn more than 4 child processes per second (Apache can spawn a maximum of 32 child processes per second). When more than 4 children are spawned per second, a message will be logged in the ErrorLog.</p>
<p>to be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/optimize-your-hosting-server/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Error while loading shared libraries: libmm.so.14</title>
		<link>http://www.ecommy.com/linux/error-while-loading-shared-libraries-libmm-so-14</link>
		<comments>http://www.ecommy.com/linux/error-while-loading-shared-libraries-libmm-so-14#comments</comments>
		<pubDate>Sat, 19 Dec 2009 09:24:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=497</guid>
		<description><![CDATA[As the title say, that&#8217;s an error message which I received when trying to compile a php version with mm as a ./configure option. fixing it is as easy as checking debug.log in your php source directory, searching where the php is looking for libraries (mine was in /usr/local/lib64) and than just creating a symlink [...]]]></description>
			<content:encoded><![CDATA[<p>As the title say, that&#8217;s an error message which I received when trying to compile a php version with mm as a ./configure option.</p>
<p>fixing it is as easy as checking debug.log in your php source directory, searching where the php is looking for libraries (mine was in /usr/local/lib64) and than just creating a symlink for libmm.so.14 to /usr/local/lib64</p>
<p>Don&#8217;t have libmm at all? Go to http://www.ossp.org/pkg/lib/mm/ and install the library.</p>
<p>Update: apparently in php.ini you need to uncomment the session save path directive as otherwise the default path is / which triggers a permission error. Because of this the mm session handler does not get registered with php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/error-while-loading-shared-libraries-libmm-so-14/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An apache php fastcgid suexec cpanel story</title>
		<link>http://www.ecommy.com/linux/a-fastcgid-and-cpanel-story</link>
		<comments>http://www.ecommy.com/linux/a-fastcgid-and-cpanel-story#comments</comments>
		<pubDate>Sun, 13 Dec 2009 16:08:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=495</guid>
		<description><![CDATA[I wanted to get fastcgid running on cpanel/whm, so I went to easyApache and selected to compile apche with fastcgid support and php with fastcgi support, but guess what &#8211; it wasn&#8217;t working! they just ignored the settings and php was compiled without fastcgi in it. So back to the beggining, dreaming of my lost [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to get fastcgid running on cpanel/whm, so I went to easyApache and selected to compile apche with fastcgid support and php with fastcgi support, but guess what &#8211; it wasn&#8217;t working! they just ignored the settings and php was compiled without fastcgi in it.</p>
<p>So back to the beggining, dreaming of my lost time figuring out what the heck was wrong with whm/cpanel/easyapache I turned to plan B.</p>
<p>I recompiled apache still with easyapache from whm but without php. Further more I also choosed MPM worker module to improve the way static content is served. (!!! mpm worker is not compatible with PHP as an apache module)</p>
<p>Next step I compiled php from source &#8211; see my other article regarding compiling php from source and checking what I used as ./configure command.</p>
<p>Note: if you don&#8217;t have mod_fcgid module installed do this command in the directory you extracted the mod_fcgid archive that you got from apache website:<br />
    ./configure.apxs<br />
    make<br />
    make install</p>
<p>I went to httpd.cnf -> on my system was on /usr/local/apache/conf and added the following lines:<br />
<code><IfModule mod_fcgid.c><br />
    <Directory /home/user/public_html/><br />
        AddHandler fcgid-script .php<br />
        Options +ExecCGI<br />
        FcgidWrapper /home/user/php-wrapper .php<br />
        Order allow,deny<br />
        Allow from all<br />
    </Directory><br />
</IfModule></code></p>
<p>Now I create the wrapper that will execute the php:<br />
<code><br />
cd /home/user<br />
sudo vi php-wrapper<br />
</code></p>
<p>add this inside the file:<br />
<code><br />
#!/bin/sh<br />
exec /usr/local/php-5.3.2-fcgi/bin/php-cgi<br />
</code></p>
<p>then, some security aspects (it&#8217;s required by suexec and it&#8217;s nice organizing things a little):<br />
<code><br />
sudo chown user.nobody php-wrapper<br />
sudo chmod 550 php-wrapper<br />
cd ..<br />
sudo chown -R user.nobody user/public_html<br />
sudo chmod -R 0750 user/public_html<br />
</code></p>
<p>!Make sure you change the path of the fcgid wrapper to fit your php directory you have just compiled.</p>
<p>make sure suexec is enabled (it&#8217;s installed by default in whm, and you can enabled from php&#038;sexec configuration section)<br />
Restart apache and that&#8217;s it, or should I say&#8230; good luck <img src='http://www.ecommy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Note: you need to learn how to optimize fcgid config variables and because mpm worker was also installed, it&#8217;s corresponding configuration variables as well. But till you do, the default will be just fine.</p>
<p>Please study the instructions and make sure you understand them before breaking a live server</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/a-fastcgid-and-cpanel-story/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install php from source &#8211; custom path</title>
		<link>http://www.ecommy.com/linux/install-php-from-source-custom-path</link>
		<comments>http://www.ecommy.com/linux/install-php-from-source-custom-path#comments</comments>
		<pubDate>Sun, 13 Dec 2009 13:15:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=493</guid>
		<description><![CDATA[Hey guys, Recently I wanted to give php 5.3.1 a go but without interferring with my current setup, so I choosed to run it as fcgi. In order to do that I wanted to compile php from source, enabling the modules I needed (gd with jpg support), bmath, pdo, pdo_mysql (for magento) and so on [...]]]></description>
			<content:encoded><![CDATA[<p>Hey guys,</p>
<p>Recently I wanted to give php 5.3.1 a go but without interferring with my current setup, so I choosed to run it as fcgi.<br />
In order to do that I wanted to compile php from source, enabling the modules I needed (gd with jpg support), bmath, pdo, pdo_mysql (for magento) and so on</p>
<p>here we go:<br />
1. go to php site and download your version<br />
2. upload to your server and unarchive it somewhere <img src='http://www.ecommy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
3. go using putty or something similar to where are the files extracted, enter the source directory<br />
4. I used this command, change it per your needs:<br />
./configure &#8211;enable-bcmath &#8211;enable-calendar &#8211;enable-fastcgi &#8211;disable-cli &#8211;enable-ftp &#8211;enable-gd-native-ttf &#8211;enable-libxml &#8211;enable-magic-quotes &#8211;enable-mbstring &#8211;enable-soap &#8211;enable-sockets &#8211;prefix=/usr/local/php-5.2.13-fcgi &#8211;with-curl=/opt/curlssl/ &#8211;with-jpeg-dir=/usr/lib &#8211;with-jpeg &#8211;with-png-dir=/usr/lib &#8211;with-libdir=lib64 &#8211;with-gd &#8211;with-mm &#8211;with-mcrypt=/opt/libmcrypt/ &#8211;with-mysql=/usr &#8211;with-mysql-sock=/var/lib/mysql/mysql.sock &#8211;with-mysqli=/usr/bin/mysql_config &#8211;with-openssl=/usr &#8211;with-openssl-dir=/usr &#8211;with-zlib &#8211;with-zlib-dir=/usr &#8211;enable-pdo &#8211;with-pdo-sqlite &#8211;with-sqlite &#8211;with-pdo-mysql=/usr &#8211;with-pdo-sqlite &#8211;enable-zend-multibyte &#8211;with-freetype-dir=/usr &#8211;with-gettext &#8211;with-ttf &#8211;enable-force-cgi-redirect &#8211;enable-sysvsem &#8211;enable-sysvshm<br />
5. make<br />
6. make install</p>
<p>make sure you rename and copy the development php.ini to the lib/php.ini</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/install-php-from-source-custom-path/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install pdo_mysql &#8211; no recompiling php</title>
		<link>http://www.ecommy.com/linux/install-pdo_mysql-no-recompiling-php</link>
		<comments>http://www.ecommy.com/linux/install-pdo_mysql-no-recompiling-php#comments</comments>
		<pubDate>Sun, 13 Dec 2009 02:02:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=491</guid>
		<description><![CDATA[I googled till 4 AM to check how can I enable/install pdo_mysql for magento without the need to reinstall php &#8211; as all posts pointed I should do finally I get it working From here I started: 1. I already had pdo 2. I hadn&#8217;t pdo_mysq; so back to work (as root): 1. Download PDO_MYSQL [...]]]></description>
			<content:encoded><![CDATA[<p>I googled till 4 AM to check how can I enable/install pdo_mysql for magento without the need to reinstall php &#8211; as all posts pointed I should do<br />
finally I get it working</p>
<p>From here I started:<br />
1. I already had pdo<br />
2. I hadn&#8217;t pdo_mysq;</p>
<p>so back to work (as root):<br />
1. Download PDO_MYSQL from http://pecl.php.net/package/PDO_MYSQL<br />
2. upload it to your server<br />
3. run <code>export PHP_PREFIX="/usr/local/php/"</code><br />
4. run <code>$PHP_PREFIX/bin/phpize</code><br />
4. run <code>./configure '--with-pdo-mysql=shared,/usr'</code> !! /usr was where my mysql was installed (not where the data of mysql are!)<br />
5. make<br />
6. make install<br />
7. in your php.ini<br />
8. add<br />
<code>extension_dir = "/usr/local/php/extensions/no-debug-non-zts-20060613"<br />
extension=pdo_mysql.so</code><br />
9. restart apache</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/install-pdo_mysql-no-recompiling-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install eaccelerator from scratch &#8211; Centos</title>
		<link>http://www.ecommy.com/linux/install-eaccelerator-from-scratch-centos</link>
		<comments>http://www.ecommy.com/linux/install-eaccelerator-from-scratch-centos#comments</comments>
		<pubDate>Sun, 13 Dec 2009 01:44:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=487</guid>
		<description><![CDATA[1. download the source code and upload it to your server 2. execute export PHP_PREFIX="/usr/local/php/" where /usr/local/php/ is my path to where php is installed 3. $PHP_PREFIX/bin/phpize 4. ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config 5. make 6. make install 7. now go to php.ini and include this code: zend_extension="/usr/local/php5.2.12-fcgi/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so" eaccelerator.shm_size="128" eaccelerator.cache_dir="/tmp/eacc-php5.2.12-fcgi" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="*.php" eaccelerator.shm_max="0" eaccelerator.shm_ttl="7200" [...]]]></description>
			<content:encoded><![CDATA[<p>1. download the source code and upload it to your server<br />
2. execute<br />
<code>export PHP_PREFIX="/usr/local/php/"</code><br />
where /usr/local/php/ is my path to where php is installed<br />
3. <code>$PHP_PREFIX/bin/phpize</code><br />
4. <code>./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config</code><br />
5. <code>make</code><br />
6. <code>make install</code><br />
7. now go to php.ini and include this code:<br />
<code>zend_extension="/usr/local/php5.2.12-fcgi/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"<br />
eaccelerator.shm_size="128"<br />
eaccelerator.cache_dir="/tmp/eacc-php5.2.12-fcgi"<br />
eaccelerator.enable="1"<br />
eaccelerator.optimizer="1"<br />
eaccelerator.check_mtime="1"<br />
eaccelerator.debug="0"<br />
eaccelerator.filter="*.php"<br />
eaccelerator.shm_max="0"<br />
eaccelerator.shm_ttl="7200"<br />
eaccelerator.shm_prune_period="7200"<br />
eaccelerator.shm_only="0"<br />
eaccelerator.compress="1"<br />
eaccelerator.compress_level="8"<br />
eaccelerator.keys     = "shm"<br />
eaccelerator.sessions = "shm"<br />
eaccelerator.content  = "shm"</code><br />
make sure you change the extension path above to fit your php extension directory<br />
8. restart apache</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/install-eaccelerator-from-scratch-centos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restart apache when server load is too big</title>
		<link>http://www.ecommy.com/linux/restart-apache-when-server-load-is-too-big</link>
		<comments>http://www.ecommy.com/linux/restart-apache-when-server-load-is-too-big#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:27:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.ecommy.com/?p=479</guid>
		<description><![CDATA[Some times one of the hosting servers is going crazy with load of over 200 crashing the server eventually. The load is because of a strange php script that I can not find it for now. Anyway if you want to restart apache when your server load is too big and to receive an email [...]]]></description>
			<content:encoded><![CDATA[<p>Some times one of the hosting servers is going crazy with load of over 200 crashing the server eventually.<br />
The load is because of a strange php script that I can not find it for now. Anyway if you want to restart apache when your server load is too big and to receive an email when this happens here you go:</p>
<p><code>#!/bin/bash<br />
 MAXLOAD="5"<br />
 L05="$(uptime | gawk -F"load average: " '{ print $2 }' | gawk -F", " '{ print $1 }')"<br />
 if [ $(echo "$L05 > $MAXLOAD"|bc) -eq 1 ]<br />
 then<br />
 unlink /tmp/message.txt<br />
 MESSAGE="/tmp/message.txt"<br />
 echo "restarting apache" >> $MESSAGE<br />
 /bin/mail -s "big load $L05" "myemail" < $MESSAGE<br />
 /etc/init.d/httpd restart<br />
 fi<br />
</code></p>
<p>feel free to add it to your cron job</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ecommy.com/linux/restart-apache-when-server-load-is-too-big/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
