<?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>has an internet?</title>
	<atom:link href="http://hasaninter.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://hasaninter.net</link>
	<description>Tales from adminland</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:55:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Increasing cPanel /tmp size</title>
		<link>http://hasaninter.net/2011/05/07/increasing-cpanel-tmp-size/</link>
		<comments>http://hasaninter.net/2011/05/07/increasing-cpanel-tmp-size/#comments</comments>
		<pubDate>Sun, 08 May 2011 04:43:31 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Fixing Shit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=50</guid>
		<description><![CDATA[By default, cPanel sets up a paltry]]></description>
			<content:encoded><![CDATA[<p>By default, cPanel sets up a paltry <512MB /tmp disk. This isn't nearly large enough for large file uploads or other disk-intensive purposes. While it's better to use RAM for temporary storage, sometimes you need a place to dump huge files (such as uploads). Luckily, raising the /tmp disk size has been fairly simple. cPanel's script to secure the /tmp partition against drop-in hacks by making it noexec can also resize the /tmp directory.</p>
<p>The file we'll be modifying is:</p>
<p><code><br />
/scripts/securetmp<br />
</code></p>
<p>Until recently, modifying one variable was enough to change this, but it seems like there was a change recently that has caused that method to no longer remount /tmp properly. Luckily, the fix for this is two additional small changes to the file.</p>
<p>Let's open up /scripts/securetmp in your favorite editor:</p>
<p><code><br />
nano /scripts/securetmp<br />
</code></p>
<p>First, we're going to modify line 49:</p>
<p><code><br />
my $auto = 1<br />
</code></p>
<p>If this isn't already set to 1, set it. Just makes things easier. Next, let's set the /tmp size, line 148:</p>
<p><code><br />
my $tmpdsksize = 2097152;<br />
</code></p>
<p>This size is in KB - 2GB aught to do it. Now, to fix the issue of mounting /tmp, line 289:</p>
<p><code><br />
system 'mount', '-o', $mountkeyword . ',loop,noexec,nosuid', $tmpmnt, '/tmp';<br />
</code></p>
<p>We're adding "loop," to the options passed to the mount command to ensure that the system understands /tmp is a loopback device being created on /usr/tmpDSK. Save and exit your file.</p>
<p>Next, we need to shut off anything using /tmp:</p>
<p><code><br />
/etc/init.d/mysql stop<br />
/etc/init.d/httpd stop<br />
</code></p>
<p>And unmount it and /var/tmp:</p>
<p><code><br />
umount /tmp<br />
umount /var/tmp<br />
</code></p>
<p>If you get errors, retry a few times, it'll usually unmount after the 2nd or 3rd try. If you're still getting errors, make sure nothing is open in /tmp:</p>
<p><code><br />
lsof | grep /tmp<br />
</code></p>
<p>Shut it down or delete it. Next, we need to remove the existing /tmp partition file:</p>
<p><code><br />
rm -f /usr/tmpDSK<br />
</code></p>
<p>And finally, create the new device:</p>
<p><code><br />
/scripts/securetmp<br />
</code></p>
<p>Depending on the size of your partition, this may take up to 15-20 minutes. After you're done, start everything back up and ensure /tmp is mounted and the right size with a simple:</p>
<p><code><br />
df -h<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/05/07/increasing-cpanel-tmp-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing New Plesk Components on Linux</title>
		<link>http://hasaninter.net/2011/04/09/installing-new-plesk-components-on-linux/</link>
		<comments>http://hasaninter.net/2011/04/09/installing-new-plesk-components-on-linux/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 01:40:47 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[Fixing Shit]]></category>
		<category><![CDATA[Installing Shit]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=45</guid>
		<description><![CDATA[Installing New Components Ever been in a Plesk box but can&#8217;t find certain components, like ASP support, or the backup manager? This is because Plesk installs whatever you tell it to at the initial install, and only whatever you tell it to. This leads to a lot of missing components that you might be used <a href='http://hasaninter.net/2011/04/09/installing-new-plesk-components-on-linux/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<h1>Installing New Components</h1>
<p>Ever been in a Plesk box but can&#8217;t find certain components, like ASP support, or the backup manager? This is because Plesk installs whatever you tell it to at the initial install, and only whatever you tell it to. This leads to a lot of missing components that you might be used to having access to. Plesk won&#8217;t tell you anything in the GUI except that the component is not installed, so you must hunt down this binary:</p>
<p><code>/usr/local/psa/admin/bin/autoinstaller</code><br />
<br />This is the Plesk Autoinstaller, which will allow you, through its byzantine menu corridors, to find the gold that is the component you need. Navigating it is fairly simple, although you&#8217;ll probably want to read all of the text on the screen if this is your first time.</p>
<p>However, a more sinister condition awaits you &#8211; the fact that the Plesk autoinstaller apparently doesn&#8217;t know how to fucking resolve rpm dependencies. Why is it called an autoinstaller if it doesn&#8217;t automatically install anything extra? I don&#8217;t know.</p>
<h1>Resolving Plesk Component Dependencies</h1>
<p>Luckily, it&#8217;s not that difficult to resolve RPM dependency errors. Did you get an error message that looks something like this?</p>
<p><code><br />
Retrieving information about the installed packages...<br />
File downloading PSA_9.3.0/dist-rpm-CentOS-5-x86_64/build-9.3.0-cos5-x86_64.hdr.gz: 10%..20%..30%..40%..50%..60%..70%..80%..90%..100% was finished.<br />
File downloading PSA_9.3.0/update-rpm-CentOS-5-x86_64/update-9.3.0-cos5-x86_64.hdr.gz: 10%..20%..30%..40%..50%..60%..70%..80%..90%..100% was finished.<br />
File downloading PSA_9.3.0/thirdparty-rpm-CentOS-5-x86_64/thirdparty-9.3.0-cos5-x86_64.hdr.gz: 13%..25%..31%..40%..54%..60%..72%..83%..95%..100% was finished.<br />
Determining the packages that need to be installed.<br />
ERROR: Unable to install the "psa-backup-manager-9.3.0-cos5.build93091230.06.x86_64" package.<br />
Not all packages were installed.<br />
Please, contact product technical support.<br />
[root@host2 plesk]#</code><br />
<br />Not to worry! First, try Google to find that RPM &#8211; Plesk allows their FTP server to be directory indexed, so it shouldn&#8217;t be hard to find the exact RPM it&#8217;s erroring out on. Try downloading the .rpm file and installing it manually using rpm -i:</p>
<p><code>wget http://autoinstall.swsoft.com.cn/PSA_9.3.0/dist-rpm-CentOS-5-x86_64/opt/backup/psa-backup-manager-9.3.0-cos5.build93091230.06.x86_64.rpm<br />
rpm -i psa-backup-manager-9.3.0-cos5.build93091230.06.x86_64.rpm</code></p>
<p>If all goes well, you&#8217;ll get output messages listing the failed dependencies. Ignore any Plesk-looking dependencies, the auto-installer actually fixes these. Use yum to install any other system packages you may need.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/09/installing-new-plesk-components-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel&#8217;s Built-in php.ini File</title>
		<link>http://hasaninter.net/2011/04/09/cpanels-built-in-php-ini-file/</link>
		<comments>http://hasaninter.net/2011/04/09/cpanels-built-in-php-ini-file/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 19:00:04 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Fixing Shit]]></category>
		<category><![CDATA[Installing Shit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=43</guid>
		<description><![CDATA[Because I lose track of it all the time, this is the location to the php.ini file for cPanel&#8217;s built-in PHP installation. /usr/local/cpanel/3rdparty/etc/php.ini And, since it&#8217;s slightly relevant, you can rebuild the internal PHP installation with this script: /scripts/makecppphp]]></description>
			<content:encoded><![CDATA[<p>Because I lose track of it all the time, this is the location to the php.ini file for cPanel&#8217;s built-in PHP installation.</p>
<p><code>/usr/local/cpanel/3rdparty/etc/php.ini</code></p>
<p>And, since it&#8217;s slightly relevant, you can rebuild the internal PHP installation with this script:</p>
<p><code>/scripts/makecppphp</code></p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/09/cpanels-built-in-php-ini-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting Slow mySQL Performance with mtop</title>
		<link>http://hasaninter.net/2011/04/08/troubleshooting-slow-mysql-performance-with-mtop/</link>
		<comments>http://hasaninter.net/2011/04/08/troubleshooting-slow-mysql-performance-with-mtop/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 02:46:02 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[Fixing Shit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=29</guid>
		<description><![CDATA[mySQL is the database backbone behind a wide variety of software programs and scripts, but most people don&#8217;t know how to code for it properly. As such, mySQL-related overloads and optimization of sub-par mySQL databases can take a lot of time. The easiest way to track and troubleshoot troublesome threads is with mtop &#8211; live <a href='http://hasaninter.net/2011/04/08/troubleshooting-slow-mysql-performance-with-mtop/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>mySQL is the database backbone behind a wide variety of software programs and scripts, but most people don&#8217;t know how to code for it properly. As such, mySQL-related overloads and optimization of sub-par mySQL databases can take a lot of time. The easiest way to track and troubleshoot troublesome threads is with mtop &#8211; live mySQL query querying.</p>
<h1>Prerequisites</h1>
<p>mtop requires curses. In CentOS, this is as simple as a few yum commands. There are a few extra steps for cPanel compatibility.</p>
<ol>
<li>Install curses and curses-devel:<br />
<code><br />
yum install curses curses-devel</code></li>
<p>
<li>Install curses-Perl:</p>
<p><code>yum install curses-Perl</code></p>
<ol type="a">
<li>If you&#8217;re on cPanel, you&#8217;ll first need to remove the perl* exclude from yum.conf.</p>
<p><code>nano /etc/yum.conf</code></p>
<p>In the exclude= line, remove “perl*” – save (CTRL+O) and exit (CTRL+X). Be sure to add it back after installing curses-Perl as per the above command.</li>
</ol>
</li>
</ol>
<h1>Install mtop</h1>
<p>Now it&#8217;s time to fetch the latest version of mtop and compile it. The homepage is <a href="http://mtop.sourceforge.net/">here</a> if you wish to check for the latest version. As of this post, we will be using 0.6.6, the latest version.</p>
<ol>
<li>Grab the mtop source:</p>
<p><code>wget http://softlayer.dl.sourceforge.net/project/mtop/mtop/v0.6.6/mtop-0.6.6.tar.gz</code></li>
<p>
<li>Configure, make, and install:</p>
<p><code>tar -zxf mtop-0.6.6.tar.gz<br />
cd mtop-0.6.6<br />
perl Makefile.PL<br />
make<br />
make install</code></li>
</ol>
<h1>Configure and run</h1>
<p>By default, mtop doesn&#8217;t connect as the root user. For most server installations, we want to connect as root. Here&#8217;s the quickest and easiest way to run mtop.</p>
<ol>
<li>Find your current mySQL root password:</p>
<p><code>cat /root/.my.cnf</code></li>
<li>Copy the root password (and hostname, if different than localhost) and run the command as follows:
<p><code>mtop --host=YOURHOSTNAME --dbuser=root --password=YOURPASSWORD --seconds=1</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/08/troubleshooting-slow-mysql-performance-with-mtop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a New mySQL Access Host</title>
		<link>http://hasaninter.net/2011/04/08/adding-a-new-mysql-access-host/</link>
		<comments>http://hasaninter.net/2011/04/08/adding-a-new-mysql-access-host/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 18:30:36 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Fixing Shit]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=27</guid>
		<description><![CDATA[So you&#8217;ve migrated to a new database server, or a new web server, or you&#8217;ve added a new database server to your cluster. The problem is, all of your mySQL users only have grants on the old server. Luckily, the guys at cPanel know your pain and have added an easy way to make sure <a href='http://hasaninter.net/2011/04/08/adding-a-new-mysql-access-host/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve migrated to a new database server, or a new web server, or you&#8217;ve added a new database server to your cluster. The problem is, all of your mySQL users only have grants on the old server. Luckily, the guys at cPanel know your pain and have added an easy way to make sure all of your users have access to their databases.</p>
<h1>Add the new hostname</h1>
<ol>
<li><strong>Back up the &#8220;mysql&#8221; database before making ANY changes.</strong></p>
<li>Log in to WHM as root</li>
<li>Navigate to SQL Services->Additional SQL Access Hosts</li>
<li>Put the new IP address that you&#8217;ll be accessing FROM in the box</li>
</ol>
<p>If you&#8217;ve got a deadline, you can add the host % here &#8211; this will allow access to mySQL from all hosts. SQL authentication is still required, so you&#8217;re not exposing any passwords, but if your clients use insecure mySQL usernames, passwords, and database prefixes, this could still leave you open to a huge SQL injection vulnerability risk, so it is highly not recommended.</p>
<h1>Add the grants</h1>
<ol>
<li>Navigate back to the Additional SQL Access Hosts page, and at the bottom of the page, click the link labeled &#8220;click here.&#8221;</li>
<li>Wait for the process to finish and confirm access.</li>
</ol>
<p>This quick-and-dirty method will ensure your users will still be able to authenticate using their same passwords, and saves a lot of nasty mySQL batch work.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/08/adding-a-new-mysql-access-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up password protection in IIS 7</title>
		<link>http://hasaninter.net/2011/04/07/setting-up-password-protection-in-iis-7/</link>
		<comments>http://hasaninter.net/2011/04/07/setting-up-password-protection-in-iis-7/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 04:46:59 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[GUI]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=20</guid>
		<description><![CDATA[So you&#8217;ve got a client that wants to password protect their sites. Easy-peasy! But wait, they&#8217;re running IIS without any sort of control panel? The horrors! Luckily, IIS makes this fairly simple, as long as you&#8217;re okay with using Windows user accounts. Prerequisites There are a few prerequisites set up for this. If you installed <a href='http://hasaninter.net/2011/04/07/setting-up-password-protection-in-iis-7/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve got a client that wants to password protect their sites. Easy-peasy! But wait, they&#8217;re running IIS without any sort of control panel? The horrors! Luckily, IIS makes this fairly simple, as long as you&#8217;re okay with using Windows user accounts.</p>
<h1>Prerequisites</h1>
<p>There are a few prerequisites set up for this. If you installed IIS 7 and you know all of the available Security modules are installed, you may skip this step. Otherwise, we need to install the Windows Authentication and URL Authorization modules.</p>
<ol>
<li>Open Server Manager &#8211; Start->Administrative Tools->Server Manager</li>
<li>Navigate Roles->Web Server (IIS).</li>
<li>Click &#8220;Add Features&#8221;</li>
<li>Ensure that &#8220;Windows Authentication&#8221; and &#8220;URL Authorization&#8221; are checked off under the &#8220;Security&#8221; options.</li>
</ol>
<h1>Creating the User Accounts</h1>
<ol>
<li>Open Computer Management &#8211; Start->Administrative Tools->Computer Management.</li>
<li>Expand Local Users and Groups, select Users</li>
<li>Right-click, select New User&#8230;</li>
<li>Fill in an appropriate username and password &#8211; and I recommend putting the domain name in the Full Name field, for record-keeping. Make sure to uncheck &#8220;user must change password at next logon,&#8221; and check &#8220;Password never expires&#8221; to prevent issues down the road.</li>
<li>Repeat as needed.</li>
</ol>
<h1>Set up the IIS site</h1>
<ol>
<li>Open Internet Information Services (IIS) Manager &#8211; Start->Administrative Tools->Internet Information Services (IIS) Manager.</li>
<li>Expand the Sites tab and select your domain name</li>
<li>Click Authentication</li>
<li>Right-click Anonymous Authentication, click Disable</li>
<li>Right-click Windows Authentication, click Enable</li>
</ol>
<p>That&#8217;s put IIS out of pass-through anonymous authentication mode using the IUSR and has set it to require a Windows authentication pop-up box. That&#8217;s half the battle &#8211; now to make sure the site only loads when our specific user inputs their username and password.</p>
<ol>
<li>Go back to the domain name in IIS and click Authorization Rules.</li>
<li>Right-click on the default rule and click Edit.</li>
<li>Click the radio next to Specified Users and type your username into the box</li>
</ol>
<p>For more background information on these commands, check out these IIS help pages: <a href="http://www.iis.net/ConfigReference/system.webServer/security/authentication/windowsAuthentication">Windows Authentication</a>, <a href="http://www.iis.net/ConfigReference/system.webServer/security/authorization">Security Authorization</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/07/setting-up-password-protection-in-iis-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel ffmpeg install</title>
		<link>http://hasaninter.net/2011/04/01/cpanel-ffmpeg-install/</link>
		<comments>http://hasaninter.net/2011/04/01/cpanel-ffmpeg-install/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 04:38:04 +0000</pubDate>
		<dc:creator>Jordan Cooks</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Installing Shit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://hasaninter.net/?p=5</guid>
		<description><![CDATA[There are many tutorials on how to install ffmpeg for cPanel. I will be combining one with my own modifications. Please submit modifications or corrections when necessary and I will update this post. The last update to this post was February 7th, 2012. Some Prerequisites There are a few things you&#8217;ll need to prepare if <a href='http://hasaninter.net/2011/04/01/cpanel-ffmpeg-install/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>There are many tutorials on how to install ffmpeg for cPanel. I will be combining <a href="http://www.serverhostingsecrets.com/tutorials/cpanel-ffmpeg-howto/">one</a> with my own modifications. Please submit modifications or corrections when necessary and I will update this post. The last update to this post was <strong>February 7th, 2012</strong>.</p>
<h1>Some Prerequisites</h1>
<p>There are a few things you&#8217;ll need to prepare if you&#8217;re on a fresh installation.</p>
<ol>
<li>Subversion</li>
<p>Subversion is required to download and install ffmpeg and mplayer. First, you need to allow yum to install Perl packages.<br />
<code><br />
nano -w /etc/yum.conf<br />
</code><br />
In the exclude= line, remove &#8220;perl*&#8221; &#8211; save (CTRL+O) and exit (CTRL+X).<br />
<code><br />
yum install subversion<br />
</code><br />
Be sure to add the perl* line back to /etc/yum.conf after you install subversion! This is to prevent yum from accidentally overwriting cPanel&#8217;s Perl modules.</p>
<li>Git</li>
<p>Git is required because for some reason, when you install mplayer, it forces you to download a Git repository of ffmpeg. Don&#8217;t use this repository for installing ffmpeg &#8211; it breaks with a strange error message. How you install Git will vary across OSes. On CentOS 5.5 x64, there are several dependencies as well.<br />
<code><br />
yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel<br />
cd /usr/local/src<br />
wget http://git-core.googlecode.com/files/git-1.7.7.tar.gz<br />
tar -zxf git-1.7.7.tar.gz<br />
cd git-1.7.7<br />
make prefix=/usr/local all<br />
make prefix=/usr/local install<br />
</code></p>
<li>Ruby</li>
<p>Ruby is required for flvtool. You can install this using the cPanel script:<br />
<code><br />
/scripts/installruby<br />
</code><br />
If you&#8217;re not using cPanel, you can probably install this using your package manager.</p>
<li>libXext</li>
<p>libXext is required for MP4Box. It&#8217;s in the yum repositories.<br />
<code><br />
yum install libXext libXext-devel<br />
</code></p>
<li>Remove any other installations</li>
<p>You might already have ffmpeg installed. If it was compiled in, that&#8217;s fine, this will overwrite it. But if you have RPM binaries installed, this will cause issues. Run the following:<br />
<code><br />
rpm -qa | grep ffmpeg<br />
rpm -qa | grep mplayer<br />
rpm -qa | grep mencoder<br />
rpm -qa | grep 264<br />
</code><br />
Remove with rpm -e any libraries, common files, or binary installations of these packages to prevent conflicts.</ol>
<h1>Download All The Things</h1>
<p>One note; the official distribution release of ffmpeg-php no longer compiles. The SVN version available <a href="http://ffmpeg-php.svn.sourceforge.net/viewvc/ffmpeg-php/trunk/ffmpeg-php/">here</a> works, but the SVN tarball link <a href="http://ffmpeg-php.svn.sourceforge.net/viewvc/ffmpeg-php/trunk/ffmpeg-php/?view=tar">here</a> can&#8217;t easily be downloaded in a terminal session, so I&#8217;ve rehosted the file here on this server. This is not my file, I haven&#8217;t modified it, and I take no responsibility for it &#8211; it&#8217;s merely a copy of the file available from the above link.</p>
<ol>
<li>Let&#8217;s get started! This step can and probably should be copy/pasted into your terminal all in one block.</li>
<p><code><br />
cd /usr/local/src<br />
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz<br />
tar zxf flvtool2-1.0.6.tgz<br />
wget http://switch.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz<br />
tar zxf lame-398-2.tar.gz<br />
wget http://hasaninter.net/ffmpeg-php.tar.gz<br />
tar xzf ffmpeg-php.tar.gz<br />
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.bz2<br />
tar xjf libvorbis-1.2.3.tar.bz2<br />
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz<br />
tar xzf libogg-1.1.4.tar.gz<br />
wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz/download<br />
tar xzf opencore-amr-0.1.2.tar.gz<br />
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2<br />
tar xjf libtheora-1.1.1.tar.bz2<br />
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz<br />
tar zxf xvidcore-1.3.2.tar.gz<br />
wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz<br />
tar zxf faad2-2.7.tar.gz<br />
wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz<br />
tar zxf faac-1.28.tar.gz<br />
mkdir /usr/local/lib/codecs<br />
wget ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2<br />
tar xjf essential-20071007.tar.bz2<br />
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz<br />
tar zxf yasm-1.2.0.tar.gz<br />
cp /usr/local/src/essential-20071007/* /usr/local/lib/codecs/<br />
chmod -R 755 /usr/local/lib/codecs/<br />
mkdir /usr/local/src/tmp<br />
chmod 777 /usr/local/src/tmp<br />
export TMPDIR=/usr/local/src/tmp<br />
svn co https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac gpac<br />
git clone git://git.videolan.org/x264.git<br />
</code></p>
<li>Now it&#8217;s time to grab mplayer and ffmpeg, the latest versions possible.</li>
<p><code><br />
git clone git://git.videolan.org/ffmpeg.git ffmpeg<br />
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer<br />
</code>
</ol>
<h1>Let&#8217;s Compile This Shit!</h1>
<p>Alright, now we&#8217;re down to the good stuff &#8211; compilation! Hopefully if the above steps went correctly this will just fly by. However I do <u>not</u> recommend that you copy and paste the entire command tree into the terminal at this point. Run everything one step at a time to catch any errors if they do occur. Google is your friend, but feel free to leave a comment here if you run in to any problems.</p>
<ol>
<li>Lame</li>
<p><code><br />
cd /usr/local/src/lame-398-2/<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>Libogg</li>
<p><code><br />
cd /usr/local/src/libogg-1.1.4<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>Libvorbis</li>
<p><code><br />
cd /usr/local/src/libvorbis-1.2.3<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>yasm</li>
<p><code><br />
cd /usr/local/src/yasm-1.2.0<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>Libxvid</li>
<p><code><br />
cd /usr/local/src/xvidcore/build/generic<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>Libx264</li>
<p><code><br />
cd /usr/local/src/x264<br />
./configure --enable-shared<br />
make<br />
make install<br />
</code></p>
<li>Flvtool</li>
<p><code><br />
cd /usr/local/src/flvtool2-1.0.6<br />
ruby setup.rb config<br />
ruby setup.rb setup<br />
ruby setup.rb install<br />
</code></p>
<li>Opencore-amr</li>
<p><code><br />
cd /usr/local/src/opencore-amr-0.1.2<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>Libtheora</li>
<p><code><br />
cd /usr/local/src/libtheora-1.1.1<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>faad2</li>
<p><code><br />
cd /usr/local/src/faad2-2.7<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>faac</li>
<p><code><br />
cd /usr/local/src/faac-1.28<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>MP4Box</li>
<p><code><br />
cd /usr/local/src/gpac<br />
./configure<br />
make<br />
make install<br />
</code></p>
<li>ldconfig</li>
<p>To make sure mplayer and ffmpeg install using the correct libs, we need to make sure ld knows where to find our libraries. First, check:<br />
<code><br />
nano /etc/ld.so.conf<br />
</code><br />
Make sure that this file contains the line:<br />
<code><br />
/usr/local/lib<br />
</code><br />
If you&#8217;re on a 64-bit system you should also add:<br />
<code><br />
/usr/local/lib64<br />
</code><br />
Save (CTRL+O), exit (CTRL+W), and then update:<br />
<code><br />
ldconfig<br />
</code><br />
If you run in to any &#8220;file not found&#8221; errors, it&#8217;s probably ldconfig.</p>
<li>Mplayer &#8211; remember, this will download a new version of ffmpeg for some crazy reason. When it asks, just hit enter and allow it to download. It&#8217;s only used for compiling mplayer. We must use &#8211;yasm=&#8221; because we&#8217;ve switched from yasm to nasm and mplayer can&#8217;t deal with that.</li>
<p><code><br />
cd /usr/local/src/mplayer/<br />
./configure --enable-jpeg<br />
make<br />
make install<br />
</code></p>
<li>FFMpeg</li>
<p><code><br />
cd /usr/local/src/ffmpeg<br />
./configure --enable-libmp3lame --enable-libvorbis --enable-shared --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-libtheora --enable-version3 --enable-gpl --enable-libxvid<br />
make<br />
make install<br />
</code></p>
<li>FFMpeg-PHP &#8211; at this point you may receive an error message. To fix this error refer to the second code block.</li>
<p><code><br />
cd /usr/local/src/ffmpeg-php<br />
phpize<br />
./configure<br />
make<br />
make install<br />
</code><br />
<code><br />
nano -w ffmpeg_frame.c<br />
CTRL+W CTRL+R PIX_FMT_RGBA32 [enter] PIX_FMT_RGB32<br />
A<br />
CTRL+O CTRL+X<br />
</code><br />
What this does is replaces all instances of PIX_FMT_RGBA32 with PIX_FMT_RGB32, saves, and exits. This will happen after the &#8220;make&#8221; step &#8211; you will need to run &#8220;make&#8221; again, then &#8220;make install.&#8221;</p>
<li>php.ini &#8211; All that&#8217;s left is to modify your php.ini file! Add the following near the top of the file /usr/local/lib/php.ini (to avoid conflicts)</li>
<p><code><br />
extension=ffmpeg.so<br />
</code></p>
<li>Restart Apache</li>
<p><code>/etc/init.d/httpd restart</code>
</ol>
<h1>That&#8217;s It!</h1>
<p>At this point you should have a fully functional ffmpeg installation compiled in to PHP. You can test this with the following:</p>
<p><code><br />
php -m | grep ffmpeg</code><br />
You should get the output:<br />
<code><br />
ffmpeg<br />
</code><br />
Thank you very much to <a href="http://www.serverhostingsecrets.com/tutorials/cpanel-ffmpeg-howto/">serverhostingsecrets.com</a> for providing a very stable base for me to build this tutorial on!</p>
]]></content:encoded>
			<wfw:commentRss>http://hasaninter.net/2011/04/01/cpanel-ffmpeg-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

