<?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>tamilsweet - Freelance Web Developer &#187; apache</title>
	<atom:link href="http://tamilg.in/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://tamilg.in</link>
	<description>Personal blog of Tamilmozhi</description>
	<lastBuildDate>Tue, 15 Feb 2011 12:38:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Linode VPS setup</title>
		<link>http://tamilg.in/updates/linode-vps-setup</link>
		<comments>http://tamilg.in/updates/linode-vps-setup#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:09:46 +0000</pubDate>
		<dc:creator>tamilsweet</dc:creator>
				<category><![CDATA[Server Adminstration]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://tamilg.in/?p=12</guid>
		<description><![CDATA[It took me about 2hrs to setup the server, from signin up to linode to transferring and bringing up this site. Just thought i could list down the steps, so that it could be helpful for someone else and may be to myself later . I used articles by Victor Kane and Jeff Beeman as [...]]]></description>
			<content:encoded><![CDATA[<p>It took me about 2hrs to setup the server, from signin up to linode to transferring and bringing up this site.</p>
<p>Just thought i could list down the steps, so that it could be helpful for someone else and may be to myself later <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>I used articles by <a href="http://awebfactory.com.ar/" target="_blank">Victor Kane</a> and <a href="http://jeffbeeman.com/" target="_blank">Jeff Beeman</a> as a guidance for setting up the server.  (Links to their articles can be found in the references list).</p>
<h3><span style="text-decoration: underline;">Signup &amp; steps performed in Linode Manager</span></h3>
<p>Signed up for <strong><a href="http://www.linode.com/#plan_table" target="_blank">Linode 360</a>. </strong>Before signing up searched for coupon code in google but could only get some expired ones <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> .</p>
<p>Immediately after signup, I just logged into the Member&#8217;s area or Linode Manager. It asked me to select the geographical location of the server. They have 4 different options</p>
<ul>
<li>Newark, NJ, USA</li>
<li>Atlanta, GA, USA</li>
<li>Dallas, TX, USA</li>
<li>Fremont, CA, USA</li>
</ul>
<p>I selected Fremont, CA, USA, as its closer to India, among the above four.</p>
<p><span id="more-12"></span>The Member&#8217;s area is very user friendly. I have used <a href="http://www.slicehost.com/" target="_blank">Slicehost</a> earlier, but linode has better Membership area. Why Linode? Wait for few more days to see my views on why I prefered <a href="http://www.linode.com/?r=56c6540efb2da05eed947fc9a4a876e336abf9fe" target="_blank">Linode</a> over <a href="http://www.slicehost.com/" target="_blank">Slicehost</a>.</p>
<h4>Linode Distro Wizard.</h4>
<p>Linode has Distro Wizard to assist setting up the server.</p>
<p>The first step is to select the OS and they have a big list of options to select from. I decide to select latest version of Ubuntu as I&#8217;m used to the Ubuntu environment. They had two options <strong>Ubuntu 8.10 &#8211; 64bit and Ubuntu 8.10 &#8211; 32 bit</strong>. Skimming through the Linode community, I found that <span style="color: #ff0000;"><em>there is no real advantage using 64bit unless there is specific requirement</em></span>. So, I selected Ubuntu 8.10 32bit.</p>
<h4>Selecting Disk Image and Swap Image size</h4>
<p>Now next step is to select the disk space and swap space. I selected 512swap space and used remaining space to create image. The Linode 360 plan comes with 12GB disk space and I dont really expect to run out of space at least in the near future, so decide to have swap space little larger. Then typed in the root password and created the image.</p>
<p>The image was ready in about 15secs and I logged into the server using ip which is available in the network tab in the Member&#8217;s area.</p>
<h3><span style="text-decoration: underline;">Steps performed in server console</span></h3>
<p>I logged into the server using SSH from my Linux machine.</p>
<h4>update &amp; upgrade</h4>
<p>Now I did apt-get update and upgrade.</p>
<blockquote><p>apt-get update</p>
<p>apt-get upgrade</p></blockquote>
<p>At this stage I got lots of warnings like</p>
<blockquote><p>perl: warning: Setting locale failed.<br />
perl: warning: Please check that your locale settings:<br />
LANGUAGE = (unset),<br />
LC_ALL = (unset),<br />
LANG = (unset)<br />
are supported and installed on your system.</p></blockquote>
<p>I generally don&#8217;t ignore warnings, but since the upgrade was successful, I just ignored it.</p>
<h4>Setting hostname</h4>
<blockquote><p>/bin/<span class="kw2">hostname</span> tamilg.in<br />
<span class="kw3">echo</span> tamilg.in &gt; /etc/<span class="kw2">hostname</span></p></blockquote>
<p>Be careful! The second line has /etc/ not /bin/ <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I just overlooked this and end up corrupting the /bin/hostname file. lol&#8230;.. I couldn&#8217;t find a way to restore the corrupt file. Also, <a href="http://www.ubuntu.com/download/" target="_blank">ubuntu.com</a> or any of its  mirror doesn&#8217;t seem to have files in extracted state. They just has the iso image !? Not sure!. I had little time and so deleted the whole image from Member&#8217;s area and reinstalled everything. This time I was careful!  &#8211; don&#8217;t repeat mistakes <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p><em><span style="color: #ff0000;">Should the hostname necessarily be a valid domain name!? Yes</span>, says <a href="http://en.wikipedia.org/wiki/Hostname" target="_blank">Wikipedia &#8211; Hostname</a>.</em></p>
<p>Now a rebooted the server from the Member&#8217;s area. Just had to click a &#8220;Reboot&#8221; button.</p>
<h4>Installing Vim &#8211; Vi Imporved.</h4>
<p>Vi editor comes with default Ubuntu installation. But I&#8217;m used to Vi Imporved and its really difficult to use basic Vi editor if you are not used to it. I used</p>
<blockquote><p>apt-get install vim</p></blockquote>
<p>Now again got those warning message but this time installation failed!!! So, I had to fix the warnings now! I fixed it after 2hours of struggle as I couldn&#8217;t find the proper solution to fix this.</p>
<p><em>The issue was because the folder/usr/lib/locale/ doesn&#8217;t had the needed language files</em>. Users in some forums suggested to do</p>
<blockquote><p>locale-gen<br />
dpkg-reconfigure locales<br />
apt-get install &#8211;reinstall language-pack-en</p></blockquote>
<p>But those weren&#8217;t sufficient to fix the issue. Finally fixed the issue by adding a symbolic link to language file.</p>
<blockquote><p>cd /usr/lib/locale<br />
sudo ln -s es_ES.utf8 es_ES</p></blockquote>
<p>Now used <em>apt-get install vim</em> and the installation was successful.</p>
<h4>Installing Apache, MySQL and PHP</h4>
<p>I just followed the instruction of Jeff Beeman.</p>
<blockquote><p># Apache2<br />
apt-get <span class="kw2">install</span> apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert</p></blockquote>
<blockquote><p># MySQL<br />
apt-get install mysql-server mysql-client libmysqlclient15-dev</p></blockquote>
<p>It asked if I want to set password for root user and I typed in the one easier for me to remember!</p>
<blockquote><p># PHP<br />
apt-get <span class="kw2">install</span> libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-<span class="kw2">ps</span> php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl</p></blockquote>
<p>Now restarted the apache server using the command</p>
<blockquote><p>apache2ctl restart</p></blockquote>
<h4>Installing sendmail and configuring PHP to use it for sending mails</h4>
<blockquote><p>apt-get <span class="kw2">install</span> sendmail</p></blockquote>
<p>Opened <strong>/etc/php5/apache2/php.ini</strong> and updated the sendmail path.<em></em></p>
<blockquote><p>sendmail_path = /usr/sbin/sendmail -i -t</p></blockquote>
<h4>Subversion and Apache modules</h4>
<p>I use subversion for version control of my project, however small they be. So, I installed it in the server.</p>
<blockquote><p>apt-get install subversion</p></blockquote>
<p>Enabled deflate, expires and cache modules for Apache2. These modules are necessary to get the site better optimized for performance and learnt it from the usage of YSlow Firefox plugin to optimize <a href="http://www.snesclassics.com/" target="_blank">Snesclassics.com</a>. I&#8217;m the server administrator for the site snesclassics.com. If not now in future these module could be handy and so I decide to enable them.</p>
<blockquote><p>a2enmod deflate<br />
a2enmod expires<br />
a2enmod cache</p></blockquote>
<p>Now basic setup is complete and the server is ready to go live!!!. (I&#8217;m yet to configure the firewall and secure the server, just hoping that no one would waste their time hacking a nearly empty server <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>
<h3><span style="text-decoration: underline;">Setting up site(s) in server</span></h3>
<p>My site was down from 6th April 09. The site was hosted in <a href="http://www.dreamhost.com" target="_blank">Dreamhost</a> (shared) account of <a href="http://bambeeq.com" target="_blank">BambeeQ</a>.</p>
<h4>Updating DNS to serve tamilg.in from Linode</h4>
<p>Now I added tamilg.in from DNS Manager tab of Linode Manager &#8211; Add a new domain zone. Then updated the nameserver of the domain in my domain registrar admin page to</p>
<p>ns1.linode.com &amp; ns2.linode.com</p>
<p>I waited for about an hour for DNS propagation. Mean while I added the Virtualhost in the server.</p>
<h4>Adding Virtualhost</h4>
<p>The general practice is to put the sites in folder /var/www/.</p>
<p>But I used to a different practice(from the usage of slicehost). i.e. Using a separate user for hosting sites and having the sites in /home/&lt;website user&gt;/public_html/</p>
<p>I created user <em>websites</em> for this purpose. The directory structure for the site tamilg.in is</p>
<pre>/home/websites/public_html/tamilg.in/
../tamilg.in/
          |-/public/
          |-/private/
          |-/backup/
          |-/logs/</pre>
<p>The folder names should clearly suggest their usage. For testing created a simple index.php file under /home/websites/public_html/tamilg.in/public/.</p>
<p>Now, created the file <em>tamilg.in</em> under /etc/apache2/sites-available/</p>
<p>Content of tamilg.in &amp; is self explanatory.</p>
<blockquote>
<pre>&lt;VirtualHost *:80&gt;

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin tamil@bambeeq.com
  ServerName  www.tamilg.in
  ServerAlias tamilg.in

  ScriptAlias /cgi-bin/ /home/websites/public_html/tamilg.in/cgi-bin/

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /home/websites/public_html/tamilg.in/public/

  # Custom log file locations
  ErrorLog  /home/websites/public_html/tamilg.in/logs/error.log
  CustomLog /home/websites/public_html/tamilg.in/logs/access.log combined

&lt;/VirtualHost&gt;</pre>
</blockquote>
<p>Now that virtual host settings are ready, enable the site tamilg.in using the command</p>
<blockquote><p>a2ensite tamilg.in</p></blockquote>
<p>restart the apache server</p>
<blockquote><p>apache2ctl restart</p></blockquote>
<p>Initally I didn&#8217;t get the test page when I viewed http://tamilg.in/. The reason was the delay in DNS propagation.</p>
<p>After sometime, I got the test page loaded!!! Hurry!!!</p>
<h4>Yet to do!</h4>
<p>I got the site running from my Linode instance, but still there are few things left for me to do asap. I&#8217;m yet to secure the server by setting up firewall and have to disable root login to the server.</p>
<h3><span style="text-decoration: underline;">What next?</span></h3>
<p>Then I installed WordPress and setup this site! <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . So, that gives me subject for the next post!</p>
<p>Huge post! I hope should be useful!!!</p>
<h3><span style="text-decoration: underline;"><strong>References:</strong></span></h3>
<ol>
<li>Google Google Google!!! Find anything you want <img src='http://tamilg.s3-website-us-east-1.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  &#8211; <a title="Search engine" href="http://www.google.co.in" target="_blank">Google</a></li>
<li>Victor Kane&#8217;s &#8211; <a href="http://awebfactory.com.ar/node/275" target="_blank">VPS! Getting Drupal up and running on a linode</a></li>
<li>Jeff Beeman&#8217;s &#8211; <a href="http://jeffbeeman.com/node/23" target="_blank">Just got rolling with a VPS on Linode (Part 1)</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tamilg.in/updates/linode-vps-setup/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: tamilg.s3-website-us-east-1.amazonaws.com

Served from: tamilg.in @ 2012-02-06 00:28:07 -->
