<?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>Tim Bowler &#187; debian</title>
	<atom:link href="http://timothybowler.com/category/sys_admin/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://timothybowler.com</link>
	<description>Certified Scrum Master &#124; Certified Scrum Practitioner &#124; Agile Coach &#124; Agile Practitioner</description>
	<lastBuildDate>Sat, 19 Dec 2009 16:14:31 +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>Setting up Debian with up to date packages</title>
		<link>http://timothybowler.com/2009/12/03/setting-up-debian-with-up-to-date-packages/</link>
		<comments>http://timothybowler.com/2009/12/03/setting-up-debian-with-up-to-date-packages/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 15:58:57 +0000</pubDate>
		<dc:creator>Tim Bowler</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://timothybowler.com/?p=267</guid>
		<description><![CDATA[I just installed the latest Debian, and realized that the packages are not as up-to-date as I would like. For example I installed PHP and MySQL. PHP was at version 5.2.6 and MySQL was at version 5.0.15a. Considering PHP 5.2.11 and MySQL 5.1 are already released, made me think am I better off compiling from [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed the latest Debian, and realized that the packages are not as up-to-date as I would like. For example I installed PHP and MySQL. PHP was at version 5.2.6 and MySQL was at version 5.0.15a. Considering PHP 5.2.11 and MySQL 5.1 are already released, made me think am I better off compiling from source?</p>
<p>After going down the compiling route, as in my <a title="Compiling Nginx" href="http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/" target="_blank">previous post </a>due to the same out dated problems I actually found a useful and up-to-date repository. Along with this, my bias towards Debian drastically strengthed. Which after many years of working on a a variety of other distro&#8217;s never quiet happened.<span id="more-267"></span></p>
<h1>Setting up and configuring Debian</h1>
<p>The initial setup comprises of two steps, the first step is to configure the locales, the second is to add new repos to your sources.list file.</p>
<h2>Set the Locale</h2>
<p>On a fresh install, anytime you need to use apt-get for anything Debian always complains about &#8216;setting the locale failed&#8217; like below:</p>
<pre class="brush: bash; light: true;">
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = &quot;en&quot;,
LC_ALL = (unset),
LANG = &quot;en&quot;
are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = &quot;en&quot;,
LC_ALL = (unset),
LANG = &quot;en&quot;
are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = &quot;en&quot;,
LC_ALL = (unset),
LANG = &quot;en&quot;
are supported and installed on your system.
perl: warning: Falling back to the standard locale (&quot;C&quot;).
</pre>
<p>To set the locale you need to run:</p>
<pre class="brush: bash; light: true;">
sudo locale-gen
sudo dpkg-reconfigure locales
</pre>
<p>After running the second command, you will be asked to first configure which locales you want, and then to select a default one. After that your done.</p>
<h2>Installing PHP and MySQL on Debian</h2>
<p>Using <a href="http://www.dotdeb.org/instructions/" target="_blank">dotbeb&#8217;s</a> repository add the following to your /etc/apt/sources.list</p>
<pre class="brush: bash; light: true;">
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
</pre>
<p>After which you must run</p>
<pre class="brush: bash; light: true;">apt-get update</pre>
<p>Finally, install PHP and MySQL:</p>
<pre class="brush: bash; light: true;">
apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache  php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc mysql-server mysql-client nginx
</pre>
<h3>Resources:</h3>
<ul>
<li><a title="dotdeb debian packages" href="http://www.dotdeb.org/" target="_blank">dodeb</a></li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Ftimothybowler.com%2F2009%2F12%2F03%2Fsetting-up-debian-with-up-to-date-packages%2F';
  addthis_title  = 'Setting+up+Debian+with+up+to+date+packages';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://timothybowler.com/2009/12/03/setting-up-debian-with-up-to-date-packages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>installing APC on debian</title>
		<link>http://timothybowler.com/2009/11/27/installing-apc-on-debian/</link>
		<comments>http://timothybowler.com/2009/11/27/installing-apc-on-debian/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:28:55 +0000</pubDate>
		<dc:creator>Tim Bowler</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://timothybowler.com/?p=236</guid>
		<description><![CDATA[To install APC is usually straight forward:
apt-get install php5-dev
pecl install apc
If your using nginx make sure you enter no to install using ASPX (apache dynamic modules).

Then adding the module to your php.ini file
nano /etc/php5/cgi/conf.d/apc.ini
extension=apc.so
Finally you can then restart the php cgi instances
/etc/init.d/php-fcgi restart
APC also comes with an admin script, which by default is located at:
/usr/share/php/apc.php
Simply [...]]]></description>
			<content:encoded><![CDATA[<p>To install APC is usually straight forward:</p>
<pre class="brush: bash; light: true;">apt-get install php5-dev
pecl install apc</pre>
<p>If your using nginx make sure you enter <strong>no</strong> to install using ASPX (apache dynamic modules).</p>
<p><span id="more-236"></span></p>
<p>Then adding the module to your php.ini file</p>
<pre class="brush: bash; light: true;">nano /etc/php5/cgi/conf.d/apc.ini
extension=apc.so</pre>
<p>Finally you can then restart the php cgi instances</p>
<pre class="brush: bash; light: true;">/etc/init.d/php-fcgi restart</pre>
<p>APC also comes with an admin script, which by default is located at:</p>
<pre class="brush: bash; light: true;">/usr/share/php/apc.php</pre>
<p>Simply copy this to your web folder (of course change the username and password) and you will be able to see apc&#8217;s stats.</p>
<p>However, this morning I came across a strange error message when installing apc:</p>
<h3>pear.php.net is using a unsupported protocal &#8211; This should never happen.<br />
install failed.</h3>
<p>After searching on-line and reading several posts it appears that both pear.php.net.reg and pecl.php.net.reg files seem to be partially complete. The solution is quiet simple, open up each file and insert the following completed version:</p>
<p>pear.php.net.reg</p>
<pre class="brush: php;">a:6:{s:7:&quot;attribs&quot;;a:4:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;s:5:&quot;xmlns&quot;;s:31:&quot;http://pear.php.net/channel-1.0&quot;;s:9:&quot;xmlns:xsi&quot;;s:41:&quot;http://www.w3.org/2001/XMLSchema-instance&quot;;s:18:&quot;xsi:schemaLocation&quot;;s:71:&quot;http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd&quot;;}s:4:&quot;name&quot;;s:12:&quot;pear.php.net&quot;;s:14:&quot;suggestedalias&quot;;s:4:&quot;pear&quot;;s:7:&quot;summary&quot;;s:40:&quot;PHP Extension and Application Repository&quot;;s:7:&quot;servers&quot;;a:2:{s:7:&quot;primary&quot;;a:1:{s:4:&quot;rest&quot;;a:1:{s:7:&quot;baseurl&quot;;a:4:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.0&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pear.php.net/rest/&quot;;}i:1;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.1&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pear.php.net/rest/&quot;;}i:2;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.2&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pear.php.net/rest/&quot;;}i:3;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.3&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pear.php.net/rest/&quot;;}}}}s:6:&quot;mirror&quot;;a:2:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;host&quot;;s:15:&quot;us.pear.php.net&quot;;}s:4:&quot;rest&quot;;a:1:{s:7:&quot;baseurl&quot;;a:4:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.0&quot;;}s:8:&quot;_content&quot;;s:28:&quot;http://us.pear.php.net/rest/&quot;;}i:1;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.1&quot;;}s:8:&quot;_content&quot;;s:28:&quot;http://us.pear.php.net/rest/&quot;;}i:2;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.2&quot;;}s:8:&quot;_content&quot;;s:28:&quot;http://us.pear.php.net/rest/&quot;;}i:3;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.3&quot;;}s:8:&quot;_content&quot;;s:28:&quot;http://us.pear.php.net/rest/&quot;;}}}}i:1;a:2:{s:7:&quot;attribs&quot;;a:3:{s:4:&quot;host&quot;;s:15:&quot;de.pear.php.net&quot;;s:3:&quot;ssl&quot;;s:3:&quot;yes&quot;;s:4:&quot;port&quot;;s:4:&quot;3452&quot;;}s:4:&quot;rest&quot;;a:1:{s:7:&quot;baseurl&quot;;a:4:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.0&quot;;}s:8:&quot;_content&quot;;s:34:&quot;https://de.pear.php.net:3452/rest/&quot;;}i:1;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.1&quot;;}s:8:&quot;_content&quot;;s:34:&quot;https://de.pear.php.net:3452/rest/&quot;;}i:2;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.2&quot;;}s:8:&quot;_content&quot;;s:34:&quot;https://de.pear.php.net:3452/rest/&quot;;}i:3;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.3&quot;;}s:8:&quot;_content&quot;;s:34:&quot;https://de.pear.php.net:3452/rest/&quot;;}}}}}}s:13:&quot;_lastmodified&quot;;a:2:{s:4:&quot;ETag&quot;;s:20:&quot;&quot;2fe96-59a-31a3fc80&quot;&quot;;s:13:&quot;Last-Modified&quot;;s:29:&quot;Tue, 02 Jun 2009 05:55:46 GMT&quot;;}}</pre>
<p>pecl.php.net.reg:</p>
<pre class="brush: php;">a:6:{s:4:&quot;name&quot;;s:12:&quot;pecl.php.net&quot;;s:14:&quot;suggestedalias&quot;;s:4:&quot;pecl&quot;;s:7:&quot;summary&quot;;s:31:&quot;PHP Extension Community Library&quot;;s:7:&quot;servers&quot;;a:1:{s:7:&quot;primary&quot;;a:2:{s:6:&quot;xmlrpc&quot;;a:1:{s:8:&quot;function&quot;;a:10:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:9:&quot;logintest&quot;;}i:1;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:26:&quot;package.listLatestReleases&quot;;}i:2;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:15:&quot;package.listAll&quot;;}i:3;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:12:&quot;package.info&quot;;}i:4;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:22:&quot;package.getDownloadURL&quot;;}i:5;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.1&quot;;}s:8:&quot;_content&quot;;s:22:&quot;package.getDownloadURL&quot;;}i:6;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:25:&quot;package.getDepDownloadURL&quot;;}i:7;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.1&quot;;}s:8:&quot;_content&quot;;s:25:&quot;package.getDepDownloadURL&quot;;}i:8;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:14:&quot;package.search&quot;;}i:9;a:2:{s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}s:8:&quot;_content&quot;;s:15:&quot;channel.listAll&quot;;}}}s:4:&quot;rest&quot;;a:1:{s:7:&quot;baseurl&quot;;a:2:{i:0;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.0&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pecl.php.net/rest/&quot;;}i:1;a:2:{s:7:&quot;attribs&quot;;a:1:{s:4:&quot;type&quot;;s:7:&quot;REST1.1&quot;;}s:8:&quot;_content&quot;;s:25:&quot;http://pecl.php.net/rest/&quot;;}}}}}s:15:&quot;validatepackage&quot;;a:2:{s:8:&quot;_content&quot;;s:19:&quot;PEAR_Validator_PECL&quot;;s:7:&quot;attribs&quot;;a:1:{s:7:&quot;version&quot;;s:3:&quot;1.0&quot;;}}s:13:&quot;_lastmodified&quot;;s:31:&quot;Thu, 03 Jan 2008 11:48:06 -0700&quot;;}
</pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Ftimothybowler.com%2F2009%2F11%2F27%2Finstalling-apc-on-debian%2F';
  addthis_title  = 'installing+APC+on+debian';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://timothybowler.com/2009/11/27/installing-apc-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling nginx on debian lenny</title>
		<link>http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/</link>
		<comments>http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 12:30:34 +0000</pubDate>
		<dc:creator>Tim Bowler</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://timothybowler.com/?p=201</guid>
		<description><![CDATA[When I first looked at how old the nginx package in the debian repo was I thought that I should compile nginx. However, I eventually managed to find a more recent repo which I will post later.
Download nginx and install dependencies

We have to download the nginx source and perhaps a few modules. But before we [...]]]></description>
			<content:encoded><![CDATA[<p>When I first looked at how old the nginx package in the debian repo was I thought that I should compile nginx. However, I eventually managed to find a more recent repo which I will post later.</p>
<h1 style="margin-top: 20px">Download nginx and install dependencies</h1>
<p><span id="more-201"></span></p>
<p>We have to download the nginx source and perhaps a few modules. But before we can install this the system will need a few dependencies installed.</p>
<p>Download nginx from the website (http://wiki.nginx.org/Main)</p>
<pre class="brush: bash; light: true; toolbar: true;">wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz
tar -C /tmp nginx-0.7.64.tar.gz</pre>
<p>Download addition modules (http://wiki.nginx.org/Nginx3rdPartyModules)<br />
i.e. Headers more module:</p>
<pre class="brush: bash; light: true; toolbar: true;">
wget http://github.com/agentzh/headers-more-nginx-module/tarball/v0.01
tar -C /tmp agentzh-headers-more-nginx-mdule-c131b08.tar.gz</pre>
<p>We need to check for any dependencies and install them if needed. Therefore run:</p>
<pre class="brush: bash; light: true; toolbar: true;">aptitude show nginx</pre>
<p>This will show you the list of dependencies. Next is to install them:</p>
<pre class="brush: bash; light: true; toolbar: true;">apt-get install libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb-base</pre>
<h1 style="margin-top: 20px">Configure and compiling nginx of debian</h1>
<p>We can now go ahead and compile nginx on debian. The first thing to do is to configure the installation. Below I have set most of the options that will place nginx and its config/log files in similar locations to what your used to.</p>
<pre class="brush: bash; light: true; toolbar: true;">cd /tmp/nginx-0.7.64
./configure \
--sbin-path=/usr/sbin \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--user=www-data \
--group=www-data \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--add-module=/tmp/agentzh-headers-more-nginx-module-c131b08</pre>
<p>Once the configure script has finished we can run make and install nginx</p>
<pre class="brush: bash; light: true; toolbar: true;">make &amp;&amp; make install</pre>
<h1 style="margin-top: 20px">Create the nginx init script</h1>
<p>Just like all other services that you installed, we can create a nginx startup script. Create the file /etc/init.d/nginx and add the following:</p>
<pre class="brush: bash; light: true; toolbar: true;">#! /bin/sh

# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'sudo update-rc.d nginx defaults', or use the appropriate command on your
# distro.
#
# Author:       Ryan Norbauer
# Modified:     Geoffrey Grosenbach http://topfunky.com

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=&quot;nginx daemon&quot;
NAME=nginx
DAEMON=/usr/sbin/$NAME
CONFIGFILE=/etc/nginx/nginx.conf
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

d_start() {
 $DAEMON -c $CONFIGFILE || echo -n &quot; already running&quot;
}

d_stop() {
 kill -QUIT `cat $PIDFILE` || echo -n &quot; not running&quot;
}

d_reload() {
 kill -HUP `cat $PIDFILE` || echo -n &quot; can't reload&quot;
}

case &quot;$1&quot; in
 start)
 echo -n &quot;Starting $DESC: $NAME&quot;
 d_start
 echo &quot;.&quot;
 ;;
 stop)
 echo -n &quot;Stopping $DESC: $NAME&quot;
 d_stop
 echo &quot;.&quot;
 ;;
 reload)
 echo -n &quot;Reloading $DESC configuration...&quot;
 d_reload
 echo &quot;reloaded.&quot;
 ;;
 restart)
 echo -n &quot;Restarting $DESC: $NAME&quot;
 d_stop
 # One second might not be time enough for a daemon to stop,
 # if this happens, d_start will fail (and dpkg will break if
 # the package is being upgraded). Change the timeout if needed
 # be, or change d_stop to have start-stop-daemon use --retry.
 # Notice that using --retry slows down the shutdown process somewhat.
 sleep 5
 d_start
 echo &quot;.&quot;
 ;;
 *)
 echo &quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&quot; &amp;gt;&amp;amp;2
 exit 3
 ;;
esac

exit 0</pre>
<p>Make the nginx startup script executable so that we can run it</p>
<pre class="brush: bash; light: true; toolbar: true;">chmod +x /etc/init.d/nginx</pre>
<p>Finally we can make this script start on system startup.</p>
<pre class="brush: bash; light: true; toolbar: true;">/usr/sbin/update-rc.d -f nginx defaults</pre>
<h1 style="margin-top: 20px">Configuring virtual hosts on nginx</h1>
<p>We have to create a few directories to hold each virtual host and log files:</p>
<pre class="brush: bash;">mkdir /etc/nginx/sites-available/
mkdir /etc/nginx/sites-enabled/</pre>
<p>Configure the nginx server by opening the config file</p>
<pre class="brush: bash; light: true; toolbar: true;">nano /etc/nginx/nginx.conf</pre>
<p>Replace the text with the following:</p>
<pre class="brush: bash; light: true; toolbar: true;">user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
 worker_connections  1024;
 # multi_accept on;
}

