<?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>Robert Basic &#187; setup</title>
	<atom:link href="http://robertbasic.com/blog/tag/setup/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertbasic.com/blog</link>
	<description>the magic of coding...</description>
	<lastBuildDate>Mon, 30 Jan 2012 13:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>pywst &#8211; setting up web projects quickly</title>
		<link>http://robertbasic.com/blog/pywst-setting-up-web-projects-quickly/</link>
		<comments>http://robertbasic.com/blog/pywst-setting-up-web-projects-quickly/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 18:22:15 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://robertbasic.com/blog/?p=588</guid>
		<description><![CDATA[I wrote a Python script for automating the steps required to setup a web project environment on my local dev machine that runs on Ubuntu. Called it pywst: Python, Web, Svn, Trac. That&#8217;s the best I could do, sorry :P The main steps for setting up a new project are: Create a virtual host Add [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a Python script for automating the steps required to setup a web project environment on my local dev machine that runs on Ubuntu. Called it pywst: <strong>Py</strong>thon, <strong>W</strong>eb, <strong>S</strong>vn, <strong>T</strong>rac. That&#8217;s the best I could do, sorry :P</p>
<p>The main steps for setting up a new project are:</p>
<ul>
<li>Create a virtual host</li>
<li>Add it to /etc/hosts</li>
<li>Enable the virtual host</li>
<li>Import the new project to the SVN repository</li>
<li>Checkout the project to /var/www</li>
<li>Create a TRAC environment for the project</li>
<li>Restart Apache</li>
</ul>
<p>After these steps I have http://projectName.lh/ which points to /var/www/projectName/public/, SVN repo under http://localhost/repos/projectName/ and the TRAC environment under http://localhost/trac/projectName/.</p>
<p>As I have this ability to forget things, I always forget a step or 2 of this process. Thus, I wrote <a href="http://robertbasic.com/downloads/pywst.txt">pywst</a> (note, this is a txt file, to use it, save it to your HDD and rename it to pywst.py). It&#8217;s not the best and nicest Python script ever wrote, but gets the job done. All that is need to be done to setup a project with pywst is:</p>
<pre name="code" class="php">
sudo ./pywst.py projectName
</pre>
<p>2 things are required: to run it with sudo powers and to provide a name for the project.</p>
<h2>Future improvements</h2>
<p>The first, and the most important is to finish the <code>rollback()</code> method. Now, it only exits pywst when an error occurs, but it should undo all the steps made prior to the error.</p>
<p>Second, to make it work on other distros, not only on Ubuntu. That would require for me getting those other distros, set them up, look where they store Apache and stuff, where&#8217;s the default document root, etc. Hmm&#8230; This will take a while :)</p>
<p>Third, support PHP frameworks &#8211; Zend Framework, CodeIgniter and CakePHP &#8212; ZF is a must :P Under support I mean to create the basic file structure for them automagically.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://robertbasic.com/blog/pywst-setting-up-web-projects-quickly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Trac on Ubuntu</title>
		<link>http://robertbasic.com/blog/trac-on-ubuntu/</link>
		<comments>http://robertbasic.com/blog/trac-on-ubuntu/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 13:26:32 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://robertbasic.com/blog/?p=560</guid>
		<description><![CDATA[Today I was messing around with Trac, installing it and doing some basic configuration. While my dev machine gets updated, I want to share my process of installing Trac. What is Trac? As said on the Trac homepage: Trac is an enhanced wiki and issue tracking system for software development projects. It&#8217;s free, it&#8217;s open [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was messing around with <a href="http://trac.edgewall.org/">Trac</a>, installing it and doing some basic configuration. While my dev machine gets updated, I want to share my process of installing Trac.</p>
<h2>What is Trac?</h2>
<p>As said on the Trac homepage:</p>
<blockquote><p>Trac is an enhanced wiki and issue tracking system for software development projects.</p></blockquote>
<p>It&#8217;s free, it&#8217;s open source, it comes under the <a href="http://trac.edgewall.org/wiki/TracLicense">BSD license</a> and it&#8217;s really awesome. You can write a wiki with it, have a ticket system, connect it with SVN, so you can browse the sources from the browser and see all the commit messages, when was something changed, added&#8230; It can support one project, it can support multiple projects. It can be viewable/editable by anyone, or you can close it down for your little team&#8230;</p>
<p>Trac is big. It has lots of <a href="http://trac.edgewall.org/wiki/TracPlugins">plug-ins</a>, so you can extend and customize your Trac. I haven&#8217;t played with them yet, but as soon as I will, you&#8217;ll get <a href="http://feeds2.feedburner.com/robertbasic/blog/">notified</a> ;)</p>
<p>It&#8217;s written in <a href="http://python.org/">Python</a>. It can run on it&#8217;s own server, or it can run under Apache (where there are also <a href="http://trac.edgewall.org/wiki/TracInstall#WebServer">several options</a>). It can use SQlite, PostrgeSQL or MySQL databases. Currently it can connect only to SVN.</p>
<p>I&#8217;ll show you how to setup a basic Trac 0.11-dot-something-dot-something. It will run under Apache with <a href="http://code.google.com/p/modwsgi/">mod_wsgi</a>, use a SQlite database, connect to the SVN repository and require user authentication.</p>
<p><span id="more-560"></span></p>
<h2>Installing Trac</h2>
<p>Before anything, I want to say that my machine where I installed Trac has LAMP and SVN <a href="http://robertbasic.com/blog/lamp-and-svn-on-ubuntu-8-10/">configured like this</a>. So, this post is kinda the next part of that post.</p>
<p>First, I installed a Python tool, called Easy Install. It&#8217;s here to make our installation process easier. Lovely. Go to <a href="http://pypi.python.org/pypi/setuptools/">http://pypi.python.org/pypi/setuptools/</a>, scroll down to the downloads section and choose a Python egg to download (match it to your currently installed Python version &#8212; I have Python 2.5 so I downloaded &#8220;setuptools-0.6c9-py2.5.egg&#8221;).</p>
<p>Fire up a console and type:</p>
<pre name="code" class="php">
sudo sh setuptools-0.6c9-py2.5.egg
</pre>
<p>Of course, you need to match this to your own setuptools file.</p>
<p>Next, type:</p>
<pre name="code" class="php">
sudo easy_install Trac
</pre>
<p>EasyInstall will now locate Trac and it&#8217;s dependencies, download and install them.</p>
<p>Download the mod_wsgi:</p>
<pre name="code" class="php">
sudo apt-get install libapache2-mod-wsgi
</pre>
<p>It will install and enable mod_wsgi. And, in my case, it only tried to restart Apache, but for an unknown reason it fails to do so. If that happens, just do a quick:</p>
<pre name="code" class="php">
sudo /etc/init.d/apache2 restart
</pre>
<p>If you want Subversion with your Trac, you&#8217;ll need the python-subversion package:</p>
<pre name="code" class="php">
sudo apt-get install python-subversion
</pre>
<p>If you have it already, it&#8217;ll just skip it. If you want SVN, but you don&#8217;t have this package, later on it will show an error message like: Unsupported version control system &#8220;svn&#8221;.</p>
<p>Now to make a folder for Trac, where it will keep all the Trac projects and stuff.</p>
<pre name="code" class="php">
sudo mkdir /var/trac /var/trac/sites /var/trac/eggs /var/trac/apache
sudo chown -R www-data /var/trac
</pre>
<p>Under <code>/var/trac/sites</code> will be the files for Trac projects. The <code>/var/trac/eggs</code> folder will be used as a cache folder for Python eggs. <code>/var/trac/apache</code> will hold a wsgi script file.</p>
<p>The wsgi script is actually a Python script, but with the .wsgi extension, used by mod_wsgi. With this script, Trac will be able to run as a WSGI application.<br />
File: <code>/var/trac/apache/trac.wsgi</code></p>
<pre name="code" class="php">
import sys
sys.stdout = sys.stderr

import os
os.environ['TRAC_ENV_PARENT_DIR'] = '/var/trac/sites'
os.environ['PYTHON_EGG_CACHE'] = '/var/trac/eggs'

import trac.web.main

application = trac.web.main.dispatch_request
</pre>
<p>With this kind of script, one single Trac installation will be able to manage multiple projects (you can see <a href="http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac">here</a> some other scripts).</p>
<p>Configure Apache, add this to your <code>httpd.conf</code> file:</p>
<pre name="code" class="php">
WSGIScriptAlias /trac /var/trac/apache/trac.wsgi

&lt;Directory /var/trac/apache&gt;
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
&lt;/Directory&gt;
</pre>
<p>Restart Apache:</p>
<pre name="code" class="php">
sudo /etc/init.d/apache2 restart
</pre>
<p>If you go to <a href="http://localhost/trac/">http://localhost/trac/</a> in your browser, you should see an empty list of Available Projects. It&#8217;s empty, cause we haven&#8217;t added any project yet.</p>
<p>Now, let&#8217;s asume that we have a project called &#8220;testProject&#8221; with it&#8217;s source located in <code>/var/www/testProject</code> and a SVN repo located in <code>/var/svn/repos/testProject</code>. I&#8217;ll show how to add that project to Trac.</p>
<p>In console type:</p>
<pre name="code" class="php">
sudo trac-admin /var/trac/sites/testProject initenv
</pre>
<p>Note that you need to provide the full path to <code>/var/trac/sites</code>, cause it will create a Trac project in the current folder you&#8217;re in.</p>
<p>It will ask you now a few things:</p>
<ul>
<li>Project Name &#8212; the name of the project, e.g. &#8220;Trac testing project&#8221;</li>
<li>Database connection string &#8212; leave it empty, and it will use SQlite</li>
<li>Repository type &#8212; leave it empty, and it will use SVN</li>
<li>Path to repository &#8212; path to the project repo, e.g. <code>/var/svn/repos/testProject</code>
</ul>
<p>It will start to print out a bunch of lines, about what is it doing. In the end you&#8217;ll get a message like &#8220;Project environment for &#8216;testProject&#8217; created.&#8221; and a few more lines. One more thing. We need to add the whole project to www-data user, so it can manage the files:</p>
<pre name="code" class="php">
sudo chown -R www-data /var/trac/sites/testProject
</pre>
<p>If you direct your browser again to <a href="http://localhost/trac/">http://localhost/trac/</a>, you will now see a link for the <code>testProject</code>. Click it. There, a fully working basic Trac environment for your project. A wiki, a ticket/bug tracking system, a repo browser in only a few minutes. How cool is that? Very.</p>
<p>This Trac environment can now be accessible by everyone. If we do not want that, we need to add this to the <code>httdp.conf</code> file:</p>
<pre name="code" class="php">
&lt;Location /trac&gt;
    AuthType Basic
    AuthName "Trac login"
    AuthUserFile /var/trac/.htpasswd
    Require valid-user
&lt;/Location&gt;
</pre>
<p>Create the <code>.htpasswd</code> file:</p>
<pre name="code" class="php">
sudo htpasswd -bcm /var/trac/.htpasswd your_username your_password
</pre>
<p>All set. You&#8217;ll now have to login to Trac to be able to work on it. As I&#8217;m the big boss on my localhost, I gave myself some super-power privileges for Trac: TRAC_ADMIN. It&#8217;s like root on *NIX.</p>
<pre name="code" class="php">
sudo trac-admin /var/trac/sites/testProject permission add robert TRAC_ADMIN
</pre>
<p>Read more about <a href="http://trac.edgewall.org/wiki/TracPermissions">privileges</a>.</p>
<p>That would be it. With this kind of setup, for now, it&#8217;s working perfectly for me. For Trac that&#8217;s available from the whole Internet, more security measures are needed, but this is only on localhost, so this is enough for me.</p>
<p>Comments, thoughts, ideas? </p>
<p>Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://robertbasic.com/blog/trac-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>LAMP and SVN on Ubuntu 8.10</title>
		<link>http://robertbasic.com/blog/lamp-and-svn-on-ubuntu-8-10/</link>
		<comments>http://robertbasic.com/blog/lamp-and-svn-on-ubuntu-8-10/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 20:00:33 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://robertbasic.com/blog/?p=402</guid>
		<description><![CDATA[This post is a rewrite of one of my older posts, Ubuntu as a dev machine, but this time I&#8217;ll explain also how to setup a basic SVN besides the LAMP. Ubuntu 8.10 was released bout a month ago and today I wasn&#8217;t in the mood of doing any coding so I decided to try [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a rewrite of one of my older posts, <a href="http://robertbasic.com/blog/ubuntu-as-a-dev-machine/">Ubuntu as a dev machine</a>, but this time I&#8217;ll explain also how to setup a basic SVN besides the LAMP.</p>
<p><a href="http://www.ubuntu.com/">Ubuntu 8.10</a> was released bout a month ago and today I wasn&#8217;t in the mood of doing any coding so I decided to try out the new Ubuntu. Once again, I&#8217;m installing it under <a href="http://www.virtualbox.org/">VirtualBox</a> (VB), cause it seems that they still haven&#8217;t fixed the bug related to the rtl8187 chipset. Oh well&#8230;</p>
<p>Be sure to use VB v2.x.x. (v2.0.6. is the latest now), cause it&#8217;s recognizing the correct screen resolution, not like VB v.1.6.4, whit which I had to configure manually the xorg.conf file&#8230;</p>
<h2>Setting up LAMP</h2>
<p>Here are the commands:</p>
<pre name="code" class="php">
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
sudo /etc/init.d/apache2 restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
</pre>
<p>If mod_rewrite doesn&#8217;t work, do the following:</p>
<pre name="code" class="php">
sudo gvim /etc/apache2/sites-available/default
</pre>
<p>And change <code>AllowOverride None</code> to <code>AllowOverride All</code>.</p>
<h2>Setting up SVN</h2>
<p>I&#8217;m not gonna explain how SVN works or the terms, this is just how to set it up. If you are not familiar with versioning and Subversion, read this book: <a href="http://svnbook.red-bean.com/">Version Control with Subversion</a>. It&#8217;s free, available for download and contains probably everything you need to know about SVN. Be sure to learn the commands like commit, import, export, checkout, add, info, etc&#8230;</p>
<p>There are 2 ways for setting up SVN: as an Apache module or to use svnserve which is designed for SVN. As I already have Apache installed, the best solution is to use Apache for SVN. It&#8217;s using a module called mod_dav_svn.</p>
<p>The setup presented here is very basic, it has no authentication and probably is insecure, but it&#8217;s good for my needs on localhost.</p>
<p>The commands:</p>
<pre name="code" class="php">
sudo apt-get install subversion
sudo a2enmod dav
sudo /etc/init.d/apache2 restart
sudo apt-get install libapache2-svn
sudo /etc/init.d/apache2 restart
</pre>
<p>Now we have all packages installed, only the configuration left.</p>
<p>First, I create a folder called <code>svn</code> under the <code>var</code> folder:</p>
<pre name="code" class="php">
sudo mkdir /var/svn
</pre>
<p>Now I need to create a folder under the svn folder where all my repositories will be:</p>
<pre name="code" class="php">
sudo svnadmin create /var/svn/repos
</pre>
<p>We use the <code>svnadmin create</code> command to create the repository; <code>mkdir</code> is not good for this.</p>
<p>Next, open up the <code>httpd.conf</code> file and add the following lines to it:</p>
<pre name="code" class="php">
&lt;Location /repos&gt;
    DAV svn
    SVNPath /var/svn/repos
&lt;/Location&gt;
</pre>
<p>I&#8217;ve seen people creating a new user and group for SVN. I think (I haven&#8217;t looked into it detailed) that&#8217;s for the authentication stuff. I did a much simpler thing: I added the ownership over <code>/var/svn</code> to www-data (Apache user):</p>
<pre name="code" class="php">
sudo chown -R www-data /var/svn
</pre>
<p>This is probably a big security hole, but again: I use it only on localhost so I can live with that.</p>
<p>We are now ready to import a project into SVN, i.e. to add a project to the repository:</p>
<pre name="code" class="php">
svn import -m "First import to SVN" /import/from/here/project file:///var/svn/repos/project/trunk
</pre>
<p>To start working on that project we need to checkout it:</p>
<pre name="code" class="php">
svn checkout http://localhost/repos/project/trunk /var/www/project
</pre>
<p>Now the &#8220;project&#8221; is under SVN which should ease the development process. Since I&#8217;m using SVN I have no more backups of projects all over the place; if something goes wrong I know it&#8217;s under SVN and I can revert to any older working version of my project.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://robertbasic.com/blog/lamp-and-svn-on-ubuntu-8-10/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Ubuntu as a dev machine</title>
		<link>http://robertbasic.com/blog/ubuntu-as-a-dev-machine/</link>
		<comments>http://robertbasic.com/blog/ubuntu-as-a-dev-machine/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 07:04:15 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://robertbasic.com/blog/?p=293</guid>
		<description><![CDATA[This post is more of a note to myself, &#8217;cause I keep forgetting all these Linux commands, and spend hours setting up stuff right&#8230; I&#8217;m installing Ubuntu 8.04 on VirtualBox, with windows xp as the host machine. I must do it this way, because my wireless card is having some problems with Linux, something with [...]]]></description>
			<content:encoded><![CDATA[<p><em>This post is more of a note to myself, &#8217;cause I keep forgetting all these Linux commands, and spend hours setting up stuff right&#8230;</em></p>
<p>I&#8217;m installing <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> 8.04 on <a href="http://virtualbox.org" target="_blank">VirtualBox</a>, with windows xp as the host machine. I must do it this way, because my wireless card is having some problems with Linux, something with the drivers. The <strong>possible</strong> solution includes kernel compiling &#8212; thanks, but no thanks.</p>
<p>Anyway&#8230; The installation itself is no trouble, so I&#8217;ll skip that. I always keep the apt-cache from previous installations, sparing hours of updating the system&#8230; On the host I have a folder that I share between the host OS and the client OS and first I need to reach that folder, to get from it the apt-cache.</p>
<p>First, need to install the Guest Additions. In Virtualbox go to Devices &#8212;&gt; Install Guest Additions. In the console run:</p>
<pre name="code" class="php">
sudo /media/cdrom/VBoxLinuxAdditions.run
</pre>
<p>After it&#8217;s finished, we need to mount the shared folder:</p>
<pre name="code" class="php">
sudo mount -t vboxsf name_of_the_sharing_folder /path/to/mount_point
</pre>
<p>Now, for me, this command shows some error. Here&#8217;s what I have to do:</p>
<pre name="code" class="php">
sudo modprobe vboxfs
sudo mount -t vboxsf name_of_the_sharing_folder /path/to/mount_point
</pre>
<p>Something with some modules not being loaded into the kernel, not bothered with it really&#8230; Now I can copy the apt-cache to where it needs to be:</p>
<pre name="code" class="php">
sudo cp -r /path/to/mount_point/apt-cache /var/cache/apt/archives
</pre>
<p>Now do the system update. If the system update includes a kernel update, you&#8217;ll have to install Guest Additions once more&#8230;</p>
<p>Next installing the LAMP:</p>
<pre name="code" class="php">
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
sudo /etc/init.d/apache2 restart
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
</pre>
<p>That should do it. But hey! mod_rewrite still doesn&#8217;t work!</p>
<pre name="code" class="php">
sudo gvim /etc/apache2/sites-available/default
</pre>
<p>And change <code>AllowOverride None</code> to <code>AllowOverride All</code>.</p>
<p>There. I have a basic LAMP on Ubuntu under VirtualBox. I made a few snapshots of the VirtualBox image, in case I trash it (which probably will happen soon), so I don&#8217;t need to reinstall over again.</p>
<p>Now, I&#8217;m of to setup SVN&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://robertbasic.com/blog/ubuntu-as-a-dev-machine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

