<?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>aBinaryMind &#187; Linux/Unix</title>
	<atom:link href="http://www.abinarymind.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abinarymind.com</link>
	<description>Some thoughts, some info, some rants</description>
	<lastBuildDate>Wed, 30 Jun 2010 15:36:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Redmine installation guide</title>
		<link>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/</link>
		<comments>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:14:52 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=131</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>This is a guide to install Redmine (svn trunk) on Ubuntu 9.10.</p>
<p>The assumed location of Redmine is <em>/srv/redmine</em></p>
<h3>Phase 1: Setup Redmine</h3>
<p><strong>Step 1</strong><br />
Install required packages.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ruby rake ruby-dev rubygems libmysqlclient-dev libopenssl-ruby</div></div>
<p><strong>Step 2</strong><br />
Check out Redmine trunk.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>srv<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>redmine.rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk redmine</div></div>
<p><strong>Step 3</strong><br />
Install required ruby gems:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails mongrel mongrel_cluster daemons mysql actionmailer</div></div>
<p>Note 1: We may need to update Rails RAILS_GEM_VERSION in file <em>[redmine]/config/environment.rb</em> to reflect actual version of Rails gems installed.</p>
<p>Note 2: We may need to create soft link for rails &amp; mongrel executables for convenient</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</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>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mongrel_rails <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</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>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rails <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</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>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster_ctl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p><strong>Step 4</strong><br />
Create mysql database</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span><br />
<span style="color: #666666; font-style: italic;"># Enter mysql root password when prompted</span></div></div>
<p>Run the following code in mysql, substitute your own database name, password, &#8230;</p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> redmine character <span style="color: #993333; font-weight: bold;">SET</span> utf8;<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> user <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'my_password'</span>;<br />
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> privileges <span style="color: #993333; font-weight: bold;">ON</span> redmine<span style="color: #66cc66;">.*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'redmine'</span>@<span style="color: #ff0000;">'localhost'</span>;</div></div>
<p><strong>Step 5</strong><br />
Create/Update database parameters in <em>[redmine]/config/database.yml</em> accordingly to prior step info.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">production:<br />
adapter: mysql<br />
database: redmine<br />
host: localhost<br />
username: redmine<br />
password: my_password<br />
encoding: utf8</div></div>
<p><strong>Step 6</strong><br />
Initialize the database</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Initialize session hash</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> rake config<span style="color: #000000; font-weight: bold;">/</span>initializers<span style="color: #000000; font-weight: bold;">/</span>session_store.rb</div></div>
<p># Load db schema<br />
$ sudo rake db:migrate RAILS_ENV=&#8221;production&#8221;</p>
<p>$ sudo rake redmine:load_default_data RAILS_ENV=&#8221;production&#8221;</p>
<p><strong>Step 7</strong><br />
Create redmine user &amp; setting up directory permission</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Context: root:[redmine_dir]</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> useradd redmine<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> redmine:redmine &nbsp;files log tmp<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> files log tmp public</div></div>
<p><strong>Step 8</strong><br />
Testing the application server</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ruby script<span style="color: #000000; font-weight: bold;">/</span>server <span style="color: #660033;">-e</span> production</div></div>
<p>The server is listening on [http://localhost:3000].</p>
<h3>Phase 2: Setup Apache &amp; Mongrel Cluster</h3>
<p><strong>Step 1</strong><br />
Create mongrel cluster configuration files for Redmine.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> mongrel_rails cluster::configure <span style="color: #660033;">-e</span> production <span style="color: #660033;">-p</span> <span style="color: #000000;">3000</span> <span style="color: #660033;">-N</span> <span style="color: #000000;">3</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>redmine <span style="color: #660033;">-a</span> 127.0.0.1 <span style="color: #660033;">--user</span> redmine <span style="color: #660033;">--group</span> redmine</div></div>
<p># Test mongrel_installation<br />
$ sudo mongrel_rails cluster::start</p>
<p><strong>Step 2</strong><br />
Create apache virtual host file at <strong>/etc/apache/sites-available/</strong></p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">ServerName</span> your.virtual-host.com<br />
<span style="color: #00007f;">DocumentRoot</span> /srv/redmine</div></div>
<p>AllowOverride FileInfo Indexes</p>
<p>RewriteEngine On</p>
<p># Redirect all non-static requests to Mongrel<br />
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f<br />
RewriteRule ^/(.*)$ balancer://redmine_cluster%{REQUEST_URI} [P,QSA,L]</p>
<p>ProxyPassReverse / balancer://redmine_cluster<br />
ProxyPreserveHost on<br />
BalancerMember http://localhost:3000<br />
BalancerMember http://localhost:3001<br />
BalancerMember http://localhost:3002<br />
Order deny,allow<br />
Allow from all</p>
<p># Block access to .svn directories</p>
<p>ErrorDocument 403 /404.html<br />
Order allow,deny<br />
Deny from all<br />
Satisfy All</p>
<p><strong>Step 3</strong><br />
Turn on the virtual host and required modules</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy_http<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy_balancer<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite</div></div>
<p># Restart web server<br />
$ sudo /etc/init.d/apache2 restart</p>
<h3>Phase 3: Surviving the reboot &amp; G!Mail SMTP</h3>
<h3><strong>Step 1</strong><br />
Create global mongrel_cluster configuration</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<br />
$ <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>mongrel_cluster<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>srv<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster.yml <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster<span style="color: #000000; font-weight: bold;">/</span>redmine.yml</div></div>
<p><strong>Step 2</strong><br />
Update the services</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <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<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</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>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster-1.0.5<span style="color: #000000; font-weight: bold;">/</span>resources<span style="color: #000000; font-weight: bold;">/</span>mongrel_cluster <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><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>mongrel_cluster<br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <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> mongrel_cluster defaults</div></div>
<p>Step 3<br />
Configure G!Mail</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ruby script<span style="color: #000000; font-weight: bold;">/</span>plugin <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>collectiveidea<span style="color: #000000; font-weight: bold;">/</span>action_mailer_optional_tls.git</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># File: config/email.yml<br />
production:<br />
delivery_method: :smtp<br />
smtp_settings:<br />
tls: true<br />
address: &quot;smtp.gmail.com&quot;<br />
port: '587'<br />
domain: &quot;smtp.gmail.com&quot;<br />
authentication: :plain<br />
user_name: &quot;your_email@gmail.com&quot;<br />
password: &quot;your_password&quot;</div></div>
</h3>
<h3>References</h3>
<ol>
<li>http://www.redmine.org/wiki/redmine/RedmineInstall</li>
<li>http://ubuntuforums.org/showthread.php?t=674598</li>
<li>http://azureusonrails.rubyforge.org/wiki/wiki.pl?Install/Mongrel_Cluster_With_Apache_2.2</li>
<li>http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/12/redmine-installation-guide-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Automatic virtual host with Apache</title>
		<link>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/</link>
		<comments>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 04:35:02 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[virtualhost]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=95</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>When developing with CakePHP, we can setup Apache to automatically redirect a domain to a specific CakePHP application.</p>
<p>We can set computer&#8217;s aliases using <a href="http://en.wikipedia.org/wiki/Hosts_file">hosts file</a>. Apache will automatically map aliases to different DocumentRoot:</p>
<p><strong>app1.mybox.com</strong> -&gt; /var/www/cakephp/<strong>app1.mybox.com</strong>/webroot<br />
<strong>app2.somewhere.com</strong> -&gt; /var/www/cakephp/<strong>app2.somewhere.com</strong>/webroot</p>
<p><strong>Step 1:</strong> Enable the mod_vhost_alias:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo a2enmod vhost_alias</div></div>
<p><strong>Step 2:</strong> Replace the DocumentRoot statement in <em>default</em> virtualhost configuration file with two lines:</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">UseCanonicalName</span> &nbsp; &nbsp;<span style="color: #0000ff;">Off</span><br />
<span style="color: #00007f;">VirtualDocumentRoot</span> /var/www/cakephp/%0/webroot</div></div>
<p>(If you use a different virtualhost, make sure that you&#8217;re editing the right configuration file)</p>
<p><strong>Step 3:</strong> However, the mod_rewrite doesn&#8217;t play nice with mod_vhost_alias. We need to edit the .htaccess file in {APP}/webroot folder.</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">RewriteBase</span> / &nbsp; <span style="color: #adadad; font-style: italic;"># &lt;&lt; Add this line</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">RewriteCond</span> %{REQUEST_FILENAME} !-d</div></div>
<p><strong>Step 4:</strong> Restart Apache.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo service apache2 restart</div></div>
<p>Below is my default virtual host configuration for your reference:</p>
<div class="codecolorer-container apache default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;<br />
&nbsp; &nbsp; <span style="color: #00007f;">ServerAdmin</span> webmaster@localhost<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">UseCanonicalName</span> <span style="color: #0000ff;">Off</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">VirtualDocumentRoot</span> /var/www/cakephp/%0/webroot<br />
<br />
&nbsp; &nbsp; &lt;<span style="color: #000000; font-weight:bold;">Directory</span> /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">FollowSymLinks</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span><br />
&nbsp; &nbsp; &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;<br />
<br />
&nbsp; &nbsp; <span style="color: #00007f;">ErrorLog</span> /var/log/apache2/error.log<br />
<br />
&nbsp; &nbsp; <span style="color: #adadad; font-style: italic;"># Possible values include: debug, info, notice, warn, error, crit,</span><br />
&nbsp; &nbsp; <span style="color: #adadad; font-style: italic;"># alert, emerg.</span><br />
&nbsp; &nbsp; <span style="color: #00007f;">LogLevel</span> warn<br />
<br />
&nbsp; &nbsp; <span style="color: #00007f;">CustomLog</span> /var/log/apache2/access.log combined<br />
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/10/automatic-virtual-host-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to hide files in Nautilus</title>
		<link>http://www.abinarymind.com/2009/09/how-to-hide-files-in-nautilus/</link>
		<comments>http://www.abinarymind.com/2009/09/how-to-hide-files-in-nautilus/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:05:25 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[lost+found]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=86</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>In Linux, files which name start by a dot &#8216;.&#8217; are hidden by default in most file managers. However, there are cases when we want to hide dot-file from our view. For examples:</p>
<ul>
<li> Desktop folder in our home folder.</li>
<li>Dropbox</li>
<li>lost+found directory at the partition root</li>
<li>&#8230;</li>
</ul>
<p>In Nautilus (default GNOME file manager) there&#8217;s a way. Add a file named</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.hidden</div></div>
<p>with each line is the name of the file/folder you want to hide.</p>
<p>For example, if you want to hide Desktop from home folder you may type this command in the terminal:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Desktop&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.hidden</div></div>
<p>Note: This trick only works in Nautilus. It won&#8217;t work in Konqueror or Dolphin. I don&#8217;t know if it works in other file managers or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/09/how-to-hide-files-in-nautilus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gnome-colors</title>
		<link>http://www.abinarymind.com/2009/06/gnome-colors/</link>
		<comments>http://www.abinarymind.com/2009/06/gnome-colors/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 04:30:34 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[GDM]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=53</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>The GNOME-Colors is a project that aims to make the GNOME desktop as elegant, consistent and colorful as possible.</p>
<p>The current goal is to allow full color customization of themes, icons, GDM logins and splash screens. There are already five full color-schemes available; Brave (Blue), Human (Orange), Wine (Red), Noble (Purple) and Wise (Green).</p>
<p>GNOME-Colors is mostly inspired/based on Tango, GNOME, Elementary, Tango-Generator and many other open-source projects.</p>
<p>via <a href="http://code.google.com/p/gnome-colors/">gnome-colors &#8211; Google Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/gnome-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename files from upper case filename to lower case (in bash)</title>
		<link>http://www.abinarymind.com/2009/06/rename-files-from-upper-case-filename-to-lower-case-in-bash/</link>
		<comments>http://www.abinarymind.com/2009/06/rename-files-from-upper-case-filename-to-lower-case-in-bash/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 03:10:38 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[uppercase]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=49</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Here is a way to rename files in bash, from upper case filenames to lowercase ones</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done</div></div>
<p>via <a href="http://blog.mc-thias.org/?c=1&amp;more=1&amp;pb=1&amp;tb=1&amp;title=rename-files-from-upper-case-filename-to">Rename files from upper case filename to lower case (in bash)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/rename-files-from-upper-case-filename-to-lower-case-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pyinotify</title>
		<link>http://www.abinarymind.com/2009/06/pyinotify/</link>
		<comments>http://www.abinarymind.com/2009/06/pyinotify/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 08:12:58 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=32</guid>
		<description><![CDATA[Pyinotify is a pure Python module for monitoring filesystems changes. Pyinotify relies on  inotify, a Linux Kernel functionnality (since kernel 2.6.13).
via <a href="http://trac.dbzteam.org/pyinotify">Pyinotify</a>.]]></description>
			<content:encoded><![CDATA[<p>Pyinotify is a pure Python module for monitoring filesystems changes. Pyinotify relies on  inotify, a Linux Kernel functionnality (since kernel 2.6.13). inotify is an event-driven notification mechanism, its notifications are exported to user space through three system calls. Pyinotify binds these system calls and provides an implementation on top of them.</p>
<p>via <a href="http://trac.dbzteam.org/pyinotify">Pyinotify</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/pyinotify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giữ một phiên làm việc SSH</title>
		<link>http://www.abinarymind.com/2009/06/giu-mot-phien-lam-viec-ssh/</link>
		<comments>http://www.abinarymind.com/2009/06/giu-mot-phien-lam-viec-ssh/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 04:02:09 +0000</pubDate>
		<dc:creator>lexhung</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.abinarymind.com/?p=23</guid>
		<description><![CDATA[Khi bạn làm việc với máy chủ thông qua SSH thì bạn sẽ thường gặp một vấn đề nhỏ. Đó là dịch vụ SSH sẽ đóng kết nối của bạn sau một khoảng thời gian nhất định. Để ngăn dịch vụ SSH đóng kết nối thì chúng ta có cách sau:

Sửa file <code>/etc/ssh/ssh_config</code> hoặc <code>$HOME/.ssh/config</code> và thêm vào đó dòng dưới đây

<code>
ServerAliveInterval 60
</code>]]></description>
			<content:encoded><![CDATA[<p>Khi bạn làm việc với máy chủ thông qua SSH thì bạn sẽ thường gặp một vấn đề nhỏ. Đó là dịch vụ SSH sẽ đóng kết nối của bạn sau một khoảng thời gian nhất định. Để ngăn dịch vụ SSH đóng kết nối thì chúng ta có cách sau:</p>
<p>Sửa file</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/etc/ssh/ssh_config</div></div>
<p>hoặc</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$HOME/.ssh/config</div></div>
<p>và thêm vào đó dòng dưới đây</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ServerAliveInterval 60</div></div>
<p>Chương trình C nhỏ dưới đây có thể giúp bạn tạm giữ một phiên làm việc bằng cách in ra một thanh xoay trong lúc chạy.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &lt;stdio.h&gt;</span><br />
<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span><br />
<span style="color: #993333;">char</span> spin<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #ff0000;">'|'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'/'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'-'</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x5c</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;;</span>usleep<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">300000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> fflush<span style="color: #009900;">&#40;</span>stdout<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%c<span style="color: #660099; font-weight: bold;">\x08</span>&quot;</span><span style="color: #339933;">,</span> spin<span style="color: #009900;">&#91;</span><span style="color: #339933;">++</span>i<span style="color: #339933;">%</span><span style="color:#800080;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.abinarymind.com/2009/06/giu-mot-phien-lam-viec-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
