<?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>Shaun Church</title>
	<atom:link href="http://shaunchurch.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shaunchurch.com</link>
	<description>Freelance Web Designer, Developer, Marketer from Norwich</description>
	<lastBuildDate>Mon, 19 Jul 2010 17:04:51 +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>How To Setup the Ideal LAMP Development Server using Ubuntu</title>
		<link>http://shaunchurch.com/blog/how-to-setup-the-ideal-lamp-development-server-using-ubuntu/</link>
		<comments>http://shaunchurch.com/blog/how-to-setup-the-ideal-lamp-development-server-using-ubuntu/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 02:27:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://shaunchurch.local/?p=38</guid>
		<description><![CDATA[My local development server’s hard drive went out in a blaze recently. I ordered a new drive and went about getting everything set up so I could get back to work. In the past I’ve used XAMPP on windows as &#8230; <a href="http://shaunchurch.com/blog/how-to-setup-the-ideal-lamp-development-server-using-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My local development server’s hard drive went out in a blaze recently. I ordered a new drive and went about getting everything set up so I could get back to work.</p>
<p>In the past I’ve used XAMPP on windows as a development environment and connected to a remote server via FTP but nothing beats having a dedicated local server. Here&#8217;s a guide detailing how I set up my LAMP (Linux, Apache, MySQL, PHP) stack on Ubuntu. It&#8217;ll work for a physical or virtual server (if you use Virtualbox or VM Ware).</p>
<p><span id="more-38"></span></p>
<p>Sites will be available at their own .local domains over your local network using VirtualHosts and a quick edit of your OS hosts file, closely matching a live server environment but working much faster than it would connecting to a remote server over the internet.</p>
<p>You&#8217;ll need a dedicated network computer you can have running when you&#8217;re developing or you can install Ubuntu under <a href="http://virtualbox.org">VirtualBox</a> (unless you&#8217;re already running Ubuntu) which will work just as well but can be quite demanding on system resources.</p>
<p><strong> </strong></p>
<h2><strong>Install and Configure Ubuntu, Static IP</strong></h2>
<p>Obvious one there, but just incase you can get ubuntu from <a href="http://www.ubuntu.com">www.ubuntu.com</a>.</p>
<p>Burn the disk, pop it in and follow the insanely simple install process. Us noobs have no idea how lucky we are these days. I ran various forms of Linux in the late 90s and spent countless hours figuring out just how to install it.</p>
<p>Set up your network and ip address to a static ip using the Network Config tool available by right clicking the network icon in the upper right toolbar on your linux desktop.</p>
<p>Choose the connection (probably <strong>eth0</strong>) and edit the settings under the IPv4 tab.</p>
<p>The first field is your IP, in the same form as your network. In my case, my network settings look like this:</p>
<p><strong>192.168.16.69 | 255.255.255.0 | 192.168.16.1</strong> (that only <em>my</em> router’s ip address)</p>
<p>I set my DNS servers to <a href="http://www.opendns.com/">Open DNS</a>: <strong>208.67.220.220</strong></p>
<p style="padding-left: 30px;">You can also type sudo pico /etc/resolv.conf at the terminal and add the other open DNS IP</p>
<p style="padding-left: 30px;">nameserver 208.67.222.222</p>
<p><strong>ctrl+o to save, ctrl+x to quit.</strong></p>
<p>restart networking so the settings will take effect:</p>
<p><strong>$: sudo /etc/init.d/networking restart</strong></p>
<p>Now we can</p>
<p><strong>Install SSH</strong></p>
<p><strong>$: sudo aptitude install ssh</strong></p>
<p>this will install ssh, and openshh-server</p>
<p>Once this is done you’ll be able to go back to your main machine for the majority of the tutorial and execute the commands via any ssh client. (I use Putty)</p>
<p>try connecting to the machine over the network using the ip address you chose for your server.</p>
<p>Open putty.exe and use the ip address 192.168.xx.xx and you should see a similar prompt to enter your login details:</p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/terminallogin.png"><img style="display: inline; border-width: 0px;" title="terminal-login" src="http://shaunchurch.com/wp-content/uploads/2009/09/terminallogin_thumb.png" border="0" alt="terminal-login" width="600" height="402" /></a></p>
<p>Login and we can start making things happen.</p>
<h2><strong>Install Apache2, PHP, MySQL and phpMyAdmin</strong></h2>
<p>We’re going to install some essential packages for the server. You can use this command:</p>
<p><strong>$: sudo aptitude install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin</strong></p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/terminalinstalling.png"><img style="display: inline; border-width: 0px;" title="terminal-installing" src="http://shaunchurch.com/wp-content/uploads/2009/09/terminalinstalling_thumb.png" border="0" alt="terminal-installing" width="600" height="402" /></a></p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/terminalmysqlpassword.png"><img style="display: inline; border-width: 0px;" title="terminal-mysql-password" src="http://shaunchurch.com/wp-content/uploads/2009/09/terminalmysqlpassword_thumb.png" border="0" alt="terminal-mysql-password" width="600" height="402" /></a></p>
<p>You’ll be prompted to choose some passwords. It’s up to you how you choose your passwords so long as you don’t forget which is which.</p>
<p>You’ll also be asked to choose the apache server to install things to. You can select the option you want using the space bar, and use the TAB key to move the selection to the &lt;Ok&gt; button and press Enter.</p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/terminalserver.png"><img style="display: inline; border-width: 0px;" title="terminal-server" src="http://shaunchurch.com/wp-content/uploads/2009/09/terminalserver_thumb.png" border="0" alt="terminal-server" width="600" height="402" /></a></p>
<p>You’ll see lots of terminal spam as everything unpacks and installs.</p>
<p>Once that’s all done our server should be up and running!</p>
<p>Open your browser and point it to <a href="http://your.ip.address">http://your.ip.address</a></p>
<p>You should see:</p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/browserworks.png"><img style="display: inline; border-width: 0px;" title="browser-works" src="http://shaunchurch.com/wp-content/uploads/2009/09/browserworks_thumb.png" border="0" alt="browser-works" width="599" height="425" /></a></p>
<p>At this point you could go ahead and start developing websites in sub folders in your servers /var/www/mywebsite directory and visit them over the network using <a href="http://192.168.16.69/mywebsite/index.php">http://192.168.16.69/mywebsite/index.php</a></p>
<h2>Setting up Virtual Hosts and Domain Hosting</h2>
<p>I take this a step further so that I can visit my sites using their own local domain name, like <a href="http://www.mywebsite.local/index.php">http://www.mywebsite.local/index.php</a> which is much better.</p>
<p>So lets jump into some Apache virtual hosts configuration.</p>
<p>First of all lets create our directory structure for our website:</p>
<p><strong>$: cd /var/www</strong></p>
<p><strong>$: sudo mkdir </strong><a href="http://www.mywebsite.local"><strong>www.mywebsite.local</strong></a></p>
<p><strong>$:sudo mkdir </strong><a href="http://www.mywebsite.local/htdocs"><strong>www.mywebsite.local/htdocs</strong></a></p>
<p><strong>$: sudo mkdir </strong><a href="http://www.mywebsite.local/logs"><strong>www.mywebsite.local/logs</strong></a></p>
<p><strong>$: sudo mkdir </strong><a href="http://www.mywebsite.local/cgi-bin"><strong>www.mywebsite.local/cgi-bin</strong></a></p>
<p>The simplest way I’ve found to enable virtual hosts in Apache is to create a file called virtual.conf in the /etc/apache2/conf.d directory containing NameVirtualHost *</p>
<p><strong>$: sudo pico /etc/apache2/conf.d/virtual.conf</strong></p>
<blockquote><p>NameVirtualHost *</p></blockquote>
<p><strong>Ctrl+O to write out the file, Ctrl+X to quit.</strong></p>
<p>Now we must put our config for the site in /etc/apache2/sites-available and create a symbolic link in /sites-enabled so we can easily enable and disable sites at will.</p>
<p>So lets make our config file.</p>
<p><strong>$: sudo pico /etc/apache2/sites-available/www.mywebsite.local</strong></p>
<blockquote><p>&lt;VirtualHost *&gt;<br />
ServerAdmin <a href="mailto:webmaster@mywebsite.local">webmaster@mywebsite.local</a><br />
ServerName  www.mywebsite.local<br />
ServerAlias mywebsite.local</p>
<p># Indexes + Directory Root.<br />
DirectoryIndex index.html index.php<br />
DocumentRoot /var/www/www.mywebsite.local/htdocs/</p>
<p># CGI Directory (optional)<br />
ScriptAlias /cgi-bin/ /var/www/www.mywebsite.local/htdocs/cgi-bin/<br />
&lt;Location /cgi-bin&gt;<br />
Options +ExecCGI<br />
&lt;/Location&gt;</p>
<p># Logfiles<br />
ErrorLog  /var/www/www.mywebsite.local/logs/error.log<br />
CustomLog /var/www/www.mywebsite.local/logs/access.log combined<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>Basically we set the paths to the server and our files, our index.html or index.php as directory root files, cgi bin and log paths. Done.</p>
<p><strong>Save it. Ctrl+O to write out, Ctrl+X to quit.</strong></p>
<p>We can use the following handy command to create the symbolic link and enable our site like this:</p>
<p><strong>$: sudo a2ensite </strong><a href="http://www.mywebsite.local"><strong>www.mywebsite.local</strong></a></p>
<p>It’s also useful to enable any mods you need at this point:</p>
<p><strong>$: sudo a2enmod rewrite</strong></p>
<p>..and then restart Apache.</p>
<p><strong>$: sudo /etc/init.d/apache2 restart</strong></p>
<p>Almost done. Now all we need to do is change our hosts file. This varies from OS to OS.</p>
<p><strong>Ubuntu / Linux:</strong> /etc/hosts</p>
<p><strong>Windows: </strong>c:\windows\system32\drivers\etc\hosts on windows</p>
<p><strong>MacOS: /</strong>private/etc/hosts</p>
<p>Add the following to the file, replacing xxx with your server’s IP address:</p>
<blockquote><p>192.168.xx.xx          <a href="http://www.mywebsite.local">www.mywebsite.local</a></p></blockquote>
<p>These files need to be edited as administrator, so on Ubuntu s<strong>udo pico /etc/hosts</strong></p>
<p>On Windows Vista/7 run <strong>notepad </strong>as administrator by right clicking and choosing ‘Run as Administrator’ browse to the folder and make the changes that way.</p>
<p>Set this up for any system on your network that  you’d like to use the clean domains with and that’s it!</p>
<p>Try it in your browser:</p>
<p><a href="http://shaunchurch.com/wp-content/uploads/2009/09/browsermywebsite.png"><img style="display: inline; border-width: 0px;" title="browser-mywebsite" src="http://shaunchurch.com/wp-content/uploads/2009/09/browsermywebsite_thumb.png" border="0" alt="browser-mywebsite" width="599" height="425" /></a></p>
<h2>Setup Samba and a Network Drive to /www</h2>
<p>I also then like to install samba, share my /var/www file and connect with a network drive from my main computer.</p>
<p><strong>$: sudo aptitude install samba</strong></p>
<p>I set up shares using the graphical user by running Nautilus as su and right clicking the /var/www folder, and enabling all options under ‘Share Options’.</p>
<p>Then in Windows I set up a network share by right clicking on ‘Computer’ and setting the location to <a href="file://\\192.168.xx.xx\www">\\192.168.xx.xx\www</a></p>
<p>Then I can access the drive I chose (W:\www.mywebsite.local) to edit and create sites directly on the server over the network.</p>
<p>I hope someone finds this useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://shaunchurch.com/blog/how-to-setup-the-ideal-lamp-development-server-using-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Print Background Colours and Images in Firefox</title>
		<link>http://shaunchurch.com/blog/how-to-print-background-colours-and-images-in-firefox/</link>
		<comments>http://shaunchurch.com/blog/how-to-print-background-colours-and-images-in-firefox/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 16:48:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://shaunchurch.com/?p=102</guid>
		<description><![CDATA[There are many reasons you might wish to print a web page, and most of them don’t involve using all your printer ink to display an accurate representation of the page. More often than not the information is what’s important &#8230; <a href="http://shaunchurch.com/blog/how-to-print-background-colours-and-images-in-firefox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many reasons you might wish to print a web page, and most of them don’t involve using all your printer ink to display an accurate representation of the page. More often than not the information is what’s important and that’s just fine.</p>
<p>If you do want to print an accurate copy of a website on the screen however, you need to enable a setting called Print Background (colours and images). Which can be found under the File > Page Setup on the Format &#038; Options tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://shaunchurch.com/blog/how-to-print-background-colours-and-images-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
