<?xml version="1.0" encoding="ISO-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>::</title>
	<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php" />
	<modified>2008-11-21T02:05:50Z</modified>
	<author>
		<name>Trq</name>
	</author>
	<copyright>Copyright 2008, Trq</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.4.9.1">SPHPBLOG</generator>
	<entry>
		<title>Testing php5.3.0 Alpha1</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry080807-124529" />
		<content type="text/html" mode="escaped"><![CDATA[Id hate to write this again so I&#039;m just going to post a link to my blog entry on <a href="http://www.phpfreaks.com/blog/testing-php530" target="_blank" >phpfreaks.com</a>.<br /><br />Have fun.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry080807-124529</id>
		<issued>2008-08-07T00:00:00Z</issued>
		<modified>2008-08-07T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Back home.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry080716-142842" />
		<content type="text/html" mode="escaped"><![CDATA[Just finished migrating the site back over to my home based servers. Were now running from within a custom Debian vps within my new dual core computer in the spare room at home. I&#039;ve still got plenty of work to do but the site is up at least.<br /><br />Got a bit of freelance work to get through over the next few days but I&#039;m hoping to find time to setup another vps for mail on Friday.<br /><br />I think I&#039;m going to enjoy this setup much more than hosting everything remotely. Just hope my connection is up to speed.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry080716-142842</id>
		<issued>2008-07-16T00:00:00Z</issued>
		<modified>2008-07-16T00:00:00Z</modified>
	</entry>
	<entry>
		<title>The Debian System.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry080710-203821" />
		<content type="text/html" mode="escaped"><![CDATA[Just finished reading <a href="http://nostarch.com/frameset.php?startat=debian" target="_blank" >this</a> book last week and Ive got to say, it was the most enjoyable book Ive read in a long while.<br /><br />It really went into great detail about how <a href="http://debian.org" target="_blank" >Debian</a> is developed, what makes it different from other Linux distros and how you can use it to do just about anything you would want from a *nix based OS.<br /><br />I was particularly interested in how the package management system is implemented, how to package my own tools and how to build my own kernels the &#039;Debian way&#039;.<br /><br />Nicely written by a Debian user/developer Martin F. Krafft, it did actually have me laughing out loud in several places.<br /><br />While maybe a little dated (around the time of the sage stable) it is still well and truly relevant. I would recommend this book to anyone who has more than a passing interest in Debian.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry080710-203821</id>
		<issued>2008-07-10T00:00:00Z</issued>
		<modified>2008-07-10T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Still alive and well.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry080507-120304" />
		<content type="text/html" mode="escaped"><![CDATA[It would appear its been some three months since my last post, I knew this thing would be a big job to maintain.<br /><br />Plenty of news since my last entry. I guess the main news is that we have moved house. Were now living in a much bigger (4 bedroom) place with a pool and a decent yard. Shame its coming into winter though. I guess we could always crank up the fireplace.<br /><br />I&#039;ve bought a new pc. My old main machine was struggling with too many virtual machines running Apache so I thought fuck it, it was time to upgrade anyway. My new machine is a core2 duo running at 3.Ghz/core topped off with 8G of memory. It really is a beast. I had allot of trouble getting her going though, mostly due to the fact that I&#039;m running all SATA drives and a fairly recent Nvidia (8600GT) video card. So yeah, in the end I ended up installing Debian&#039;s unstable distro sid, this gave me access to the 2.6.24 version of the kernel and a much newer version or xorg. From there its all been pretty smooth sailing. A few minor issues which I&#039;ll likely (hopefully) post about within the next few days.<br /><br />My old machine has been relegated back to running windows as I&#039;ve finally set up a small recording studio in a spare room. Its been a long while since I&#039;ve had a place to make music and I&#039;m looking forward to getting back into it. I&#039;ve set it up with fruity studio also hooked up my midi controller and Stace&#039;s Roland kit.<br /><br />Anyway, just wanted to get some news out of the way. I&#039;m dying to write an entry about how I got the openvz patches into my kernel so you should hear about that in the next few days.<br /><br />More to come.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry080507-120304</id>
		<issued>2008-05-07T00:00:00Z</issued>
		<modified>2008-05-07T00:00:00Z</modified>
	</entry>
	<entry>
		<title>The holiday break.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry080130-002235" />
		<content type="text/html" mode="escaped"><![CDATA[It&#039;s been a few weeks since my last post, but yeah, its that time of year. I had all intention of knuckling down to get some of this framework developed but ended up a little side tracked, mostly by christmas.<br /><br />News is though that I have actually started prototyping several parts of the framework including the router (used to route requests to actions) and the config system. I wanted to stick to native php arrays for configuration because of its speed, but in reality, they don&#039;t offer enough flexability so I&#039;ll be going with xml which will be latter turned into objects.<br /><br />In other news, it would appear my laptop is fuba. I think its got overheating issues and its locking up all the time. My main dev server (an old iMac G3) has also given up the ghost in the last few weeks. HD failure. So yeah, I&#039;m having a little bad luck with machines at the moment. The only real good thing to come out of this is that I&#039;m starting to look into virtulization and am installing qemu as I type. I wanted to go with xen but I&#039;m using the binary nvidia kernel module and can&#039;t get it to build against the xen kernel.<br /><br />ps: I&#039;ve now managed to switch my main desktop machine over to Debian Etch full time and I&#039;m loving it! Gentoo was really becoming quite an issue to maintain over a dialup connection. I&#039;ve also moved to using xfce4 from fluxbox. The main reason I started using fluxbox initially was because I didn&#039;t want the temptation of a file manager that gnome and kde provide by default. I figured the only way to get to know the shell was to use it, and fluxbox made it real easy to have a very minimal environment to work in. Now days though, I feel a little luxury goes a long way and xfce4 is still pretty slim when compared to gnome/kde.<br /><br />I&#039;ve a new geforce card in the mail so should also be getting beryl going in the next few days as well.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry080130-002235</id>
		<issued>2008-01-29T00:00:00Z</issued>
		<modified>2008-01-29T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Local dev server up and running.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry071213-095456" />
		<content type="text/html" mode="escaped"><![CDATA[Just a quick entry this one. I finished installing and configuring my local dev machine (utilserv) this morning. Almost exactly the same setup as my vps except I also decided I would also install mysql and postgresql. I use them quite a bit for freelance / testing purposes.<br /><br />I also installed tidy, which I forgot I wanted on my vps and memcache which I want to take a look at. I ended up going back and installing these both on my vps as well.<br /><br />So now, my local dev server has...<br /><pre><br />&lt;user&gt;@utilserv ~ # dpkg -l | grep php<br />ii  libapache2-mod-php5               5.2.0-8+etch7                       server-side, HTML-embedded scripting languag<br />ii  php-db                            1.7.6-2                             PHP PEAR Database Abstraction Layer<br />ii  php-doc                           20061001-1                          Documentation for PHP4 and PHP5<br />ii  php-pear                          5.2.0-8+etch7                       PEAR - PHP Extension and Application Reposit<br />ii  php-sqlite3                       0.4-4                               PHP SQLite3 PEAR module<br />ii  php5-cli                          5.2.0-8+etch7                       command-line interpreter for the php5 script<br />ii  php5-common                       5.2.0-8+etch7                       Common files for packages built from the php<br />ii  php5-dev                          5.2.0-8+etch7                       Files for PHP5 module development<br />ii  php5-gd                           5.2.0-8+etch7                       GD module for php5<br />ii  php5-memcache                     2.0.1-1.1                           memcache extension module for PHP5<br />ii  php5-mysql                        5.2.0-8+etch7                       MySQL module for php5<br />rc  php5-pgsql                        5.2.0-8+etch7                       PostgreSQL module for php5<br />rc  php5-sqlite                       5.2.0-8+etch7                       SQLite module for php5<br />ii  php5-sqlite3                      0.4-4                               SQLite3 module for php5<br />ii  php5-tidy                         5.2.0-8+etch7                       tidy module for php5<br />ii  phpmyadmin                        2.9.1.1-3                           Administrate MySQL over the WWW<br /></pre><br />and my vps....<br /><pre><br />&lt;user&gt;@chloe ~ # dpkg -l | grep php<br />ii  libapache2-mod-php5    5.2.0-8+etch7                            server-side, HTML-embedded scripting languag<br />ii  php-db                 1.7.6-2                                  PHP PEAR Database Abstraction Layer<br />ii  php-pear               5.2.0-8+etch7                            PEAR - PHP Extension and Application Reposit<br />ii  php-sqlite3            0.4-4                                    PHP SQLite3 PEAR module<br />ii  php5-cli               5.2.0-8+etch7                            command-line interpreter for the php5 script<br />ii  php5-common            5.2.0-8+etch7                            Common files for packages built from the php<br />ii  php5-dev               5.2.0-8+etch7                            Files for PHP5 module development<br />ii  php5-gd                5.2.0-8+etch7                            GD module for php5<br />ii  php5-memcache          2.0.1-1.1                                memcache extension module for PHP5<br />ii  php5-sqlite3           0.4-4                                    SQLite3 module for php5<br />ii  php5-tidy              5.2.0-8+etch7                            tidy module for php5<br /></pre><br />So now, I guess I have no excuses, on to the job at hand. The plan looks good on paper (yes, I plan things on paper), lets see if I can get my shit together and actually get it done.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry071213-095456</id>
		<issued>2007-12-12T00:00:00Z</issued>
		<modified>2007-12-12T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Building on theory.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry071212-030222" />
		<content type="text/html" mode="escaped"><![CDATA[Ive been thinking about this for the last few days while Ive been setting up the vps. Tomorrow I&#039;m going to start work on a test version of my new framework, tentatively titled <i>proem</i> because it is intended as an introduction to the real thing. Who knows? I might actually learn something.<br /><br />I figure I can start by making a simple framework to support the re-development of this site (blog) and build upon that. This way I can test some theories and see if my ideas pan out. If all goes well, I might even be able to use it as the base to build my official framework on.<br /><br />I will more than likely release this framework and blog application to the public so I might be able to get feedback from some peers.<br /><br />So yeah, tomorrow I&#039;ll set myself up a local dev server (I have a spare G3 I can install Debian on) with the same specs I just ran through in setting up the vps. This will ensure the same environment, from there, I guess I&#039;ll start plugging away at it.<br /><br />You&#039;ll hear more as I progress.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry071212-030222</id>
		<issued>2007-12-11T00:00:00Z</issued>
		<modified>2007-12-11T00:00:00Z</modified>
	</entry>
	<entry>
		<title>mod_macro</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry071211-113635" />
		<content type="text/html" mode="escaped"><![CDATA[This thing is fucking cool! Just discovered it this morning thanks to the <a href="http://www.gentoo.org/news/en/gwn/20071015-newsletter.xml" target="_blank" >Gentoo newsletter</a>.<br /><br />This thing is so simple, its probably easiest to simply post an example rather than try and explain it.<br /><br />Ok, so what Ive done. Ive deleted <a href="http://debain.org" target="_blank" >Debian&#039;s</a> /etc/apache2/sites-available and /etc/apache2/sites-enabled directories. I never used them anyway.<br /><br />Next, install mod_macro.<br /><pre><br />&lt;user&gt;@chloe apt-get install libapache2-mod-macro<br /></pre><br /><br />I have then replaced my /etc/apache2/vhosts.skel file with a new /etc/apache2/macro.def.conf file.<br /><pre><br />&lt;Macro DirectoryConf $domain&gt;<br />    &lt;Directory /var/www/$domain/www&gt;<br />        Options FollowSymLinks MultiViews<br />        AllowOverride All<br />        Order allow,deny<br />        Allow from all<br />        DirectoryIndex index.php<br />    &lt;/Directory&gt;<br />&lt;/Macro&gt;<br /><br />&lt;Macro TypicalLog $domain&gt;<br />    ErrorLog /var/log/apache2/$domain-error.log<br />    LogLevel warn<br />    CustomLog /var/log/apache2/$domain-access.log combined<br />&lt;/Macro&gt;<br /><br />&lt;Macro DefVhost $domain&gt;<br />    &lt;VirtualHost *&gt;<br />        ServerName $domain<br />        ServerAlias www.$domain<br />        DocumentRoot /var/www/$domain/htdocs<br />        Use DirectoryConf $domain<br />        Use TypicalLog $domain<br />    &lt;/VirtualHost&gt;<br />&lt;/Macro&gt;<br /></pre><br />You may also notice I have moved DocumentRoot a little deeper. This enables each domain to have a central location that can be used for storing files we don&#039;t want accessed via the web.<br /> <br />I then created /etc/apache2/vhosts.conf<br /><pre><br />Use DefVhost thorpesystems.com<br /></pre><br />I then removed the...<br /><pre><br />Include /etc/apache2/vhosts/*conf<br /></pre><br />line from my /etc/apache2/apache.conf file and replaced it with...<br /><pre><br /># Include macro definitions<br />Include /etc/apache2/macro.defs.conf<br /><br /># Include vhosts.<br />Include /etc/apache2/vhosts.conf<br /></pre><br />Pretty simple huh? The whole thing should be pretty self explanatory. This makes creating vhosts (amongst other things) simple one liners.<br />]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry071211-113635</id>
		<issued>2007-12-11T00:00:00Z</issued>
		<modified>2007-12-11T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Installing Apache with mod_php</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry071210-111734" />
		<content type="text/html" mode="escaped"><![CDATA[Ok, so in my <a href="http://thorpesystems.com/index.php?entry=entry071206-131355" target="_blank" >last entry</a> on Thursday I said I would be back tomorrow to do this. Well, I prefer to do very little work on Fridays, and none at all on the weekends, so here I am, Monday morning about to install whats left of the lamp stack.<br /><br />This really shouldn&#039;t take too long at all. The first thing I need to do is log into my vps, update the package db and upgrade all my current packages.<br /><pre><br />&lt;user&gt;@oblivion chloe<br />&lt;user&gt;@chloe apt-get update &amp;&amp; apt-get upgrade<br /></pre><br />Once this is done, I can install all the required packages to get <a href="http://apache.org" target="_blank" >Apache</a> working with <a href="http://php.net" target="_blank" >PHP</a>. I usually like to keep my extensions down to a bare minimum, only installing what I know will be required in the near future. Extensions are really easy to add later, so there&#039;s no point installing what I may not need.<br /><pre><br />&lt;user&gt;@chloe apt-get install \<br />    make \<br />    gcc \<br />    g++ \<br />    apache2-prefork-dev \<br />    libapache2-mod-php5 \<br />    php5-dev \<br />    php-pear \<br />    php5-sqlite3 \<br />    php5-gd \<br />    php5-cli<br /></pre><br />Notice Ive installed make, gcc and g++ along with the dev version of apache? This installs all the required headers and tools a will need to later build some extensions via <a href="http://pecl.php.net/" target="_blank" >pecl</a>. Ive also installed php-pear&gt; Even though I don&#039;t normally use any of pear&#039;s libraries, the pear package itself contains the interface to pecl which I do need.<br /><br />The next things I&#039;m going to install are few non-standard extensions via <a href="http://pecl.php.net/" target="_blank" >pecl</a>. <a href="http://php.net/apc" target="_blank" >apc</a>, is an opcode cache for php designed to make code execution quicker. I&#039;m also installing sqlite-pdo via pecl because It was not built into the debian provided php5 package. Seems, odd, but I&#039;ll look into it later.<br /><pre><br />&lt;user&gt;@chloe sudo pecl install apc<br />&lt;user&gt;@chloe sudo pecl install PDO_SQLITE<br />&lt;user&gt;@chloe echo &quot;extension=apc.so&quot; | sudo tee /etc/php5/apache2/conf.d/apc.ini<br />&lt;user&gt;@chloe echo &quot;extension=pdo_sqlite.so&quot; | sudo tee /etc/php5/apache2/conf.d/pdo_sqlite.ini<br /></pre><br />Before continuing with any configurations, I&#039;ll make a test file and restart apache.<br /><pre><br />&lt;user&gt;@chloe echo &quot;&lt;?php phpinfo(); ?&gt;&quot; | sudo tee /var/www/index.php<br />&lt;user&gt;@chloe sudo /etc/init.d/apache2 restart<br /></pre><br />Now take a look at <a href="http://thorpesystems.com/index.php" target="_blank" >http://thorpesystems.com/index.php</a> via my browser to see that things are working as expected. And they are.<br /><br />At this point in time I need to add my user account to the www-data group, fix some directory permissions so anyone in that group can write to /var/www and delete the apache2-default site completely.<br /><pre><br />&lt;user&gt;@chloe sudo gpasswd -a &lt;user&gt; www-data<br />&lt;user&gt;@chloe sudo chown root:www-data /var/www<br />&lt;user&gt;@chloe sudo chmod g+w /var/www<br />&lt;user&gt;@chloe sudo rm -fr /var/www/apache2-default<br />&lt;user&gt;@chloe sudo rm /etc/apache2/sites-enabled/000-default<br />&lt;user&gt;@chloe sudo rm /etc/apache2/sites-available/default<br />&lt;user&gt;@chloe sudo /etc/init.d/apache2 restart<br /></pre><br />I now need to logout and back in for the group to be added to my account.<br /><br />Next, there are a few changes I need to make to the global /etc/apache2/apache2.conf file. Firstly I want to set ServerTokens to production, turn ServerSigniture off, and I also need to remove the last line which <i>includes</i> the virtual host configurations.<br /><pre><br />&lt;user&gt;@chloe sudo sed -i &#039;s/ServerTokens Full/ServerTokens Prod/&#039; /etc/apache2/apache2.conf<br />&lt;user&gt;@chloe sudo sed -i &#039;s/ServerSignature On/ServerSignature Off/&#039; /etc/apache2/apache2.conf<br />&lt;user&gt;@chloe head -n -1 /etc/apache2/apache2.conf | sudo tee /etc/apache2/apache2.conf<br /></pre><br />The reason I removed that last line is because I stray from the default debian setup for apache, and rather keep my vhost configurations within the /etc/apache2/vhosts directory which I will create now.<br /><pre><br />&lt;user&gt;@chloe sudo mkdir /etc/apache2/vhosts<br /></pre><br />I then need to add the following lines to the end of the /etc/apache2/apache2.conf file.<br /><pre><br /># Must be placed prior to calling any VirtualHost configs.<br />NameVirtualHost *<br /><br /># Include vhosts.<br />Include /etc/apache2/vhosts/*conf<br /></pre><br />By including the <i>NameVirtualHost *</i> line in my apache2.conf file my vhosts can be loaded in any order, and will no longer be required to have numbers prepended to there file names. Note I also choose the *conf extension for my vhosts files. This enables syntax highlighting in vim. I also create a vhost skel file that I use as a base for all my vhosts. This file /etc/apache2/vhost.skel looks like...<br /><pre><br />&lt;VirtualHost *&gt;<br />    ServerName VHOSTNAME<br />    ServerAlias <a href="http://www.VHOSTNAME" target="_blank" >www.VHOSTNAME</a><br />    DocumentRoot /var/www/VHOSTNAME<br />    &lt;Directory /var/www/VHOSTNAME&gt;<br />        Options FollowSymLinks<br />        AllowOverride None<br />    &lt;/Directory&gt;<br />    &lt;Directory /var/www/VHOSTNAME&gt;<br />        Options FollowSymLinks MultiViews<br />        AllowOverride All<br />        Order allow,deny<br />        Allow from all<br />        DirectoryIndex index.php<br />    &lt;/Directory&gt;<br />    ErrorLog /var/log/apache2/VHOSTNAME-error.log<br />    LogLevel warn<br />    CustomLog /var/log/apache2/VHOSTNAME-access.log combined<br />&lt;/VirtualHost&gt;<br /></pre><br />I use this file to create a new vhost to host my blog.<br /><pre><br />&lt;user&gt;@chloe sudo cp /etc/apache2/vhost.skel /etc/apache2/vhosts/thorpesystems.com.conf<br />&lt;user&gt;@chloe sudo sed -i &#039;s/VHOSTNAME/thorpesystems.com/&#039; /etc/apache2/vhosts/thorpesystems.com.conf<br /></pre><br />Now I&#039;m going to go ahead and upload this blog back to my vps and set it up within /var/www/thorpesystems.com. Once that is done, I restart apache and we should be live. Of course, if your reading this blog, it worked.<br /><br />Ok, next I&#039;m going to go through the /etc/php5/apache/php.ini file and make my configuration changes. I won&#039;t go into too many details, but there are a few things I like to change.<br /><pre><br />$f=/etc/php5/apache/php.ini<br />&lt;user&gt;@chloe sudo sed -i &#039;s/short_open_tag = On/short_open_tag = Off/&#039; $f<br />&lt;user&gt;@chloe sudo sed -i &#039;s/allow_call_time_pass_reference = On/allow_call_time_pass_reference = Off/&#039; $f<br />&lt;user&gt;@chloe sudo sed -i &#039;s/display_errors = On/display_errors = Off/&#039; $f<br />&lt;user&gt;@chloe sudo sed -i &#039;s/register_long_arrays = On/register_long_arrays = Off/&#039; $f<br />&lt;user&gt;@chloe sudo sed -i &#039;s/magic_quotes_gpc = On/magic_quotes_gpc = Off/&#039; $f<br />&lt;user&gt;@chloe sudo sed -i &#039;s/allow_url_include = Off/allow_url_include = On/&#039; $f<br />&lt;user&gt;@chloe sudo /etc/init.d/apache2 restart<br /></pre><br />Like I said, I won&#039;t go into details. The php.ini file is very well commented so if your looking for details, its in there. Notice however that I did turn off display_errors? This is after all a production server. I can still enable display_errors on a per vhost basses, and even per file if needed.<br /><br />Well, thats it. The base LAMP system is now installed, configured and running smoothly.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry071210-111734</id>
		<issued>2007-12-10T00:00:00Z</issued>
		<modified>2007-12-10T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Rebuilding my VPS.</title>
		<link rel="alternate" type="text/html" href="http://thorpesystems.com/index.php?entry=entry071206-131355" />
		<content type="text/html" mode="escaped"><![CDATA[I spent most of yesterday trying to setup a mail-server using <a href="http://postfix.org" target="_blank" >Postfix</a>+<a href="http://www.dovecot.org/" target="_blank" >Dovecot</a> and <a href="http://mysql.org" target="_blank" >MySql</a> to handle virtual domains/users. I ran into a few problems along the way including the fact that anytime I went to install any of the bigger packages, my <a href="http://en.wikipedia.org/wiki/Vps" target="_blank" >vps</a> would run out of memory and would need to be rebooted.<br /><br />I thought about it overnight (I work nightshift), and this morning decided I would upgrade the vps from a 256mg to 512mg of memory. This moves me up into what I guess is considered a more robust setup and allocates me three dedicated ip addresses as well. I also decided that I&#039;m going to dump <a href="http://mysql.org" target="_blank" >MySql</a> as the look-up table provider for postfix. I figure I can handle my email addresses via a flat-file configuration for the time being.<br /><br />Having decided to dump <a href="http://mysql.org" target="_blank" >MySql</a> as the look-up table provider for email, I can take it a step further and remove it from any plans for my mvc framework replacing it with <a href="http://sqlite.org" target="_blank" >sqlite</a>. I had planned on using <a href="http://php.net/pdo" target="_blank" >pdo</a> as a database abstraction layer anyway, so switching back to mysql later won&#039;t be an issue. Managing a vps is all about managing memory and the less daemons operating the better.<br /><br />There were also a few other configuration decisions I had made along the way with my vps that I wasn&#039;t entirely happy with, in the end I decided I was going to reinstall and start from scratch.<br /><br />So... In this (and probably the next few) blog post(s) I will be describing my process of installing and configuring the <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)" target="_blank" >lamp</a> stack on a vps. I will be using <a href="http://debian.org" target="_blank" >Debian</a> as the OS and I also hope to be including the setup and configuration of a mail-server.<br /><br />What Ive done so far:<br /><br />Ive moved this blog to a local server on my network at home. This allows me to keep posting, even though its not publicly available and wont be for a few days. This step was much simplified by the fact that I&#039;m using <a href="http://www.simplephpblog.com/" target="_blank" >simplephpblog</a> which uses flat files for data storage. I really ought give this blog a big plug here. This particular piece of software happens to be the easiest blog to setup/configure that I have used. It really is a great little system and perfect for my requirements.<br /><br />Firstly to clarify a few things. My local machine is called <i>oblivion</i>. My vps is called <i>chloe</i>. My <i>oblivion</i> machine has an entry in the /etc/hosts file...<br /><pre><br />209.40.196.51    chloe.thorpesystems.com    chloe<br /></pre><br />which resolves the host chloe, to chloe.thorpesystems.com.<br /><br />Before I reinstall the base system there are a few configurations that I would like to keep. I&#039;ll grab them now.<br /><pre><br />&lt;user&gt;@oblivion mkdir chloe<br />&lt;user&gt;@oblivion scp -r chloe:.ssh chloe/<br />&lt;user&gt;@oblivion chloe:.bash* chloe/<br /></pre><br />Next, I actually reinstall my <a href="http://Debian.org" target="_blank" >Debian</a> server on the vps.<br /><br />Done. I normally have my ssh clients/servers run on a non-default port. However, because <i>chloe</i> is now newly installed and as yet not configured to do so I need to specify the port to login with. Also, because my usual user account is not yet created, I need to login as root (I will disable the ability to do this soon).<br /><pre><br />&lt;user&gt;@oblivion su -<br />&lt;root&gt;@oblivion ssh -p 22 chloe<br /></pre><br />I&#039;m now in my new install on my remote vps. The very first thing I need to do is set my timezone then upload/install my firewall.<br />I already have a nice default firewall configuration that I use as a base on all my machines, for more details on setting up a firewall, <a href="http://google.com" target="_blank" >google</a> iptables.<br /><pre><br />&lt;root&gt;@chloe tzconfig<br />&lt;root&gt;@chloe exit<br />&lt;root&gt;@oblivion scp -P 22 /src/firewall.tar.gz chloe:/firewall.tar.gz<br />&lt;root&gt;@oblivion ssh -p 22 chloe<br />&lt;root&gt;@chloe cd / &amp;&amp; tar xvpf firewall.tar.gzs<br />&lt;root&gt;@chloe update-rc.d firewall defaults<br />&lt;root&gt;@chloe /etc/init.d/firewall start<br /></pre><br />I update the package db and while I&#039;m at it, the currently installed software.<br /><pre><br />&lt;root&gt;@chloe apt-get update &amp;&amp; apt-get upgrade<br /></pre><br />I change the default port for both the ssh client and server. I&#039;m not going to let you know what my port actually is, so I will refer to it as &lt;port&gt;.<br /><pre><br />&lt;root&gt;@chloe sed -i &#039;s/Port 22/Port &lt;port&gt;/&#039; /etc/ssh/sshd_config<br />&lt;root&gt;@chloe sed -i &#039;s/#Port 22/Port &lt;port&gt;/&#039; /etc/ssh_config<br />&lt;root&gt;@chloe /etc/init.d/ssh restart<br /></pre><br />Now, I need to create my general user account. I use the same name (which once again won&#039;t be disclosed) as my local <i>oblivion</i> machine. Remember I am using Debian so its much simpler to use its adduser command rather than the lower level useradd.<br /><pre><br />&lt;root&gt;@chloe adduser &lt;user-name&gt;<br /></pre><br />Next, I should be able to copy my previously saved user configurations back to my new accounts ~/ directory. Firstly however, I need to remove some lines from my local ~/.ssh/known_hosts file which are now broken.<br /><pre><br />&lt;root&gt;@chloe exit<br />&lt;root&gt;@oblivion exit<br />&lt;user&gt;@oblivion sed -i &#039;/chloe/d&#039; .ssh/known_hosts<br />&lt;user&gt;@oblivion scp -r chloe/ chloe:<br /></pre><br />From here on in I can simply move between my local machine and my remote machine without the need for passwords. This is done via the magic of <a href="http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/" target="_blank" >ssh keys</a> which I had previously setup and were already contained within my ~/.ssh directory I had saved. On top of that, I have an alias in my ~/.bashrc file on <i>oblivion</i> that looks like....<br /><pre><br />alias chloe=&#039;ssh chloe.thorpesystems.com&#039;<br /></pre><br />So now I can simply type <i>chloe</i> to ssh to my vps.<br /><br />My next step is to disable root access via ssh. This entails a few different steps. Before I do so however, I need to grant my general user &lt;user&gt; access to the sudo command. While my vps is already setup to allow me to su to root, sudo is a much more useful tool.<br /><pre><br />&lt;root&gt;@chloe apt-get install sudo<br />&lt;root&gt;@chloe sudoedit /etc/sudoers<br /></pre><br /><br />This enables my &lt;user&gt; account to execute any command I wish as root by using the...<br /><pre><br />sudo &lt;cmd&gt;<br /></pre><br />syntax. From here, all I need do is disable root access via ssh and restart the sshd daemon.<br /><pre><br />&lt;root&gt;@chloe sed -i &#039;s/PermitRootLogin yes/PermitRootLogin no/&#039; /etc/ssh/sshd_config<br />&lt;root&gt;@chloe /etc/init.d/ssh restart<br /></pre><br />Now, there are a few other useful tools that need installing/configuring. I&#039;ll do that now.<br /><pre><br />&lt;user&gt;@chloe sudo apt-get install screen file ntp tee<br />&lt;user&gt;@chloe sudo sed -i &#039;s/#startup/startup/&#039; /etc/screenrc<br /></pre><br />The very next thing I&#039;m going to do is get rid of this god awful greeting that appears each time I log in. I know what OS it is, and really, it just annoys the fuck out of me.<br /><pre><br />&lt;user&gt;@chloe cat /dev/null | sudo tee /etc/{motd*,issue*}<br />&lt;user&gt;@chloe sudo sed -i &#039;s/PrintLastLog yes/PrintLastLog no/&#039; /etc/ssh/sshd_config<br /></pre><br />Next, I install <a href="http://vim.org" target="_blank" >vim</a> (my favoured editor) and set it as my systems default.<br /><pre><br />&lt;user&gt;@chloe apt-get install vim ctags vim-scripts<br />&lt;user&gt;@chloe update-alternatives --config editor<br /></pre><br />I then make a few simple changes to /etc/vim/vimrc. You do what you like, its well commented. I also copy my ~/.vimrc file from <i>oblivion</i> over to <i>chloe</i>.<br /><pre><br />&lt;user&gt;@chloe exit<br />&lt;user&gt;@oblivion scp .vimrc chloe:<br /></pre><br />The last thing I want to do today is setup my ~/ directory structure. I base my home directory structure loosely around that of the <a href="http://www.path" target="_blank" >fhs</a>, because it works well.<br /><pre><br />mkdir bin etc lib src tmp var<br /></pre><br />At this point in time the operating system is setup and pretty well ready to go. I&#039;ll be back tomorrow to setup whats left of the <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)" target="_blank" >LAMP</a> stack. Keeping in mind that I&#039;m using <a href="http://sqlite.org" target="_blank" >sqlite</a> instead of <a href="http://mysql.org" target="_blank" >MySql</a> and the fact that I have already installed Linux, we&#039;ve really only <a href="http://apache.org" target="_blank" >apache</a> and <a href="http://php.net/" target="_blank" >php</a> to go.]]></content>
		<id>http://thorpesystems.com/index.php?entry=entry071206-131355</id>
		<issued>2007-12-06T00:00:00Z</issued>
		<modified>2007-12-06T00:00:00Z</modified>
	</entry>
</feed>
