<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ubuntu</title><link>https://grahamgilbert.com/tags/ubuntu/</link><description>graham gilbert</description><generator>Hugo 0.151.0</generator><lastBuildDate>Fri, 08 May 2026 18:31:32 +0000</lastBuildDate><item><title>Web server on Linode part 1</title><link>https://grahamgilbert.com/blog/2012/01/01/web-server-on-linode-part-1/</link><guid isPermaLink="true">https://grahamgilbert.com/blog/2012/01/01/web-server-on-linode-part-1/</guid><pubDate>Sun, 01 Jan 2012 20:23:03 +0000</pubDate><description>Recently, I was tasked with moving a client&amp;rsquo;s web server from a box in their office, to something a little more robust when they put something up there that caused the server to go nuts (30 mb/s nuts!).
The main goals were:
Fast, scalable web server Multiple FTP users for the client&amp;rsquo;s web team to modify the site Integrates with their existing CrashPlan PROe backup system. Use GUI&amp;rsquo;s as much as possible for admin so lower level techs could make changes on the server. After considering several options, we decided to go with Linode. I&amp;rsquo;ve had great success hosting my own site with them, and as we had full access to the box, we could install anything we wanted - including CrashPlan.</description><content:encoded><![CDATA[<p>Recently, I was tasked with moving a client&rsquo;s web server from a box in their office, to something a little more robust when they put something up there that caused the server to go nuts (30 mb/s nuts!).</p>
<p>The main goals were:</p>
<ul>
<li>Fast, scalable web server</li>
<li>Multiple FTP users for the client&rsquo;s web team to modify the site</li>
<li>Integrates with their existing CrashPlan PROe backup system.</li>
<li>Use GUI&rsquo;s as much as possible for admin so lower level techs could make changes on the server.</li>
</ul>
<p>After considering several options, we decided to go with Linode. I&rsquo;ve had great success hosting my own site with them, and as we had full access to the box, we could install anything we wanted - including CrashPlan.</p>
<p>So, first things first. Get yourself a Linode account. Start off with the cheapest 512 account and work your way upwards if you need the horsepower. Once you&rsquo;ve got your account, pick your data centre, and get your VM up and running. We usually go for Ubuntu 10.04 LTS as you&rsquo;ll find the most support online for that.</p>
<p>Now you&rsquo;ve got your Ubuntu Linode up and running, let&rsquo;s get the web server up and running (mostly borrowed from the Linode Library).</p>
<p>It&rsquo;s much easier if you set up an A record for your new VM, so for the purposes of this, we&rsquo;ll call our new VM linode.example.com.</p>
<p>The code-type font is stuff your should be putting into your terminal window, one line at a time (but to be honest, if I have to tell you that, maybe this isn&rsquo;t the right thing to be following&hellip;)</p>
<p>Set the hostname</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">&#34;linode.example.com&#34;</span> &gt; /etc/hostname
</span></span></code></pre></div><p>Get everything up to date:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">apt-get update
</span></span><span class="line"><span class="cl">apt-get upgrade
</span></span><span class="line"><span class="cl">apt-get install php5 apache2 mysql-server
</span></span></code></pre></div><p>Bash in your chosen MySQL root password when you&rsquo;re prompted, and you&rsquo;re done.</p>
<p>That&rsquo;s all you need for the most basic web server, but I&rsquo;m a Mac admin, I quite like having a GUI if I can, so let&rsquo;s get one installed. I quite like webmin, but it&rsquo;s not quite a straightforward as we&rsquo;d like.</p>
<p>First install the dependencies:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl apt-show-versions libapt-pkg-perl
</span></span></code></pre></div><p>You&rsquo;ll notice there&rsquo;s a failure there, so we&rsquo;ll have to hunt that down ourselves. Grab the latest version from: <a href="http://mirrors.kernel.org/ubuntu/pool/universe/libm/libmd5-perl/">http://mirrors.kernel.org/ubuntu/pool/universe/libm/libmd5-perl/</a></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> /tmp
</span></span><span class="line"><span class="cl">wget http://mirrors.kernel.org/ubuntu/pool/universe/libm/libmd5-perl/libmd5-perl_2.03-1_all.deb
</span></span><span class="line"><span class="cl">dpkg -i libmd5-perl_2.03-1_all.deb
</span></span></code></pre></div><p>Now to grab the latest version of Webmin:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">wget http://prdownloads.sourceforge.net/webadmin/webmin_1.570_all.deb
</span></span><span class="line"><span class="cl">dpkg -i webmin_1.570_all.deb
</span></span></code></pre></div><p>Now you should be able to log into webmin with your root username and password at <a href="https://linode.example.com:10000">https://linode.example.com:10000</a></p>
<p>I&rsquo;m not going to tell you how to set up Apache - there&rsquo;s plenty enough on the internet. It&rsquo;s easy with Webmin, the Apache defaults are reasonably sensible. Just make a directory for your web files, and point a new virtual host at the directory. If you get stuck, a good tutorial can be found at <a href="http://doxfer.webmin.com/Webmin/Name-BasedVirtualHosting">http://doxfer.webmin.com/Webmin/Name-BasedVirtualHosting</a></p>
<p>We&rsquo;re nearly done with this part, just a little housekeeping to do. First, a little cleaning up of the MySQL install. Accept the defaults that this script offers:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">mysql_secure_installation
</span></span></code></pre></div><p>If you&rsquo;re going to be running something like Wordpress, chances are you&rsquo;re going to want your server to send emails.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">apt-get install exim4
</span></span><span class="line"><span class="cl">dpkg-reconfigure exim4-config
</span></span></code></pre></div><p>In the configuration wizard, choose Internet Site for the first option, bash in your Linode&rsquo;s hostname (it should already be there - if it&rsquo;s not check you&rsquo;ve set the hostname correctly), and make sure that your server will only accept SMTP connections from itself by putting 127.0.0.1 in the next box. In the box asking which domains to accept relays for, enter your Linode&rsquo;s hostname and localhost. Leave the relay domains and relay machines fields blank, and select No when asked about keeping DNS queries down. On the next question on how to store incoming mail, choose whatever you want as you won&rsquo;t be getting any incoming mail here. Finally, accept the default &ldquo;non-split&rdquo; part for how to store the configuration file.</p>
<p>For a little security through obscurity, I like to change the port that webmin listens on as well. Log in, go to Webmin -&gt; Webmin Configuration -&gt; Ports and Addresses, and change the listening port to something of your choosing.</p>
<p>Whilst you&rsquo;re there, you might want to change the port that SSH is on as well. In Webmin, you&rsquo;ll want to be looking at Servers -&gt; SSH Server -&gt; Networking</p>
<p>Finally, I like to disable the root user. First add your own user (give the user a password etc), then add them to the admin group (the user&rsquo;s in this group are automatically added to sudoers).</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">adduser myuser
</span></span><span class="line"><span class="cl">adduser myuser admin
</span></span></code></pre></div><p>Now log in as your new user and make sure you can sudo - once that&rsquo;s working, you can disable the root user:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo passwd -l root
</span></span></code></pre></div><p>Assuming everything is working up to this point, change the DNS for your site to point to your new Linode, sit back and congratulate yourself for giving yourself one less physical box to worry about.</p>
<p>You&rsquo;ve now got a basic webserver up and running on Linode with a GUI to manage the server. Next time, we&rsquo;ll go over setting up an FTP server with virtual users (with a GUI!), and backing up the server with CrashPlan PROe, including performing a full dump of the mysql databases every night so they&rsquo;re backed up properly.</p>]]></content:encoded></item></channel></rss>