<?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>rickogden.com &#187; apache</title>
	<atom:link href="http://www.rickogden.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rickogden.com</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 14:29:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Virtual Hosts for Development with Apache on Ubuntu</title>
		<link>http://www.rickogden.com/2010/07/virtual-hosts-for-development-with-apache-on-ubuntu/</link>
		<comments>http://www.rickogden.com/2010/07/virtual-hosts-for-development-with-apache-on-ubuntu/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 14:58:38 +0000</pubDate>
		<dc:creator>Rick Ogden</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.rickogden.com/?p=355</guid>
		<description><![CDATA[I do a lot of development on Ubuntu, as I often have multiple projects on the go which are nothing to do with each other, it&#8217;s often easier to create separate virtual hosts on my local development machine. This means that when they are ready for the &#8220;real world&#8221;, they are already set up as [...]]]></description>
			<content:encoded><![CDATA[<p>I do a lot of development on Ubuntu, as I often have multiple projects on the go which are nothing to do with each other, it&#8217;s often easier to create separate virtual hosts on my local development machine. This means that when they are ready for the &#8220;real world&#8221;, they are already set up as isolated sites at the root of their domain (rather than in a subdirectory of an existing site).</p>
<p>In order to do this, you need to create a new virtual host in your Apache config. Create a new file in the directory /etc/apache2/sites-available and open it in your favourite editor. It doesn&#8217;t matter what the file is called, but it&#8217;s best to keep it descriptive. We&#8217;ll call this project &#8220;mysite&#8221;, so the file can be called &#8220;mysite&#8221;. In the file we need to configure the Apache virtual host.</p>
<pre class="brush: xml;">
&lt;VirtualHost 127.0.0.1&gt;
ServerName mysite.localhost
DocumentRoot /var/www/mysite/public/
&lt;/VirtualHost&gt;
</pre>
<p>In the VirtualHost tag, you put the IP, seeing as I only want this for local loopback (for development) I have just put 127.0.0.1. The ServerName is the URL that you use to connect to the site and the DocumentRoot is where the public documents are stored. This is a very basic set up, so there are many more options you can add.</p>
<p>To make the site enabled, you create a symbolic link to the file from the sites-enabled directory.</p>
<pre class="brush: plain; light: true;">
cd /etc/apache2/sites-enabled
ln -s ../sites-available/mysite mysite
</pre>
<p>You now need to add the subdomain (mysite.localhost) to the list of hosts, so open /etc/hosts in your favourite editor and append the line:</p>
<pre class="brush: plain; light: true;">127.0.0.1 mysite.localhost</pre>
<p>And then restart Apache:</p>
<pre class="brush: plain; light: true;">sudo /etc/init.d/apache2 restart</pre>
<p>Now you should be able to visit http://mysite.localhost on the local machine (assuming the directory does actually exist).</p>
<p>This should also be similar on MacOS and other linux Distros, but the file locations (particularly for Apache) will vary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickogden.com/2010/07/virtual-hosts-for-development-with-apache-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>suPHP + Userdir on Ubuntu</title>
		<link>http://www.rickogden.com/2010/01/suphp-userdir-on-ubuntu/</link>
		<comments>http://www.rickogden.com/2010/01/suphp-userdir-on-ubuntu/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 16:01:59 +0000</pubDate>
		<dc:creator>Rick Ogden</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>
		<category><![CDATA[userdir]]></category>

		<guid isPermaLink="false">http://www.rickogden.com/?p=214</guid>
		<description><![CDATA[Recently I&#8217;ve had the need to combine suPHP with the userdir mod for Apache on Ubuntu. By default they don&#8217;t play nice together. So here is a quick guide on how to get it working.
If you have installed a standard LAMP server (there are many guides on how to do this), you now need to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had the need to combine suPHP with the userdir mod for Apache on Ubuntu. By default they don&#8217;t play nice together. So here is a quick guide on how to get it working.</p>
<p>If you have installed a standard LAMP server (there are many guides on how to do this), you now need to install the suphp package for apache, this is called <em>libapache2-mod-suphp</em>:</p>
<pre class="brush: bash; light: true;">
$ sudo apt-get install libapache2-mod-suphp
</pre>
<p>Once that has been installed open the file /etc/suphp/suphp.conf in your favourite text editor. Find the line that has the docroot on, and change the docroot so that it is just &#8220;/&#8221;. This means that the suphp engine will parse anywhere in the file system, and not just in the standard html directory, thus allowing users to have their own.</p>
<pre class="brush: plain; light: true;">
docroot=/
</pre>
<p>You may also want to change the security options as appropriate, just change the &#8220;false&#8221; to &#8220;true&#8221; of the applicable ones the enable them. This is worth experimenting with. Further down you will want to set the &#8220;check_vhost_docroot&#8221; is set to false, this again is to do with the fact that userdirs are not in the vhost&#8217;s document root.</p>
<pre class="brush: plain; light: true;">
check_vhost_docroot=false
</pre>
<p>Finally you have the min_uid and min_gid properties. These are worth altering if you still want to be able to have a website running as www-data (such as the default website). If this is the case, change them both to the uid and gid of www-data (33 by default). It is not recommended to allow suphp to run as root, so do not set it to 0.</p>
<pre class="brush: plain; light: true;">
min_uid=33
min_gid=33
</pre>
<p>Finally, you need to enable the mods suphp and userdir, and disable the mod php5, this is done with two commands, and then restart apache2:</p>
<pre class="brush: bash; light: true;">
sudo a2dismod php5
sudo a2enmod userdir suphp
sudo /etc/init.d/apache2 restart
</pre>
<p>This should then allow you to run php scripts as the user who created them. To test this, create a new php file that contains:</p>
<pre class="brush: php; light: true;">
&lt;?php
system(id);
</pre>
<p>This will give you information of the user that the php process is running as. I recommend changing the ownership and retrying it, just make sure sure suphp is running as it should be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickogden.com/2010/01/suphp-userdir-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Happy New Year and Updates</title>
		<link>http://www.rickogden.com/2010/01/happy-new-year-and-updates/</link>
		<comments>http://www.rickogden.com/2010/01/happy-new-year-and-updates/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 09:35:49 +0000</pubDate>
		<dc:creator>Rick Ogden</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://www.rickogden.com/?p=212</guid>
		<description><![CDATA[With it being the festive season, I have not done a huge amount of interest recently. I&#8217;m hoping to have a few things for you soon. Currently I have been experimenting with Drupal, having never used it (properly) before, this is a real learning curve.
Also I am working on getting suPHP to work with userdir, [...]]]></description>
			<content:encoded><![CDATA[<p>With it being the festive season, I have not done a huge amount of interest recently. I&#8217;m hoping to have a few things for you soon. Currently I have been experimenting with Drupal, having never used it (properly) before, this is a real learning curve.</p>
<p>Also I am working on getting suPHP to work with userdir, to allow users of a server to have their own webspace in a secure fashion. I will be blogging about this when it is done.</p>
<p>However, I have found a few things that may be of interest:<br />
<a href="http://www.devtheweb.net/blog/2010/01/12/things-you-probably-didnt-know-about-php/" target="_blank">Things you probably didn&#8217;t know about PHP</a> &#8211; Some really interesting and neat things you can do with PHP.</p>
<p><a href="http://www.phpobjectgenerator.com/" target="_blank">PHP Object Generator</a> &#8211; Generates class structures and objects, so you don&#8217;t have to</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rickogden.com/2010/01/happy-new-year-and-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
