<?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>Dmitry Dovidenko's Blog &#187; Linux</title>
	<atom:link href="http://rootit.org/category/system-administration-of-linux-and-things-related-to-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://rootit.org</link>
	<description>"A flatterer is a friend who is your inferior, or pretends to be so." - Aristotle</description>
	<lastBuildDate>Thu, 17 Dec 2009 13:23:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Secure /tmp, /var/tmp, /dev/shm</title>
		<link>http://rootit.org/2009/05/secure-tmp-vartmp-devshm/</link>
		<comments>http://rootit.org/2009/05/secure-tmp-vartmp-devshm/#comments</comments>
		<pubDate>Thu, 07 May 2009 23:20:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://rootit.org/?p=182</guid>
		<description><![CDATA[By default CentOS and RHEL are not very secure when it comes to temporary directories. This is a big problem because an exploitable PHP script can be used to launch many nasty processes such as an FTP brute force scanner. If you have many clients its inevitable that some of them will have such exploitable [...]]]></description>
			<content:encoded><![CDATA[<p>By default CentOS and RHEL are not very secure when it comes to temporary directories. This is a big problem because an exploitable PHP script can be used to launch many nasty processes such as an FTP brute force scanner. If you have many clients its inevitable that some of them will have such exploitable scripts at some point. This also means that you will have to deal with the abuse complaints resulting from such exploits which will cost you time that you and your staff could spend on marketing or helping customers. You should use this guide to secure all new RHEL/CentOS installs. I may release a full security script at some point when it&#8217;s further tested.<span id="more-182"></span></p>
<blockquote><p>[[ Dmitry's TMP Security Script ]]<br />
Checking if /dev/tempFS exists&#8230; it does not.. creating!<br />
204800+0 records in<br />
204800+0 records out<br />
209715200 bytes (210 MB) copied, 0.70351 seconds, 298 MB/s<br />
mke2fs 1.39 (29-May-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=1024 (log=0)<br />
Fragment size=1024 (log=0)<br />
51200 inodes, 204800 blocks<br />
10240 blocks (5.00%) reserved for the super user<br />
First data block=1<br />
Maximum filesystem blocks=67371008<br />
25 block groups<br />
8192 blocks per group, 8192 fragments per group<br />
2048 inodes per group<br />
Superblock backups stored on blocks:<br />
8193, 24577, 40961, 57345, 73729</p>
<p>Writing inode tables: done<br />
Creating journal (4096 blocks): done<br />
Writing superblocks and filesystem accounting information: done</p>
<p>This filesystem will be automatically checked every 37 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.<br />
/dev/tmpFS has been created!<br />
Backing up current /tmp!<br />
Setting up /etc/fstab and mounting!<br />
Restoring old /tmp data and cleaning up!<br />
Checking if /var/tmp is a symlink&#8230; it does not.. creating!<br />
Backing up current /var/tmp!<br />
Setting up /var/tmp as symlink to secured /tmp!<br />
Restoring old /var/tmp data and cleaning up!<br />
Making sure /dev/shm is secured in /etc/fstab!</p></blockquote>
<p>Download the script and try it out. I recommend using it on a new or unmodified CentOS/RHEL install.</p>
<p><a href="http://rootit.org/wp-content/uploads/2009/05/rootit_secure_tmp.sh">Download Script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rootit.org/2009/05/secure-tmp-vartmp-devshm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NFS Shares on CentOS</title>
		<link>http://rootit.org/2008/07/nfs-shares-on-centos/</link>
		<comments>http://rootit.org/2008/07/nfs-shares-on-centos/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 01:10:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://rootit.org/?p=9</guid>
		<description><![CDATA[Many situations require a &#8220;share&#8221; of some sort where data is accessible on several machines from a common source. This way data does not have to be duplicated every time and can be accessed over network. The two popular methods are NFS and Samba. For this tutorial we will try to use NFS. Setting up [...]]]></description>
			<content:encoded><![CDATA[<p>Many situations require a &#8220;share&#8221; of some sort where data is accessible on several machines from a common source. This way data does not have to be duplicated every time and can be accessed over network. The two popular methods are NFS and Samba. For this tutorial we will try to use NFS. Setting up NFS shares on CentOS is fairly easy and mounting them is even simpler!<span id="more-9"></span></p>
<p><strong>I. The server that holds the content to be shared:</strong></p>
<p>First you will want to install the needed apps and libraries:</p>
<blockquote><p>yum install -y nfs-utils nfs-utils-lib nfs-utils-lib-devel</p></blockquote>
<p>Then you should edit /etc/exports and setup your shares. The format is &#8220;/path/to/share ip.ad.dre.ss(options,options) ip.ad.dre.ss(options,options) etc&#8230;&#8221; You should end up with a file like this:</p>
<blockquote><p>/home/something/content1/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)<br />
/home/something/content2/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)<br />
/home/something/content3/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)</p></blockquote>
<p>Then you will want to edit /etc/hosts.allow and add something like:</p>
<blockquote><p>portmap: 192.168.1.101, 192.168.1.102</p></blockquote>
<p>Then start services:</p>
<blockquote><p>/etc/init.d/portmap start<br />
/etc/init.d/nfs start</p></blockquote>
<p>Then make sure the services start on boot:</p>
<blockquote><p>chkconfig nfs on<br />
chkconfig portmap on</p></blockquote>
<p><strong>II. The servers that are pulling the content over NFS:</strong></p>
<p>This is the easy part. You just have to mount the share via /etc/fstab. The format is &#8220;nfshost:/nfs/share /path/to/mount/to nfs option,option,option 0 0&#8243;. So go ahead and open /etc/fstab and add something like this:</p>
<blockquote><p>192.168.1.1:/home/something/content1/    /home/mydomain/public_html/mycontent1    nfs    rw,hard,intr    0 0</p></blockquote>
<p>Then you just need to run:</p>
<blockquote><p>mount -a</p></blockquote>
<p>Which should mount everything in fstab. If there are errors re-read the tutorial and make sure they are nfs related errors, not other errors in your fstab! Google is your friend!</p>
]]></content:encoded>
			<wfw:commentRss>http://rootit.org/2008/07/nfs-shares-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing FFmpeg &amp; Dependencies For FLV Conversion</title>
		<link>http://rootit.org/2008/06/installing-ffmpeg-ffmpeg-php-other-dependencies-for-clipshare/</link>
		<comments>http://rootit.org/2008/06/installing-ffmpeg-ffmpeg-php-other-dependencies-for-clipshare/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 04:57:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://rootit.org/?p=8</guid>
		<description><![CDATA[This is my original guide for installing ffmpeg and all of these dependencies. I originally wrote this guide while working for HostGator in order to save myself time installing. I posted a copy of this guide in our company notes which was later copied by one of our employees into his own blog which he [...]]]></description>
			<content:encoded><![CDATA[<p>This is my <strong>original </strong>guide for installing ffmpeg and all of these dependencies. I originally wrote this guide while working for HostGator in order to save myself time installing. I posted a copy of this guide in our company notes which was later copied by one of our employees into his own blog which he failed to credit me for <img src='http://rootit.org/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  and now it&#8217;s all over the internet. You should use this guide as it&#8217;s probably <strong>the most up to date</strong> as I still use this script on a semi-regular basis and update the links whenever new versions come out.</p>
<p>This guide should teach you how to install all the needed dependencies for ClipShare or other flash video conversion scripts. It&#8217;s primarily focused on RHEL or CentOS installs for the dependencies of these packages. The links in this guide are fresh as of 08/04/2008. Here is what this guide will help you install:</p>
<ul>
<li> FFmpeg (<a class="external free" title="http://ffmpeg.mplayerhq.hu" rel="nofollow" href="http://ffmpeg.mplayerhq.hu/">http://ffmpeg.mplayerhq.hu</a>)</li>
<li> FFmpeg-PHP (<a class="external free" title="http://ffmpeg-php.sourceforge.net" rel="nofollow" href="http://ffmpeg-php.sourceforge.net/">http://ffmpeg-php.sourceforge.net</a>)</li>
<li> MPlayer + Mencoder (<a class="external free" title="http://www.mplayerhq.hu/design7/dload.html" rel="nofollow" href="http://www.mplayerhq.hu/design7/dload.html">http://www.mplayerhq.hu/design7/dload.html</a>)</li>
<li> FLV2Tool (<a class="external free" title="http://inlet-media.de/flvtool2" rel="nofollow" href="http://inlet-media.de/flvtool2">http://inlet-media.de/flvtool2</a>)</li>
<li> Libogg (<a class="external free" title="http://www.xiph.org/downloads" rel="nofollow" href="http://www.xiph.org/downloads">http://www.xiph.org/downloads</a>)</li>
<li> Libvorbis (<a class="external free" title="http://www.xiph.org/downloads" rel="nofollow" href="http://www.xiph.org/downloads">http://www.xiph.org/downloads</a>)</li>
<li> LAME MP3 Encoder (<a class="external free" title="http://lame.sourceforge.net" rel="nofollow" href="http://lame.sourceforge.net/">http://lame.sourceforge.net</a>)</li>
</ul>
<p><span id="more-8"></span>It assumes you already have Apache and PHP5 installed as those are required dependencies as well. There will also be a guide up for installing PHP5.2.6 from source on CentOS/RHEL soon.</p>
<p>First install subversion and ruby via yum or up2date:</p>
<p><code>yum -y install subversion ruby</code></p>
<p>Now we need to install MPlayer &amp; FFmpeg sources from SVN:</p>
<p><code>cd ~<br />
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg<br />
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer</code></p>
<p>Now we need some codecs:</p>
<p><code>wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2<br />
tar xvjpf essential-20071007.tar.bz2<br />
cd essential-20071007<br />
mkdir /usr/local/lib/codecs<br />
mv * /usr/local/lib/codecs/<br />
chmod -R 755 /usr/local/lib/codecs/<br />
cd ~</code></p>
<p>Next we will install LAME MP3 encoder:</p>
<p><code>wget http://internap.dl.sourceforge.net/sourceforge/lame/lame-398.tar.gz<br />
tar xvzpf lame-398.tar.gz<br />
cd lame-398<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ~</code></p>
<p>Now we install Libogg:</p>
<p><code>wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz<br />
tar xvzpf libogg-1.1.3.tar.gz<br />
cd libogg-1.1.3<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ~</code></p>
<p>We need to make sure the correct lib directories are setup in ldconfig. Edit the <strong>/etc/ld.so.conf</strong> file and add the following lines:</p>
<p><code>/usr/lib<br />
/usr/local/lib</code></p>
<p>Now save and run the following command:</p>
<p><code>ldconfig</code></p>
<p>To install libvorbis we will run:</p>
<p><code>wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz<br />
tar xvzpf libvorbis-1.2.0.tar.gz<br />
cd libvorbis-1.2.0<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ~</code></p>
<p>Now we will install FLVTool2:</p>
<p><code>wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz<br />
tar xvzpf flvtool2-1.0.6.tgz<br />
cd flvtool2-1.0.6<br />
ruby setup.rb config<br />
ruby setup.rb setup<br />
ruby setup.rb install<br />
cd ~</code></p>
<p>Next we should build MPlayer &amp; MEncoder and it will take a while unless you have a nice dual or quad core machine. Note that I&#8217;ve seen the SVN version of these packages break before, so you can always download the source code from their site (a stable copy) if it fails on make:</p>
<p><code>cd mplayer<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ~</code></p>
<p>We will now build FFmpeg:</p>
<p><code>mkdir /usr/local/src/tmp<br />
chmod 777 /usr/local/src/tmp<br />
export TMPDIR=/usr/local/src/tmp<br />
cd ffmpeg<br />
./configure --prefix=/usr --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared<br />
make<br />
make install<br />
cd ~</code></p>
<p>Symlink some libraries if needed (ignore file exists errors):</p>
<p><code>ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50<br />
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51<br />
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49<br />
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0<br />
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51</code></p>
<p>Now build FFmpeg-PHP:</p>
<p><code>wget http://voxel.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2<br />
tar xvjpf ffmpeg-php-0.5.3.1.tbz2<br />
cd ffmpeg-php-0.5.3.1<br />
phpize<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ~</code></p>
<p>Now you need to copy the ffmpeg.so file that was created from it&#8217;s location (from the build) to /usr/local/lib/php/extensions/, it should look something like:</p>
<p><code>cp /usr/local/lib/php/extensions/no-debug-non-zts-????????????/ffmpeg.so /usr/local/lib/php/extensions/</code></p>
<p>Modify your php.ini. Try <strong>/etc/php.ini</strong> or <strong>/usr/lib/php.ini</strong> or <strong>/usr/local/Zend/etc/php.ini</strong> as they are common locations, you can do <strong>php -i | grep -i</strong> ini to find the proper location. Change the extension_dir value as seen below and add the extension as seen below:</p>
<p><code>extension_dir = "/usr/local/lib/php/extensions/"<br />
extension=ffmpeg.so</code></p>
<p>Now save and restart apache and test php for ffmpeg on both apache via phpinfo() and from shell:</p>
<p><code>service httpd stop<br />
killall -9 httpd<br />
service httpd start<br />
php -i | grep -i ffmpeg</code></p>
<p>Let me know via comments if you find some bugs or better ways to do things!</p>
]]></content:encoded>
			<wfw:commentRss>http://rootit.org/2008/06/installing-ffmpeg-ffmpeg-php-other-dependencies-for-clipshare/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