http {
 include       /etc/nginx/mime.types;

 access_log    /var/log/nginx/access.log;

 sendfile        on;
 #tcp_nopush     on;

 #keepalive_timeout  0;
 keepalive_timeout  65;
 tcp_nodelay        on;

 gzip  on;
 gzip_disable &quot;MSIE [1-6]\.(?!.*SV1)&quot;;

 include /etc/nginx/conf.d/*.conf;
 include /etc/nginx/sites-enabled/*;

}</pre>
<p>I like to store my virtual hosts in /var/www/vhosts/host.com/httpdocs. Therefore create the directories:</p>
<pre class="brush: bash; light: true; toolbar: true;">mkdir /var/www/vhosts/host.com/httpdocs
mkdir /var/www/vhosts/host.com/logs</pre>
<p>We can now create a virtual host template. Therefore create the following file  /etc/nginx/sites-available/test.com and insert the content below <span style="text-decoration: underline;">making sure you change host.com to your domain name</span></p>
<pre class="brush: bash; light: true; toolbar: true;"># You may add here your
# server {
#    ...
# }
# statements for each of your virtual hosts

server {
 listen   80;
 server_name  host.com;

 access_log  /var/www/vhosts/host.com/logs/access.log;
 error_log  /var/www/vhosts/host.com/logs/error.log;    

 location / {
 root   /var/www/vhosts/host.com/httpdocs;
 index  index.html;
 }

 location /doc {
 root   /usr/share;
 autoindex on;
 allow 127.0.0.1;
 deny all;
 }

 location /images {
 root   /usr/share;
 autoindex on;
 }

 #error_page  404  /404.html;

 # redirect server error pages to the static page /50x.html
 #
 error_page   500 502 503 504  /50x.html;
 location = /50x.html {
 root   /var/www/nginx-default;
 }

 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
 #
 #location ~ \.php$ {
 #proxy_pass   http://127.0.0.1;
 #}

 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 #

 #if (!-e $request_filename) {
 #  rewrite  ^(.*)$  /index.php?q=$1  last;
 #  break;
 #}
#        try_files $uri $uri/ /wordpress/index.php?q=$uri;

 #location ~ \.php$ {
 #fastcgi_pass   127.0.0.1:9000;
 #fastcgi_index  index.php;
 #fastcgi_param  SCRIPT_FILENAME  /var/www/vhosts/test/httpdocs$fastcgi_script_name;
 #include /etc/nginx/fastcgi_params;
 #}

 # deny access to .htaccess files, if Apache's document root
 # concurs with nginx's one
 #
 #location ~ /\.ht {
 #deny  all;
 #}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#listen   8000;
#listen   somename:8080;
#server_name  somename  alias  another.alias;

#location / {
#root   html;
#index  index.html index.htm;
#}
#}

# HTTPS server
#
#server {
#listen   443;
#server_name  localhost;

#ssl  on;
#ssl_certificate  cert.pem;
#ssl_certificate_key  cert.key;

#ssl_session_timeout  5m;

#ssl_protocols  SSLv2 SSLv3 TLSv1;
#ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers   on;

#location / {
#root   html;
#index  index.html index.htm;
#}
#}</pre>
<p>Create a symlink which will make our virtual host config live:</p>
<pre class="brush: bash; light: true; toolbar: true;">ln -s /etc/nginx/sites-available/test /etc/nginx/sites-enabled/test</pre>
<p>Finally we can now start the nginx server</p>
<pre class="brush: bash; light: true; toolbar: true;">/etc/init.d/nginx start</pre>
<p>Now that we have nginx running, we need to make sure this service is always started. Therefore lets add it to our default run levels</p>
<pre class="brush: bash; light: true;">update-rc.d -f nginx defualts</pre>
<p>Hopefully you will now have the nginx server up and running. The next few blog posts will show how to incorporate PHP with nginx and to get both wordpress and symfony projects working.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Ftimothybowler.com%2F2009%2F11%2F25%2Fcompiling-nginx-on-debian-lenny%2F';
  addthis_title  = 'Compiling+nginx+on+debian+lenny';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
