<?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>DotNux - Unix/Linux Technical Mini Howto</title>
	<atom:link href="http://www.dotnux.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dotnux.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 15 Aug 2009 18:12:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to install PHP accelerator (APC) on Centos 5</title>
		<link>http://www.dotnux.com/?p=46</link>
		<comments>http://www.dotnux.com/?p=46#comments</comments>
		<pubDate>Sat, 15 Aug 2009 18:11:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dotnux.com/?p=46</guid>
		<description><![CDATA[If you used PHP on Apache, whether on Centos, Gentoo, Ubuntu, etc., you probably noticed PHP gets slower as most modern PHP framework gets bigger in sizes, more layers, increasing database records, etc. Then, try to install FREE php accelerator called APC (Alternative PHP Cache). APC is a free, open, and robust framework for caching [...]]]></description>
			<content:encoded><![CDATA[<p>If you used PHP on Apache, whether on Centos, Gentoo, Ubuntu, etc., you probably noticed PHP gets slower as most modern PHP framework gets bigger in sizes, more layers, increasing database records, etc.</p>
<p>Then, try to install FREE php accelerator called APC (Alternative PHP Cache).<br />
APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.<br />
In other words, APC will compile PHP code automatically, and can give a boost to your site without modification, 2, 5, 10 and perhaps even more performance boost.  </p>
<p>One time I had mediawiki, and it was getting really slow, and after installing APC, it&#8217;s about 5 times faster.</p>
<p>Let&#8217;s get down to the detail:<br />
<code><br />
<strong class="realcode"><br />
yum install php-pear<br />
yum install php-devel<br />
yum install httpd-devel<br />
perc install apc<br />
echo "extension=apc.so" > /etc/php.d/apc.ini<br />
</strong><br />
</code><br />
and then restart apache!<br />
<code><br />
<strong class="realcode"><br />
/etc/init.d/httpd restart<br />
</strong><br />
</code></p>
<p>Confirm the output of phpinfo() that APC works (look for APC block)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotnux.com/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple (and easy) mysql database creation (db, user, privilege)</title>
		<link>http://www.dotnux.com/?p=24</link>
		<comments>http://www.dotnux.com/?p=24#comments</comments>
		<pubDate>Wed, 15 Jul 2009 15:42:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.dotnux.com/?p=24</guid>
		<description><![CDATA[Everytime I install a new PHP application, such as Joomla, drupal, php-nuke, zen-cart, oscommerce, etc., you have to install a new database. If you have a SSH access to it, the following script will do a quick database creation job, with user name &#38; password. type &#8216;mysql&#8217;, and type the following SQL script. mysql&#62; create [...]]]></description>
			<content:encoded><![CDATA[<p>Everytime I install a new PHP application, such as Joomla, drupal, php-nuke, zen-cart, oscommerce, etc., you have to install a new database.</p>
<p>If you have a SSH access to it, the following script will do a quick database creation job, with user name &amp; password.</p>
<p>type &#8216;mysql&#8217;, and type the following SQL script.</p>
<p><code> mysql&gt; <strong><span class="realcode">create database [DATABASE_NAME];</span></strong><br />
Query OK, 1 row affected (0.06 sec)</code></p>
<p><code> mysql&gt; <strong><span class="realcode">create user '[USER_NAME]'@'localhost' identified by '[PASSWORD]';</span></strong><br />
Query OK, 0 rows affected (0.00 sec)<br />
</code></p>
<p># SEE the comment below, regarding privilege<br />
<code><br />
mysql&gt; <strong><span class="realcode">grant all privileges on [DATABASE_NAME].* to '[USER_NAME]'@'localhost';</span></strong><br />
Query OK, 0 rows affected (0.00 sec)<br />
</code></p>
<p># Note<br />
Now if you want to grant only limited privileges, like SELECT, INSERT, UPDATE, DELETE, then run the following:</p>
<p><code>mysql&gt; <strong><span class="realcode">grant SELECT,INSERT,UPDATE,DELETE,CREATE on [DATABASE_NAME].* to  [USER_NAME]'@'localhost';</span></strong><br />
Query OK, 0 rows affected (0.00 sec)<br />
</code></p>
<p>You need &#8216;CREATE&#8217;, because, usually installers will try to create a database. You could also add &#8216;DROP&#8217; so that the installer can delete any temporary tables that it has created.</p>
<p>and then finally, you need to flush privilege so that new permission can be in effect.</p>
<p><code>mysql&gt; <strong class="realcode">flush privileges;</strong><br />
Query OK, 0 rows affected (0.14 sec)<br />
</code></p>
<p>and, you can check the privileges to make sure it&#8217;s set correctly by doing this:</p>
<p><code>mysql&gt; <strong class="realcode">show grants for '[USER_NAME]'@'localhost';</strong><br />
+--------------------------------------------------------------------+<br />
| Grants for [USER_NAME]@%                                           |<br />
+--------------------------------------------------------------------+<br />
| GRANT ALL PRIVILEGES ON *.* TO '[USER_NAME]'@'%' WITH GRANT OPTION |<br />
+--------------------------------------------------------------------+<br />
1 row in set (0.00 sec)</code></p>
<p><code> </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotnux.com/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;jail&#8221; sftp (OpenSSH based) to user&#8217;s home directory using ChrootDirectory option on Centos 5</title>
		<link>http://www.dotnux.com/?p=7</link>
		<comments>http://www.dotnux.com/?p=7#comments</comments>
		<pubDate>Tue, 30 Jun 2009 22:07:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos 5]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://www.dotnux.com/?p=7</guid>
		<description><![CDATA[You probably do not want to open FTP as it&#8217;s insecure, and open up SFTP, for example, you want your dreamweaver users&#8217; SFTP option.  But, the problem here is that, SFTP uses SSH, which will give entire Linux / directory.  You want to disable SSH shell access, but, enable SFTP to their home directory only. [...]]]></description>
			<content:encoded><![CDATA[<p>You probably do not want to open FTP as it&#8217;s insecure, and open up SFTP, for example, you want your dreamweaver users&#8217; SFTP option.  But, the problem here is that, SFTP uses SSH, which will give entire Linux / directory.  You want to disable SSH shell access, but, enable SFTP to their home directory only.<br />
<img src="http://www.dotnux.com/wp-content/uploads/2009/06/dreamweaver_sftp1-300x251.jpg" alt="dreamweaver_sftp" title="dreamweaver_sftp" width="300" height="251" class="alignnone size-medium wp-image-22" /></p>
<p>First, you need latest version of OpenSSH (5.2 at this moment) for ChrootDirectory option to work.</p>
<p>If you try # yum install openssh, and it may give option of 4.2 only, then, you have to install OpenSSH 5.2 manually.<br />
See this <a href="http://www.dotnux.com/?p=3">post</a> on how to install OpenSSH 5.2 yourself.</p>
<p>Now that you have at least OpenSSH 5.2, let&#8217;s modify /etc/ssh/sshd_config</p>
<p>&#8230;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#Subsystem      sftp    /usr/libexec/openssh/sftp-server</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Subsystem sftp internal-sftp</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Match Group sftp</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">ChrootDirectory /home/%u</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">X11Forwarding no</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">AllowTcpForwarding no</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">ForceCommand internal-sftp</div>
<p><code># comment this line below<br />
#Subsystem      sftp    /usr/libexec/openssh/sftp-server</code></p>
<p><code># add these lines<br />
<span class="realfile"><br />
Subsystem sftp internal-sftp<br />
Match Group sftp<br />
ChrootDirectory /home/%u<br />
X11Forwarding no<br />
AllowTcpForwarding no<br />
ForceCommand internal-sftp<br />
</realfile><br />
</code></p>
<p>save it, and execute: (username is the user name of the account that you want to give sftp access)<br />
<code><br />
# <span class="realcommand">groupadd sftp</span><br />
# <span class="realcommand">useradd username</span><br />
# <span class="realcommand">passwd username</span><br />
(set the password of user)<br />
# <span class="realcommand">usermod -d / username</span><br />
# <span class="realcommand">usermod -g sftp username</span><br />
(user must have a group of 'sftp')<br />
# <span class="realcommand">chown root.root /home/username</span><br />
</code><br />
Voila! Try to connect your server via SFTP, and it works indeed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotnux.com/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install OpenSSH 5.2 on CentOS 5</title>
		<link>http://www.dotnux.com/?p=3</link>
		<comments>http://www.dotnux.com/?p=3#comments</comments>
		<pubDate>Tue, 30 Jun 2009 21:56:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos 5]]></category>
		<category><![CDATA[openssh]]></category>

		<guid isPermaLink="false">http://www.dotnux.com/?p=3</guid>
		<description><![CDATA[Centos 5 yum doesn&#8217;t seem to support latest OpenSSH 5.2 which support many features. (it&#8217;s like 4.2) Make sure you have development tools: # yum install gcc # yum install openssl-devel # yum install pam-devel # yum install rpm-build And then download openssh 5.2p1 # wget ftp://mirror.planetunix.net/pub/OpenBSD/OpenSSH/portable/openssh-5.2p1.tar.gz Now, we&#8217;re going to build RPM based on [...]]]></description>
			<content:encoded><![CDATA[<p>Centos 5 yum doesn&#8217;t seem to support latest OpenSSH 5.2 which support many features. (it&#8217;s like 4.2)</p>
<p>Make sure you have development tools:<br />
<code><br />
# <span class="realcommand">yum install gcc</span><br />
# <span class="realcommand">yum install openssl-devel</span><br />
# <span class="realcommand">yum install pam-devel</span><br />
# <span class="realcommand">yum install rpm-build</span><br />
</code><br />
And then download openssh 5.2p1<br />
<code><br />
# <span class="realcommand">wget ftp://mirror.planetunix.net/pub/OpenBSD/OpenSSH/portable/openssh-5.2p1.tar.gz</span><br />
</code><br />
Now, we&#8217;re going to build RPM based on tar.gz file:<br />
<code><br />
# <span class="realcommand">tar xvfz openssh-5.2p1.tar.gz</span><br />
# <span class="realcommand">cp ./openssh-5.2p1/contrib/redhat/openssh.spec /usr/src/redhat/SPECS/</span><br />
# <span class="realcommand">cp  ./openssh-5.2p1.tar.gz /usr/src/redhat/SOURCES/</span><br />
# <span class="realcommand">cd /usr/src/redhat/SPECS/</span><br />
# <span class="realcommand">perl -i.bak -pe 's/^(%define no_(gnome|x11)_askpass)\s+0$/$1 1/' openssh.spec</span><br />
# <span class="realcommand">rpmbuild -bb openssh.spec</span><br />
# <span class="realcommand">cd /usr/src/redhat/RPMS/`uname -i`</span><br />
# <span class="realcommand">ls -l</code></span></p>
<p><code></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">drwxr-xr-x 2 root root   4096 Jun 30 12:39 .</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">drwxr-xr-x 9 root root   4096 Jun 30 12:35 ..</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">-rw-r--r-- 1 root root 271758 Jun 30 12:39 openssh-5.2p1-1.i386.rpm</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">-rw-r--r-- 1 root root 429852 Jun 30 12:39 openssh-clients-5.2p1-1.i386.rpm</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">-rw-r--r-- 1 root root 268302 Jun 30 12:39 openssh-server-5.2p1-1.i386.rpm</div>
<p>-rw-r--r-- 1 root root 271758 Jun 30 12:39 openssh-5.2p1-1.i386.rpm<br />
-rw-r--r-- 1 root root 429852 Jun 30 12:39 openssh-clients-5.2p1-1.i386.rpm<br />
-rw-r--r-- 1 root root 268302 Jun 30 12:39 openssh-server-5.2p1-1.i386.rpm</p>
<p></code></p>
<p><code># <span class="realcommand">rpm -Uvh openssh*rpm</span><br />
Preparing... ################################<br />
1: openssh ####<br />
2: openssh-clients ####<br />
3: openssh-server ####<br />
# service sshd restart<br />
</code><br />
Then, RPM version of SSH installs.  After restarting, it may say initlog is obsolete, but, you can ignore as that option is deprecated.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotnux.com/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
