<?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/"
	>

<channel>
	<title>blog.elderec.com</title>
	<atom:link href="http://blog.elderec.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.elderec.com</link>
	<description>Elderec's Blog</description>
	<pubDate>Tue, 04 Nov 2008 17:48:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.8-bleeding-edge</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing Wordpress SVN with Nginx</title>
		<link>http://blog.elderec.com/2008/11/05/installing-wordpress-svn-with-nginx/</link>
		<comments>http://blog.elderec.com/2008/11/05/installing-wordpress-svn-with-nginx/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 17:48:01 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[installation]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=41</guid>
		<description><![CDATA[Notes for installing Wordpress behind Nginx with friendly urls.
Checkout the latest version of Wordpress via subversion:

svn co http://svn.automattic.com/wordpress/trunk/ .
cp wp-config-sample.php wp-config.php

Modify the database settings in wp-config.php to match your setup. Visit http://yourdomain.com to finish the setup, login as administrator, click settings, click permalinks, put a dot in &#8220;custom structure&#8221; and enter:

/%year%/%monthnum%/%day%/%postname%/

Add the following in the [...]]]></description>
			<content:encoded><![CDATA[<p>Notes for installing <a href="http://wordpress.org/">Wordpress</a> behind <a href="http://nginx.net">Nginx</a> with friendly urls.</p>
<p>Checkout the latest version of Wordpress via subversion:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.automattic.com<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> .
<span style="color: #c20cb9; font-weight: bold;">cp</span> wp-config-sample.php wp-config.php</pre></div></div>

<p>Modify the database settings in wp-config.php to match your setup. Visit http://yourdomain.com to finish the setup, login as administrator, click settings, click permalinks, put a dot in &#8220;custom structure&#8221; and enter:</p>
<pre>
/%year%/%monthnum%/%day%/%postname%/
</pre>
<p>Add the following in the appropriate place inside your Nginx configuration file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># wordpress fancy rewrites</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-f <span style="color: #007800;">$request_filename</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #7a0874; font-weight: bold;">break</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-d <span style="color: #007800;">$request_filename</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #7a0874; font-weight: bold;">break</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
rewrite ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.+<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ <span style="color: #000000; font-weight: bold;">/</span>index.php?<span style="color: #007800;">q</span>=$<span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">last</span>;</pre></div></div>

<p>Make sure to make your uploads folder writable (assuming www-data is the nginx user):</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> your<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>location<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads
<span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data your<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>location<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/11/05/installing-wordpress-svn-with-nginx/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MediaWiki Upgrade to Subversion</title>
		<link>http://blog.elderec.com/2008/10/15/mediawiki-upgrade-to-subversion/</link>
		<comments>http://blog.elderec.com/2008/10/15/mediawiki-upgrade-to-subversion/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 22:08:17 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[backup]]></category>

		<category><![CDATA[mediawiki]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[svn]]></category>

		<category><![CDATA[update]]></category>

		<category><![CDATA[upgrade]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=80</guid>
		<description><![CDATA[Upgrading an existing MediaWiki 1.13 installation to a bleeding edge Subversion installation. This assumes you installed to the default /wiki folder as suggested in the MediaWiki installation docs.
Backup database:

mysqldump -u wiki_user -p --all-databases &#62; mediawiki_backup.sql

Move existing wiki files:

mv ./wiki ./wikiold

Download MediaWiki via Subversion:

svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 ./wiki

Copy LocalSettings.php &#038; AdminSettings.php:

cp ./wikiold/LocalSettings.php ./wiki/LocalSettings.php
cp ./wikiold/AdminSettings.php ./wiki/AdminSettings.php

If you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Upgrading an existing MediaWiki 1.13 installation to a bleeding edge Subversion installation. This assumes you installed to the default /wiki folder as suggested in the MediaWiki <a href="http://www.mediawiki.org/wiki/Installation">installation docs</a>.</p>
<p><strong>Backup database:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">mysqldump <span style="color: #660033;">-u</span> wiki_user <span style="color: #660033;">-p</span> <span style="color: #660033;">--all-databases</span> <span style="color: #000000; font-weight: bold;">&gt;</span> mediawiki_backup.sql</pre></div></div>

<p><strong>Move existing wiki files:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> .<span style="color: #000000; font-weight: bold;">/</span>wiki .<span style="color: #000000; font-weight: bold;">/</span>wikiold</pre></div></div>

<p><strong>Download MediaWiki via Subversion:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>svn.wikimedia.org<span style="color: #000000; font-weight: bold;">/</span>svnroot<span style="color: #000000; font-weight: bold;">/</span>mediawiki<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span>phase3 .<span style="color: #000000; font-weight: bold;">/</span>wiki</pre></div></div>

<p><strong>Copy LocalSettings.php &#038; AdminSettings.php:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> .<span style="color: #000000; font-weight: bold;">/</span>wikiold<span style="color: #000000; font-weight: bold;">/</span>LocalSettings.php .<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>LocalSettings.php
<span style="color: #c20cb9; font-weight: bold;">cp</span> .<span style="color: #000000; font-weight: bold;">/</span>wikiold<span style="color: #000000; font-weight: bold;">/</span>AdminSettings.php .<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>AdminSettings.php</pre></div></div>

<p><strong>If you don&#8217;t have AdminSettings.php:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> .<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>AdminSettings.sample .<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>AdminSettings.php</pre></div></div>

<p>Edit AdminSettings.php to include the mysql username &#038; password your MediaWiki installation uses.</p>
<p><strong>Run the MediaWiki upgrade script:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">php .<span style="color: #000000; font-weight: bold;">/</span>wiki<span style="color: #000000; font-weight: bold;">/</span>maintenance<span style="color: #000000; font-weight: bold;">/</span>update.php</pre></div></div>

<p>Done. Now updates are as simple as running &#8220;svn update&#8221; in the MediaWiki folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/10/15/mediawiki-upgrade-to-subversion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cygwin SSH Pre Shared Keys and Putty</title>
		<link>http://blog.elderec.com/2008/10/04/cygwin-ssh-pre-shared-keys-and-putty/</link>
		<comments>http://blog.elderec.com/2008/10/04/cygwin-ssh-pre-shared-keys-and-putty/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 17:07:29 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[administration]]></category>

		<category><![CDATA[cygwin]]></category>

		<category><![CDATA[key]]></category>

		<category><![CDATA[openssh]]></category>

		<category><![CDATA[password]]></category>

		<category><![CDATA[passwordless]]></category>

		<category><![CDATA[shared]]></category>

		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=68</guid>
		<description><![CDATA[On the Cygwin machine:
Generate SSH keys, since we&#8217;re going for password less logins, just hit enter on the prompts for passphrase:

cd ~
ssh-keygen.exe -t rsa

Copy the key to the remote machine:

scp ~/.ssh/id_rsa.pub username@remotemachine:/home/username/id_rsa.pub

On the remote machine:
Move the key and set permissions:

mkdir ~/.ssh
mv ~/id_rsa.pub ~/.ssh/authorized_keys
chown -R username:username /home/username/.ssh
chmod 700 /home/username/.ssh
chmod 600 /home/username/.ssh/authorized_keys

You should now be able to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>On the Cygwin machine:</strong></p>
<p>Generate SSH keys, since we&#8217;re going for password less logins, just hit enter on the prompts for passphrase:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~
ssh-keygen.exe <span style="color: #660033;">-t</span> rsa</pre></div></div>

<p>Copy the key to the remote machine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">scp</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub username<span style="color: #000000; font-weight: bold;">@</span>remotemachine:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>username<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub</pre></div></div>

<p><strong>On the remote machine:</strong></p>
<p>Move the key and set permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh
<span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> username:username <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>username<span style="color: #000000; font-weight: bold;">/</span>.ssh
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>username<span style="color: #000000; font-weight: bold;">/</span>.ssh
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>username<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys</pre></div></div>

<p>You should now be able to login to the remote machine without a passphrase:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> username<span style="color: #000000; font-weight: bold;">@</span>remotemachine</pre></div></div>

<p>I&#8217;ve also found it handy to use Putty to run CygWin. There is a modified version of Putty called <a href="http://code.google.com/p/puttycyg/">PuTTYcyg</a> available at google code that you can use to launch Cygwin, as described in the PuTTYcyg FAQ <a href="http://code.google.com/p/puttycyg/wiki/FAQ">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/10/04/cygwin-ssh-pre-shared-keys-and-putty/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reset passwords in Wordpress, MediaWiki, Gallery2, Coppermine, PHPNuke, and Joomla</title>
		<link>http://blog.elderec.com/2008/09/11/reset-passwords-in-wordpress-mediawiki-gallery2-coppermine-phpnuke-and-joomla/</link>
		<comments>http://blog.elderec.com/2008/09/11/reset-passwords-in-wordpress-mediawiki-gallery2-coppermine-phpnuke-and-joomla/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 15:41:24 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[SQL]]></category>

		<category><![CDATA[account]]></category>

		<category><![CDATA[apps]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[password]]></category>

		<category><![CDATA[passwords]]></category>

		<category><![CDATA[queries]]></category>

		<category><![CDATA[query]]></category>

		<category><![CDATA[reset]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=60</guid>
		<description><![CDATA[Here are some SQL statements to reset passwords in various popular open source web applications. 
Reset Coppermine user password:

UPDATE `cpg_users` SET `user_password` = MD5&#40; 'newpassword' &#41; WHERE `cpg_users`.`user_name` = &#34;tehusername&#34;;

Change Gallery2 user email address:

UPDATE `g2_User` SET `g_email` = 'new_email' WHERE `g2_User`.`g_userName` = 'tehusername' LIMIT 1 ;

Reset PHPNuke user password:

UPDATE `nuke_users` SET `user_password` = MD5&#40; 'newpassword' [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some SQL statements to reset passwords in various popular open source web applications. </p>
<p><strong>Reset Coppermine user password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`cpg_users`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`user_password`</span> <span style="color: #66cc66;">=</span> MD5<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'newpassword'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`cpg_users`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`user_name`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;tehusername&quot;</span>;</pre></div></div>

<p><strong>Change Gallery2 user email address:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`g2_User`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`g_email`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'new_email'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`g2_User`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`g_userName`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'tehusername'</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span> ;</pre></div></div>

<p><strong>Reset PHPNuke user password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`nuke_users`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`user_password`</span> <span style="color: #66cc66;">=</span> MD5<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'newpassword'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`nuke_users`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`username`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;tehusername&quot;</span>;</pre></div></div>

<p><strong>Reset Wordpress user password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`wp_users`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`user_pass`</span> <span style="color: #66cc66;">=</span> MD5<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'newpassword'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`wp_users`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`user_login`</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;tehusername&quot;</span>;</pre></div></div>

<p><strong>Reset Drupal administrator password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`users`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`pass`</span> <span style="color: #66cc66;">=</span> MD5<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #ff0000;">`uid`</span> <span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span>;</pre></div></div>

<p><strong>Reset Joomla administrator password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> mos_users <span style="color: #993333; font-weight: bold;">SET</span> password <span style="color: #66cc66;">=</span> MD5<span style="color: #66cc66;">&#40;</span> ‘newspassword‘ <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> username <span style="color: #66cc66;">=</span> ‘admin’;</pre></div></div>

<p><strong>Reset MediaWiki user password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> user <span style="color: #993333; font-weight: bold;">SET</span> user_password<span style="color: #66cc66;">=</span>md5<span style="color: #66cc66;">&#40;</span>concat<span style="color: #66cc66;">&#40;</span>user_id<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'-'</span><span style="color: #66cc66;">,</span>md5<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> user_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;TehUsername&quot;</span>;</pre></div></div>

<p><strong>Reset MediaWiki administrator password:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> user <span style="color: #993333; font-weight: bold;">SET</span> user_password<span style="color: #66cc66;">=</span>md5<span style="color: #66cc66;">&#40;</span>concat<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'1-'</span><span style="color: #66cc66;">,</span>md5<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> user_id<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span>;</pre></div></div>

<p><strong>Create MediaWiki user (usernames must begin with a capital letter):</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> user<span style="color: #66cc66;">&#40;</span>user_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;TehUsername&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">UPDATE</span> user <span style="color: #993333; font-weight: bold;">SET</span> user_password<span style="color: #66cc66;">=</span>md5<span style="color: #66cc66;">&#40;</span>concat<span style="color: #66cc66;">&#40;</span>user_id<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'-'</span><span style="color: #66cc66;">,</span>md5<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'newpassword'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">WHERE</span> user_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;TehUsername&quot;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/09/11/reset-passwords-in-wordpress-mediawiki-gallery2-coppermine-phpnuke-and-joomla/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GNU Screen .screenrc file</title>
		<link>http://blog.elderec.com/2008/09/10/gnu-screen-screenrc-file/</link>
		<comments>http://blog.elderec.com/2008/09/10/gnu-screen-screenrc-file/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 18:58:48 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[console]]></category>

		<category><![CDATA[gnu]]></category>

		<category><![CDATA[multi-tasking]]></category>

		<category><![CDATA[screen]]></category>

		<category><![CDATA[screenrc]]></category>

		<category><![CDATA[shell]]></category>

		<category><![CDATA[terminal]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=54</guid>
		<description><![CDATA[Here is a copy of the .screenrc file I use on all the Linux machines I use. I&#8217;m not sure what I&#8217;d do without it.
If you&#8217;re using Ubuntu and you&#8217;re feeling lazy:

apt-get install screen
wget http://blog.elderec.com/wp-content/uploads/2008/09/screenrc.txt -O ~/.screenrc

Otherwise here are the contents of the .screenrc file.

# Bind F11 and F12 (NOT F1 and F2) to previous [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a copy of the .screenrc file I use on all the Linux machines I use. I&#8217;m not sure what I&#8217;d do without it.</p>
<p>If you&#8217;re using Ubuntu and you&#8217;re feeling lazy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">screen</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>blog.elderec.com<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2008</span><span style="color: #000000; font-weight: bold;">/</span>09<span style="color: #000000; font-weight: bold;">/</span>screenrc.txt <span style="color: #660033;">-O</span> ~<span style="color: #000000; font-weight: bold;">/</span>.screenrc</pre></div></div>

<p>Otherwise here are the contents of the .screenrc file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Bind F11 and F12 (NOT F1 and F2) to previous and next screen window</span>
bindkey <span style="color: #660033;">-k</span> F1 prev
bindkey <span style="color: #660033;">-k</span> F2 next
&nbsp;
<span style="color: #666666; font-style: italic;"># Window list at the bottom.</span>
hardstatus alwayslastline
hardstatus string <span style="color: #ff0000;">'%{= mK}%-Lw%{= KW}%50&gt;%n%f* %t%{= mK} %+Lw%&lt; %{= kG}%-=%D %d %M %Y %c:%s%{-}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># set the size of the scrollback buffer to 99999 lines (default is 100)</span>
defscrollback <span style="color: #000000;">99999</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Filename for the paste buffer</span>
bufferfile <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>elderec<span style="color: #000000; font-weight: bold;">/</span>screen_buffer.txt
&nbsp;
<span style="color: #666666; font-style: italic;"># turn off the startup message</span>
startup_message off
&nbsp;
<span style="color: #666666; font-style: italic;"># Autodetach session on hangup instead of terminating screen completely</span>
autodetach on
&nbsp;
<span style="color: #666666; font-style: italic;">#midnight commander fix</span>
altscreen on</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/09/10/gnu-screen-screenrc-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install Subversion Trac Nginx on Ubuntu Hardy</title>
		<link>http://blog.elderec.com/2008/09/06/install-subversion-trac-nginx-on-ubuntu-hardy/</link>
		<comments>http://blog.elderec.com/2008/09/06/install-subversion-trac-nginx-on-ubuntu-hardy/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 17:17:30 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[hardy]]></category>

		<category><![CDATA[installation]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[trac]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=15</guid>
		<description><![CDATA[The following are my notes for setting up is Subversion &#038; Trac behind Nginx. I&#8217;m sure there are other ways to do this, but this is what I did, and it worked for me.
Install Python Setup Tools, Subversion, and TRAC:

aptitude install python-setuptools subversion python-subversion
easy_install trac

Create a subversion repository:

mkdir /var/lib/svn
mkdir /var/lib/svn/repositories
svnadmin create /var/lib/svn/repositories/ProjectName
chown -R www-data /var/lib/svn

Edit [...]]]></description>
			<content:encoded><![CDATA[<p>The following are my notes for setting up is <a href="http://subversion.tigris.org/">Subversion</a> &#038; <a href="http://trac.edgewall.org/">Trac</a> behind <a href="http://nginx.net/">Nginx</a>. I&#8217;m sure there are other ways to do this, but this is what I did, and it worked for me.</p>
<p>Install Python Setup Tools, Subversion, and TRAC:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-setuptools subversion python-subversion
easy_install trac</pre></div></div>

<p>Create a subversion repository:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>repositories
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>ProjectName
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span></pre></div></div>

<p>Edit /var/lib/svn/repositories/ProjectName/conf/svnserve.conf and change to the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">anon-access = none
auth-access = <span style="color: #c20cb9; font-weight: bold;">write</span>
password-db = <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>ProjectName<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span>
realm = ProjectName</pre></div></div>

<p>Edit /var/lib/svn/ProjectName/passwd:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">users</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
yourusername = yourpassword</pre></div></div>

<p>Create init.d script to startup svnserve on boot, /etc/init.d/svnserve :</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This starts and stops svnserv. Put this in /etc/init.d/svnserve.</span>
<span style="color: #666666; font-style: italic;"># This works on both Ubuntu and RedHat systems.</span>
<span style="color: #666666; font-style: italic;"># On Ubuntu, run &quot;update-rc.d svnserve defaults&quot; to install this on startup.</span>
<span style="color: #666666; font-style: italic;"># On RedHat, run &quot;chkconfig --add svnserve&quot; to install this on startup.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># $Id: svnserve 98 2007-10-30 22:01:36Z noah $</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 2345 90 10</span>
<span style="color: #666666; font-style: italic;"># description: svnserve daemon start script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Use the following variables to customize user, group, and paths.</span>
<span style="color: #007800;">SVNSERVE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">svnserve</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">SVN_USER</span>=<span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #007800;">SVN_GROUP</span>=<span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #007800;">SVN_ROOT_PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #666666; font-style: italic;"># RedHat style</span>
    . <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
    <span style="color: #007800;">START</span>=<span style="color: #ff0000;">&quot;daemon $SVNSERVE -d --root $SVN_ROOT_PATH&quot;</span>
    <span style="color: #007800;">STOP</span>=<span style="color: #ff0000;">&quot;killproc $SVNSERVE&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #666666; font-style: italic;"># Ubuntu LSB style</span>
    . <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lsb<span style="color: #000000; font-weight: bold;">/</span>init-functions
    <span style="color: #007800;">START</span>=<span style="color: #ff0000;">&quot;start-stop-daemon --start --exec $SVNSERVE -- -d --root $SVN_ROOT_PATH&quot;</span>
    <span style="color: #007800;">STOP</span>=<span style="color: #ff0000;">&quot;start-stop-daemon --stop --exec $SVNSERVE&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$SVNSERVE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Could not find ${SVNSERVE}. PATH is ${PATH}&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> 0
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting svnserve...&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">umask</span> 002
        <span style="color: #007800;">$START</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Started svnserve&quot;</span>
            <span style="color: #7a0874; font-weight: bold;">exit</span> 0
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
    ;;
&nbsp;
    stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Stopping svnserve...&quot;</span>
        <span style="color: #007800;">$STOP</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
    ;;
&nbsp;
    restart|force-reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #ff0000;">&quot;$0&quot;</span> stop <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #ff0000;">&quot;$0&quot;</span> start
    ;;
&nbsp;
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
    ;;
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Unhandled case while trying to start svnserve.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;see $0&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">3</span></pre></div></div>

<p>Make it startup on boot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d
update-rc.d <span style="color: #c20cb9; font-weight: bold;">svnserve</span> defaults</pre></div></div>

<p>Ok, subversion is done, now lets create a trac environment.</p>
<p>Create a place for our trac environments to live:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac</pre></div></div>

<p>Create Trac environment:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac
trac-admin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>ProjectName initenv
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac</pre></div></div>

<p>The &#8220;trac-admin&#8221; command shown above prompted me to enter:</p>
<ul>
<li>the project name (ProjectName)</li>
<li>the path to svn repository (/var/lib/svn/ProjectName) </li>
</ul>
<p>Add a user with the Apache htpasswd tool:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">/</span>.htpasswd youruser</pre></div></div>

<p>Startup the trac standalone server tracd:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">tracd <span style="color: #660033;">-d</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">3050</span> --basic-<span style="color: #007800;">auth</span>=<span style="color: #7a0874; font-weight: bold;">test</span>,<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>ProjectName<span style="color: #000000; font-weight: bold;">/</span>.htpasswd,<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>ProjectName <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>ProjectName --<span style="color: #007800;">pidfile</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>tracd.3050</pre></div></div>

<p>Create admin account and revoke almost all anonymous permissions from trac:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">trac-admin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/&lt;</span>environment name<span style="color: #000000; font-weight: bold;">&gt;</span> permission add youruser TRAC_ADMIN
trac-admin <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/&lt;</span>environment name<span style="color: #000000; font-weight: bold;">&gt;</span> permission remove anonymous BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY</pre></div></div>

<p>If you have an iptables setup or other firewall, don&#8217;t forget to allow connections to port 3690. Assuming your using slicehost like me, you can do the following:</p>
<p>Edit /etc/iptables.test.rules and add the following before any final LOG &#038; REJECT rules:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Allows svnserve connections from anywhere</span>
<span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">3690</span> <span style="color: #660033;">-j</span> ACCEPT</pre></div></div>

<p>Activate the changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">iptables-restore <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>iptables.test.rules</pre></div></div>

<p>Save the changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">iptables-save <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>iptables.up.rules</pre></div></div>

<p>Startup SVNserve:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svnserve</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>ProjectName</pre></div></div>

<p>Make SVNserve startup on reboot add the following to your crontab:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">crontab <span style="color: #660033;">-e</span>
<span style="color: #000000; font-weight: bold;">@</span>reboot <span style="color: #c20cb9; font-weight: bold;">svnserve</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">/</span>ProjectName</pre></div></div>

<p>You should now be able to checkin/checkout from your repository &#038; visit http://trac.example.com to see your trac environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/09/06/install-subversion-trac-nginx-on-ubuntu-hardy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XBMC thumbnails via bash script</title>
		<link>http://blog.elderec.com/2008/08/31/xbmc-thumbnails-via-bash-script/</link>
		<comments>http://blog.elderec.com/2008/08/31/xbmc-thumbnails-via-bash-script/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 16:24:20 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[avi]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[ffmpeg]]></category>

		<category><![CDATA[media]]></category>

		<category><![CDATA[script]]></category>

		<category><![CDATA[thumbnail]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=24</guid>
		<description><![CDATA[Simple bash script to create thumbnails for XBMC from avi files. Requires ffmpeg.
xbmcthumb.sh

&#160;
#!/bin/sh
if &#91; $2 eq &#34;&#34; &#93;; then
	NUMSEC = 300
else 
	NUMSEC = $2
fi
&#160;
for NAME in $&#40;find $1 -type f -name '*.avi'&#41;
do
        ffmpeg -i &#34;$NAME&#34; -f mjpeg -t 0.001 -ss $NUMSEC -y $1/$&#40;basename &#34;$NAME&#34; .avi&#41;.tbn
done


chmod +x xbmcthumb.sh
./xbmcthumb.sh /folder/with/avi/files/in/it

]]></description>
			<content:encoded><![CDATA[<p>Simple bash script to create thumbnails for XBMC from avi files. Requires <a href="http://ffmpeg.mplayerhq.hu/">ffmpeg</a>.</p>
<p>xbmcthumb.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #000000;">2</span> eq <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	NUMSEC = <span style="color: #000000;">300</span>
<span style="color: #000000; font-weight: bold;">else</span> 
	NUMSEC = $<span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> NAME <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> $<span style="color: #000000;">1</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.avi'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;$NAME&quot;</span> <span style="color: #660033;">-f</span> mjpeg <span style="color: #660033;">-t</span> <span style="color: #000000;">0.001</span> <span style="color: #660033;">-ss</span> <span style="color: #007800;">$NUMSEC</span> <span style="color: #660033;">-y</span> $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;$NAME&quot;</span> .avi<span style="color: #7a0874; font-weight: bold;">&#41;</span>.tbn
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x xbmcthumb.sh
.<span style="color: #000000; font-weight: bold;">/</span>xbmcthumb.sh <span style="color: #000000; font-weight: bold;">/</span>folder<span style="color: #000000; font-weight: bold;">/</span>with<span style="color: #000000; font-weight: bold;">/</span>avi<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight: bold;">in</span><span style="color: #000000; font-weight: bold;">/</span>it</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/08/31/xbmc-thumbnails-via-bash-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ubuntu Hardy Nginx PHP5 FastCGI</title>
		<link>http://blog.elderec.com/2008/07/16/ubuntu-hardy-nginx-php5-fastcgi/</link>
		<comments>http://blog.elderec.com/2008/07/16/ubuntu-hardy-nginx-php5-fastcgi/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 19:01:02 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[cgi]]></category>

		<category><![CDATA[fastcgi]]></category>

		<category><![CDATA[fcgi]]></category>

		<category><![CDATA[lighthttpd]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[php5]]></category>

		<category><![CDATA[slice]]></category>

		<category><![CDATA[slicehost]]></category>

		<category><![CDATA[spawn-fcgi]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=5</guid>
		<description><![CDATA[Setup nginx, with php5 via FastCGI, and MySQL. The instructions below assume you have SU access and nginx already setup and running.
Install MySQL:

aptitude install mysql-server mysql-client libmysqlclient15-dev

Install PHP5

aptitude install php5-common php5-cgi php5-mysql php5-cli

To get PHP as FastCGI working with Nginx, we first have to spawn the fcgi process. There are a couple of different ways [...]]]></description>
			<content:encoded><![CDATA[<p>Setup nginx, with php5 via FastCGI, and MySQL. The instructions below assume you have SU access and nginx already setup and running.</p>
<p><strong>Install MySQL:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server mysql-client libmysqlclient15-dev</pre></div></div>

<p><strong>Install PHP5</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-common php5-cgi php5-mysql php5-cli</pre></div></div>

<p>To get PHP as FastCGI working with Nginx, we first have to spawn the fcgi process. There are a couple of different ways to do that. I used the spawn-fcgi app included with lighttpd. So we&#8217;re going to compile lighthttpd, but not install it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.lighttpd.net<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>lighttpd-1.4.19.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf lighttpd-1.4.19.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> lighttpd-1.4.18.tar.gz
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> src<span style="color: #000000; font-weight: bold;">/</span>spawn-fcgi <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>spawn-fcgi</pre></div></div>

<p>Now we&#8217;ll create a script to launch the FastCGI process and have it listen on 127.0.0.1 port 9000, located at /usr/bin/php5-fastcgi</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>spawn-fcgi <span style="color: #660033;">-a</span> 127.0.0.1 <span style="color: #660033;">-p</span> <span style="color: #000000;">9000</span> <span style="color: #660033;">-u</span> www-data <span style="color: #660033;">-g</span> www-data <span style="color: #660033;">-C</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5-cgi</pre></div></div>

<p>Then we give it permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5-fastcgi</pre></div></div>

<p>SymLink it to php-fastcgi:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5-fastcgi <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-fastcgi</pre></div></div>

<p>Now we create a init.d script /etc/init.d/fastcgi</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">PHP_SCRIPT</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php-fastcgi
<span style="color: #007800;">RETVAL</span>=0
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
	start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting fastcgi&quot;</span>
		<span style="color: #007800;">$PHP_SCRIPT</span>
		<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  ;;
	stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Stopping fastcgi&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-9</span> php5-cgi
		<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  ;;
	restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Restarting fastcgi&quot;</span>
		<span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-9</span> php5-cgi
		<span style="color: #007800;">$PHP_SCRIPT</span>
		<span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  ;;
	<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: php-fastcgi {start|stop|restart}&quot;</span>
		<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
  ;;
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$RETVAL</span></pre></div></div>

<p>Give it permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>fastcgi</pre></div></div>

<p>Start it up:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>fastcgi start</pre></div></div>

<p>And you should see something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">Starting fastcgi
spawn-fcgi.c.197: child spawned successfully: PID: <span style="color: #000000;">19026</span></pre></div></div>

<p>Now lets make it run on system boot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">update-rc.d fastcgi defaults</pre></div></div>

<p>Create the FastCGI configuration file for nginx /usr/local/nginx/fastcgi.conf</p>

<div class="wp_syntax"><div class="code"><pre class="apache apache" style="font-family:monospace;">fastcgi_param  GATEWAY_INTERFACE  CGI/<span style="color: #ff0000;">1.1</span>;
fastcgi_param  SERVER_SOFTWARE    nginx;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;</pre></div></div>

<p>Make nginx pass the .php files to our FastCGI socket:</p>

<div class="wp_syntax"><div class="code"><pre class="apache apache" style="font-family:monospace;"><span style="color: #00007f;">location</span> ~ \.php$ {
&nbsp;
    fastcgi_pass   127.0.0.1:<span style="color: #ff0000;">9000</span>;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /var/www/<span style="color: #00007f;">example</span>.com/public_html$fastcgi_script_name;
    <span style="color: #00007f;">include</span>        /usr/local/nginx/fastcgi.conf;
&nbsp;
        }</pre></div></div>

<p>Bling, you should be good to go. I&#8217;ll discuss MySQL tuning in another article.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/07/16/ubuntu-hardy-nginx-php5-fastcgi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install Nginx from source on Ubuntu Hardy with SSL</title>
		<link>http://blog.elderec.com/2008/07/15/install-nginx-from-source-on-ubuntu-hardy-with-ssl/</link>
		<comments>http://blog.elderec.com/2008/07/15/install-nginx-from-source-on-ubuntu-hardy-with-ssl/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 18:12:54 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[hardy]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[server]]></category>

		<category><![CDATA[source]]></category>

		<category><![CDATA[ssl]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=8</guid>
		<description><![CDATA[These are my notes for installing Nginx on Ubuntu Hardy 8.04 Server with SSL support. This was pieced this together from many different sources, thanks everyone for their help.
Install prerequisites:

aptitude install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev build-essential

Download, configure, and install Nginx:

mkdir ~/sources
cd ~/sources
wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz
tar -zxvf nginx-0.6.31.tar.gz
cd nginx-0.6.31/
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make
make install

Installation complete, lets start it up:

/usr/local/sbin/nginx

Visit [...]]]></description>
			<content:encoded><![CDATA[<p>These are my notes for installing <a href="http://nginx.net">Nginx</a> on Ubuntu Hardy 8.04 Server with SSL support. This was pieced this together from many different sources, thanks everyone for their help.</p>
<p>Install prerequisites:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev build-essential</pre></div></div>

<p>Download, configure, and install Nginx:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>sources
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>sources
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sysoev.ru<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx-0.6.31.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> nginx-0.6.31.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> nginx-0.6.31<span style="color: #000000; font-weight: bold;">/</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure --sbin-<span style="color: #007800;">path</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>sbin --with-http_ssl_module
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Installation complete, lets start it up:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></div></div>

<p>Visit http://example.com and you should see the &#8220;Welcome to Nginx&#8221; page. Congrats! Now lets stop it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>nginx.pid<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>Now we&#8217;ll create an INIT script so we can start/stop/restart it just like Apache, save this as /etc/init.d/nginx</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #666666; font-style: italic;"># Provides:          nginx</span>
<span style="color: #666666; font-style: italic;"># Required-Start:    $all</span>
<span style="color: #666666; font-style: italic;"># Required-Stop:     $all</span>
<span style="color: #666666; font-style: italic;"># Default-Start:     2 3 4 5</span>
<span style="color: #666666; font-style: italic;"># Default-Stop:      0 1 6</span>
<span style="color: #666666; font-style: italic;"># Short-Description: starts the nginx web server</span>
<span style="color: #666666; font-style: italic;"># Description:       starts nginx using start-stop-daemon</span>
<span style="color: #666666; font-style: italic;">### END INIT INFO</span>
&nbsp;
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #007800;">DAEMON</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx
<span style="color: #007800;">NAME</span>=nginx
<span style="color: #007800;">DESC</span>=nginx
&nbsp;
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$DAEMON</span> || <span style="color: #7a0874; font-weight: bold;">exit</span> 0
&nbsp;
<span style="color: #666666; font-style: italic;"># Include nginx defaults if available</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>nginx <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
        . <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>nginx
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-e</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
  start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Starting $DESC: &quot;</span>
        start-stop-daemon <span style="color: #660033;">--start</span> <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--pidfile</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>.pid \
                <span style="color: #660033;">--exec</span> <span style="color: #007800;">$DAEMON</span> <span style="color: #660033;">--</span> <span style="color: #007800;">$DAEMON_OPTS</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
        ;;
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Stopping $DESC: &quot;</span>
        start-stop-daemon <span style="color: #660033;">--stop</span> <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--pidfile</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>.pid \
                <span style="color: #660033;">--exec</span> <span style="color: #007800;">$DAEMON</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
        ;;
&nbsp;
  restart|force-reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Restarting $DESC: &quot;</span>
        start-stop-daemon <span style="color: #660033;">--stop</span> <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--pidfile</span> \
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>.pid <span style="color: #660033;">--exec</span> <span style="color: #007800;">$DAEMON</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
        start-stop-daemon <span style="color: #660033;">--start</span> <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--pidfile</span> \
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>.pid <span style="color: #660033;">--exec</span> <span style="color: #007800;">$DAEMON</span> <span style="color: #660033;">--</span> <span style="color: #007800;">$DAEMON_OPTS</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
        ;;
  reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Reloading $DESC configuration: &quot;</span>
      start-stop-daemon <span style="color: #660033;">--stop</span> <span style="color: #660033;">--signal</span> HUP <span style="color: #660033;">--quiet</span> <span style="color: #660033;">--pidfile</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>.pid \
          <span style="color: #660033;">--exec</span> <span style="color: #007800;">$DAEMON</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
      ;;
  <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #007800;">N</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$NAME</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $N {start|stop|restart|reload|force-reload}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
        ;;
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> 0</pre></div></div>

<p>Give it some permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></div></div>

<p>Make Nginx startup on system boot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>update-rc.d <span style="color: #660033;">-f</span> nginx defaults</pre></div></div>

<p>Setup rotation of the nginx logs:</p>
<p>/etc/logrotate.d/nginx</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/*</span>.log <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        daily
        missingok
        rotate <span style="color: #000000;">30</span>
        compress
        delaycompress
        notifempty
        create <span style="color: #000000;">640</span> root adm
        sharedscripts
        postrotate
                <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>nginx.pid <span style="color: #7a0874; font-weight: bold;">&#93;</span> || <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #660033;">-USR1</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>nginx.pid<span style="color: #000000; font-weight: bold;">`</span>
        endscript
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Now you can start,stop, &amp; restart nginx like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nginx start
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nginx stop
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nginx restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/07/15/install-nginx-from-source-on-ubuntu-hardy-with-ssl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Wordpress installs are fun</title>
		<link>http://blog.elderec.com/2008/07/08/new-wordpress-installs-are-fun/</link>
		<comments>http://blog.elderec.com/2008/07/08/new-wordpress-installs-are-fun/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 18:57:11 +0000</pubDate>
		<dc:creator>elderec</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[flickr]]></category>

		<category><![CDATA[openid]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[recaptcha]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.elderec.com/?p=30</guid>
		<description><![CDATA[Still playing around, have enabled reCAPTCHA, OpenID login support, and movie reviews. However, I&#8217;m still trying to find a decent Flickr plugin.
]]></description>
			<content:encoded><![CDATA[<p>Still playing around, have enabled reCAPTCHA, OpenID login support, and movie reviews. However, I&#8217;m still trying to find a decent Flickr plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.elderec.com/2008/07/08/new-wordpress-installs-are-fun/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
