<?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>GIS and Web Tricks &#187; redmine</title>
	<atom:link href="http://www.bernawebdesign.ch/byteblog/tagged/redmine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bernawebdesign.ch/byteblog</link>
	<description>Thougts and tricks on GIS, web development and FOSS</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:52:30 +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>Symfony project on (bluehost) shared hosting</title>
		<link>http://www.bernawebdesign.ch/byteblog/2009/07/10/symfony-project-on-bluehost-shared-hosting/</link>
		<comments>http://www.bernawebdesign.ch/byteblog/2009/07/10/symfony-project-on-bluehost-shared-hosting/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 07:55:19 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[(bluehost) shared hosting]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://www.bernawebdesign.ch/byteblog/?p=17</guid>
		<description><![CDATA[set up a working Symfony project (with SVN) on my bluehost shared hosting, this tutorial should work for other hosters with minor changes. What I wanted was to be able of using my account as a development server for a small group of developers that would automatically show the last revision of the SVN repository. I pushed the solution further and created on the same account two more subdomains for the staging and production server.]]></description>
			<content:encoded><![CDATA[<p>So, I finally made it, set up a working <a href="http://www.symfony-project.org">Symfony</a> project (with SVN) on my bluehost shared hosting plan, this tutorial should work for other hosters with minor changes. What I wanted was to be able of using my account as a development server for a small group of developers that would automatically show the last revision of the SVN repository. I pushed the solution further and created on the same account two more subdomains for the staging and production server. Please note that this last point is not the best thing to do, but I did it since we don&#8217;t know yet where we will put our production server when the application will really go live. As well, small budget apps could be set up this way if you really want 3 environments and you can&#8217;t afford a better hosting solution. Finally I installed <a href="http://www.redmine.org/">Redmine</a> so that we&#8217;ve a fully integrated development server with issues tracking, road-map, wiki, documentation and repository browsing.<span id="more-17"></span><br />
Please note that bluehost uses something that looks like chroot jails, but read <a href="http://trac.symfony-project.org/wiki/SharedHostingNotSecure">here</a> for some concerns about symfony on shared hosts. Furthermore, i never use https in this tutorial, since I m using this as a test platform. As well this solution symlinks a www available folder to a folder outside public_html which could have some security implications. So remember security is as strong as the weakest link and YOU need to take care of it.</p>
<p>
Since setting up the whole thing it was a bit of an hassle, here how I did it (you need ssh acces to your account):</p>
<ul>
<li><a href="#subdomains">Setup subdomains and working folders</a></li>
<li><a href="#install-svn">Install Subversion (SVN)</a></li>
<li><a href="#setup-svn">Setup Subversion (SVN)</a></li>
<li><a href="#setup-symfony">Setup Symfony (with doctrine ORM)</a></li>
<li><a href="#symfony-clone">Cloning ./symfony for use over http</a></li>
<li><a href="#post-commit-hook">SVN post-commit hook</a></li>
<li><a href="#install-redmine">Install Redmine (not mandatory)</a></li>
</ul>
<h3><a name="subdomains"></a>Setup subdomains and working folders</h3>
<p>I decided to have the following structure:</p>
<ul>
<li>/home/YOURACCOUNT/DEDICATEDFOLDER/dev/  (dev.domain.com)</li>
<li>/home/YOURACCOUNT/DEDICATEDFOLDER/stage/ (stage.domain.com)</li>
<li>/home/YOURACCOUNT/DEDICATEDFOLDER/prod/ (domain.com)</li>
</ul>
<p>each of this folders will be the root of the relative environment of the symfony project. This folders are NOT accessible from the web, we will create symlinks later for that purpose.</p>
<ul>
<li>/home/YOURACCOUNT/public_html/dev/web</li>
<li>/home/YOURACCOUNT/public_html/stage/web</li>
<li>/home/YOURACCOUNT/public_html/addonDOMAIN_web (nb no prod)</li>
</ul>
<p>In cpanel create the two subdomains (dev and stage) and point them to the relative folders in public_html (NB, I worked with an add-on domain so when i created it I just pointed it to addonDOMAIN_web, if you want to do it with your main domain, you should be able to do so with a redirection or so). Now we need to delete this folders and create the symlinks (remember you CAN point a symlink to a folder that does not exist [yet]).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>public_html<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> dev<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span> stage<span style="color: #000000; font-weight: bold;">/</span>web web<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span> dev<span style="color: #000000; font-weight: bold;">/</span>web
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>stage<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span> stage<span style="color: #000000; font-weight: bold;">/</span>web
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>prod<span style="color: #000000; font-weight: bold;">/</span>web<span style="color: #000000; font-weight: bold;">/</span> addonDOMAIN_web</pre></div></div>

<p>You are done, now your (sub)domains point to the web folder of the symfony project. The free bite is that you can control the access to the /home/YOURACCOUNT/public_html/dev or stage folder with .htacces files so that your dev and stage environment are accessible only to who you want.
</p>
<h3><a name="install-svn"></a>Install Subversion (SVN)</h3>
<p>well, I had done this a while ago and I don&#8217;t recall exactly each step I did, but I successfully installed SVN 1.5.4. Just google for installing SVN on bluehost and there are plenty of blogs/forums discussing it. For example <a href="http://www.bluehostforum.com/showpost.php?p=67753&#038;postcount=25">here</a>.</p>
<h3><a name="setup-svn"></a>Setup Subversion (SVN)</h3>
<p>Once you have installed SVN, you are ready to go. Create a folder for your repos in your home and then your repository</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> svnRepositories
<span style="color: #7a0874; font-weight: bold;">cd</span> svnRepositories
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create yourRepo</pre></div></div>

<p>now your repo is accessible to you at</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">@</span>domain.com<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>svnRepositories<span style="color: #000000; font-weight: bold;">/</span>yourRepo</pre></div></div>

</p>
<p>To access this you will be prompted for your account password, which (of course) you don&#8217;t want to type every time nor give to other developer. Luckily enough SSH keys come handy.<br />
To avoid typing the password every time you want to connect to your account just set up a key pair for yourself and upload the public key to the server (this can be done very easily in cpanel or by coping the .pub file in .ssh on you account and by coping the key in the .ssh/authorized_keys AND .ssh/authorized_keys2 file &#8211; ervey key a new line).</p>
<p>Now, you could do the same for the other developers but this would mean granting them the full access to your account. Again, SSH comes very handy, do the same as above for each new developer BUT prepend this to their public key in the .ssh/authorized_keys AND .ssh/authorized_keys2 file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">command</span>=<span style="color: #ff0000;">&quot;/home/YOURACCOUNT/bin/svnserve -t -r /home/YOURACCOUNT/svnRepositories/yourRepo --tunnel-user=DEVNAME&quot;</span>,no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty</pre></div></div>

<p>this will authorize the key only for svnserve (which is what we need to use svn) and specifies the svn username of the developer (if you plan on installing redmine, you will be able to map this to a redmine username).<br />
so, the .ssh/authorized_keys AND .ssh/authorized_keys2 file would look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ssh-rsa AAAB3NzaC1yc2EAAAABIwAAAQEA6mrAlzDrYE3xQTK<span style="color: #000000; font-weight: bold;">/</span>G0IzQGYvW0prZuKEgPlpc3iCuLmkUF20UVcixem45W7u5A3nJR2N953jNc3t0z93PK5bL2UsaLdQAy33XjovxhCdJjtXDaNUpIesh<span style="color: #000000; font-weight: bold;">/</span>n5po7XJ9DWH2gdIJGedtNiTLYTmpQzL9GM<span style="color: #000000; font-weight: bold;">/</span>30yEE4XXOjJGAxObsceNUt0lBINKOERYXoJFxvqSoU9Prs7dpRX9sEsAIX98rkDkEVEZIYNMbYOPiWNVbcnbMXLVEYwIxoz+8cbqeaiaWHL3k5pKjTeUzCd4a+<span style="color: #007800;">YJ2zYQYREK8cNeanuCL6kvFv55nv1kf4KoWw7L8kvf3lLqZXnpShTKcHPfWI0cETd3Q</span>== my id_rsa.pub
<span style="color: #007800;">command</span>=<span style="color: #ff0000;">&quot;/home/YOURACCOUNT/bin/svnserve -t -r /home/YOURACCOUNT/svnRepositories/yourRepo --tunnel-user=jonnyDev&quot;</span>,no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2qCnsU3zC0FN4fMXqd4hQbwc31Q3EGZk6ruWGEv<span style="color: #000000; font-weight: bold;">/</span>IyA+e2bnQJhR1pjCruQ3OeB9ZG3BlBNKXPcDZ9sRYbBjQ<span style="color: #000000; font-weight: bold;">/</span>Hs5FLTd<span style="color: #000000; font-weight: bold;">/</span>IhMUcrfZGB3mN0yQeAhFvbD4IXEfGsqVD8sO79S7LH5IPsHpJWthZxZ8fUPXi7u6OmbX<span style="color: #000000; font-weight: bold;">/</span>LS<span style="color: #000000; font-weight: bold;">/</span>xlXBf60uttlTuPBFAhpNoGeR75FSAFg0ZhW6NFhbBVplB2jrD3amEJBbSfD88GMmUngwtvGn5Lr7v<span style="color: #000000; font-weight: bold;">/</span>dEhXiAMa25BorA6086hn11aDFLTaGJnz7Ne<span style="color: #000000; font-weight: bold;">/</span>jdPwCeEobi40X5ZHmHW7<span style="color: #000000; font-weight: bold;">/</span>eyACpYmcoVBEph7wV5W+uJ09ZoLl<span style="color: #000000; font-weight: bold;">//</span>n<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">PLPYEpTpw</span>== jonnyDev jonnyDev.pub</pre></div></div>

</p>
<p>After this, you can access your account without password and the other developers can do the same but only for SVN purposes. The only difference is that the developers will have to use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">@</span>domain.com<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p> to checkout and commit to the repository.</p>
<p>Now you should initialize your repository for example by creating the standard folders &#8220;trunk, branches, tags&#8221;.<br />
locally (not on the server) do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> trunk branches tags
<span style="color: #c20cb9; font-weight: bold;">svn</span> checkout <span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">@</span>domain.com<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>svnRepositories<span style="color: #000000; font-weight: bold;">/</span>yourRepo
<span style="color: #c20cb9; font-weight: bold;">svn</span> add <span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> commit <span style="color: #660033;">-m</span><span style="color: #ff0000;">&quot;initialize folder structure&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> ~<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Your repository is ready and you can tell your developers to check out the trunk (or whatever you want) with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">@</span>domain.com<span style="color: #000000; font-weight: bold;">/</span>trunk localDir</pre></div></div>

</p>
<h3><a name="setup-symfony"></a>Setup Symfony (with doctrine ORM)</h3>
<p>based on <a href="http://www.symfony-project.org/jobeet/1_2/Doctrine/en/01">Symfony tutorial</a> and <a href="http://stereointeractive.com/blog/2008/12/10/starting-a-new-symfony-project/">this blog entry</a></p>
<p>Checkout the repository (probably only the trunk) to the folder you want your application to reside into, and cd into the trunk. All following comands will be performed from the root of the trunk directory (the root of our new symfony application).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>symApps<span style="color: #000000; font-weight: bold;">/</span>trunk
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> lib
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> lib<span style="color: #000000; font-weight: bold;">/</span>vendor
<span style="color: #c20cb9; font-weight: bold;">svn</span> propedit <span style="color: #c20cb9; font-weight: bold;">svn</span>:externals lib<span style="color: #000000; font-weight: bold;">/</span>vendor</pre></div></div>

<p>after the propedit comand, an editor will open, enter</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">symfony http:<span style="color: #000000; font-weight: bold;">//</span>svn.symfony-project.com<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>RELEASE_1_2_7<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #666666; font-style: italic;">#or the most uptodate tagged version</span>
<span style="color: #666666; font-style: italic;">#or symfony http://svn.symfony-project.com/branches/1.2/ if you want the DEV version</span></pre></div></div>

<p>now commit your changes</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;added symfony as external in lib/vendor&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> update lib<span style="color: #000000; font-weight: bold;">/</span>vendor</pre></div></div>

<p>Now check if symfony works:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php lib<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>symfony<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>check_configuration.php
php lib<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>symfony<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>symfony <span style="color: #660033;">-V</span></pre></div></div>

<p>this should print out some information on your configuration  and the symfony version.</p>
<p>
You are now ready to create the project</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">php lib<span style="color: #000000; font-weight: bold;">/</span>vendor<span style="color: #000000; font-weight: bold;">/</span>symfony<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>symfony generate:project yourproject</pre></div></div>

<p>and to create the frontend application</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">symfony generate:app <span style="color: #660033;">--escaping-strategy</span>=on <span style="color: #660033;">--csrf-secret</span>=UniqueSecret frontend</pre></div></div>

<p>For better portability, change the absolute path to the symfony installation to a relative one:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// config/ProjectConfiguration.class.php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php'</span><span style="color: #339933;">;</span></pre></div></div>

</p>
<p>Now we put the project into SVN:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> cache<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> log<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> cache
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> log
<span style="color: #c20cb9; font-weight: bold;">svn</span> add <span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> propedit <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore log <span style="color: #666666; font-style: italic;">#enter * in the editor</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> propedit <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore cache <span style="color: #666666; font-style: italic;">#enter * in the editor</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;creating project structure&quot;</span></pre></div></div>

<h3><a name="symfony-clone"></a>Cloning ./symfony for use over http</h3>
<p>Unfortunately, bluehost has no PDO on its CLI PHP, which means that we CAN&#8217;T run any doctrine tasks using the comand line&#8230; pretty annoying (how could reset the dev DB after each commit). To be able to perform this tasks we need to be able to call symfony using wget (or curl). To do so we create a symfony_dev.php file in the web folder of our project (like a controller, i suggest calling it *_dev.php so it won&#8217;t be deployed to the prod server by the deploy task) and a copy of ./symfony (named for example symfony.php) in the root of the project. To avoid an erro page to be displayed you need to add a line with an echo statement to Symfony.php like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;CLI output: <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">chdir</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/config/ProjectConfiguration.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span>sfCoreAutoload<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBaseDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/command/cli.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The web/symfony_dev.php should look like that:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
 * @author: Marco Bernasocchi (http://www.bernawebdesign.ch)
 * @license: http://www.gnu.org/licenses/gpl-3.0.html * wrapper that calls a clone of ./symfony to allow using ./symfony without CLI by calling this file with wget like this:
 * wget symfony_dev.php?cmd=doctrine:build-all-reload --env=dev --no-confirmation
 * this is needed when the PHP CLI has no PDO
 */</span>
<span style="color: #666666; font-style: italic;">// this check prevents access to debug front controllers that are deployed by accident to production servers.</span>
<span style="color: #666666; font-style: italic;">// feel free to remove this, extend it or make something more sophisticated.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'127.0.0.1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'::1'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dev.DOMAIN.com'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'You are not allowed to access this file. Check '</span><span style="color: #339933;">.</span><span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' for more information.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>beginsWith<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cmd'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'doctrine:'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'To run tasks that do not need PDO (for example Doctrine), use the real comand line'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cmd'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//gets the cmd param from the get, for example doctrine:build-all-reload --env=dev --no-confirmation</span>
<span style="color: #990000;">array_unshift</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cmd</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'./symfony'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//sets the arguments needed for the CLI</span>
<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'argv'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$cmd</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'argc'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'argv'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//calling the clone</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../symfony.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> beginsWith<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sub</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sub</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$sub</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3><a name="post-commit-hook"></a>SVN post-commit hook (or putting it all together)</h3>
<p>The goal was to have a fresh snapshot of the dev site every time a commit is performed, that means that we need to customize our post-commit hook, so open up /home/YOURACCOUNT/svnRepositories/yourRepo/hooks/post-commit and add the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;"># POST-COMMIT HOOK</span>
<span style="color: #007800;">REPOS</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #007800;">REV</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
<span style="color: #666666; font-style: italic;">#export the dev version of the site</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #c20cb9; font-weight: bold;">file</span>:<span style="color: #000000; font-weight: bold;">///</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>svnRepositories<span style="color: #000000; font-weight: bold;">/</span>yourRepo<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #666666; font-style: italic;">#update the redmine(issues tracker) DB</span>
<span style="color: #666666; font-style: italic;">#ruby /home/YOURACCOUNT/railsApps/redmine/script/runner &quot;Repository.fetch_changesets&quot; -e production</span>
<span style="color: #666666; font-style: italic;">#move into dev project root</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>YOURACCOUNT<span style="color: #000000; font-weight: bold;">/</span>DEDICATEDFOLDER<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #666666; font-style: italic;">#initiate log.txt</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;###NEW COMMIT &quot;</span><span style="color: #007800;">$REPOS</span><span style="color: #ff0000;">&quot; rev:&quot;</span><span style="color: #007800;">$REV</span><span style="color: #ff0000;">&quot; &quot;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #660033;">-u</span> +<span style="color: #ff0000;">&quot;%F_%T %Z&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> log.txt
<span style="color: #666666; font-style: italic;">#reset application DB</span>
<span style="color: #666666; font-style: italic;">#calls the http version of ./symfony doctrine:build-all-reload --env=dev --no-confirmation</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-o</span> log.tmp <span style="color: #660033;">-O</span> CLI_output.tmp <span style="color: #660033;">--user</span>=HTTPUSER_dev <span style="color: #660033;">--password</span>=PASSW http:<span style="color: #000000; font-weight: bold;">//</span>dev.domain.com<span style="color: #000000; font-weight: bold;">/</span>symfony_dev.php?<span style="color: #007800;">cmd</span>=doctrine:build-all-reload<span style="color: #000000; font-weight: bold;">%</span>20--env=dev<span style="color: #000000; font-weight: bold;">%</span>20--no-confirmation
<span style="color: #c20cb9; font-weight: bold;">cat</span> log.tmp	<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> log.txt
<span style="color: #c20cb9; font-weight: bold;">cat</span> CLI_output.tmp	<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> log.txt
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> log.tmp CLI_output.tmp
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> log.txt
<span style="color: #666666; font-style: italic;">#clear symfony cache</span>
.<span style="color: #000000; font-weight: bold;">/</span>symfony <span style="color: #c20cb9; font-weight: bold;">cc</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> log.txt
<span style="color: #666666; font-style: italic;">#commit-email.pl &quot;$REPOS&quot; &quot;$REV&quot; commit-watchers@example.org</span>
<span style="color: #666666; font-style: italic;">#log-commit.py --repository &quot;$REPOS&quot; --revision &quot;$REV&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> log.txt <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ..<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>symfonyCommitlog.txt
<span style="color: #666666; font-style: italic;">#cat log.txt</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> log.txt</pre></div></div>

</p>
<h3><a name="install-redmine"></a>Install Redmine (not mandatory)</h3>
<p>Finally, to install redmine follow my <a href="http://www.bernawebdesign.ch/byteblog/2009/07/02/installing-redmine-on-bluehost-shared-hosting/">previous post</a>, disable the &#8220;autofetch commits&#8221; option in the administration page (settings?tab=repositories) and uncomment the following line to your post-commit hook:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>fotolion<span style="color: #000000; font-weight: bold;">/</span>railsApps<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>runner <span style="color: #ff0000;">&quot;Repository.fetch_changesets&quot;</span> <span style="color: #660033;">-e</span> production</pre></div></div>

<p>this will trigger the update of redmine&#8217;s DB after each commit. On the same page you can map redmine usersnames to svn usernames to have tight coupling even at this level.</p>
<h3>Conclusion</h3>
<p>I&#8217;ve shown how to create a symfony development environment on a shared hosting where PDO is not available on the command line PHP. Furthermore I shown how to add it to subversion and how to integrate everything together thanks to redmine.</p>
<p>now you are ready to do some &#8220;rock solid development on a shoestring&#8221; <img src='http://www.bernawebdesign.ch/byteblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
enjoy Marco</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bernawebdesign.ch/byteblog/2009/07/10/symfony-project-on-bluehost-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing Redmine on (bluehost) shared hosting</title>
		<link>http://www.bernawebdesign.ch/byteblog/2009/07/02/installing-redmine-on-bluehost-shared-hosting/</link>
		<comments>http://www.bernawebdesign.ch/byteblog/2009/07/02/installing-redmine-on-bluehost-shared-hosting/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 12:56:07 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.bernawebdesign.ch/byteblog/?p=3</guid>
		<description><![CDATA[script to install readmine  0.8.4 on a shared host that offers ruby on rails. ]]></description>
			<content:encoded><![CDATA[<p>Hi, here a script to install readmine  0.8.4 (<a href="http://redmine.org">www.readmine.org</a>) on a shared host that offers ruby on rails. enjoy<span id="more-3"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#automatic install of redmine 0.8.4 (http://www.redmine.org/) on a shared server (tested on bluehost)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#AUTHOR: Marco Bernasocchi (http://www.bernawebdesign.ch)</span>
<span style="color: #666666; font-style: italic;">#LICENSE: http://www.gnu.org/licenses/gpl-3.0.html</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#BEFORE starting:</span>
<span style="color: #666666; font-style: italic;"># - create an empty DB (using cpanel) and a DB user with full permissions on the db</span>
<span style="color: #666666; font-style: italic;"># - create a mail user used to send out mails (quota can be set to 1Mb since you just need to send mails with it)</span>
<span style="color: #666666; font-style: italic;"># - cd into the dir you want to install to. (for example /home/username/railsApps/redmine)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#AFTER (not mandatory):</span>
<span style="color: #666666; font-style: italic;"># - create a subdomain (in cpanel) for redmine and link it to the public folder in redmine</span>
<span style="color: #666666; font-style: italic;"># example: </span>
<span style="color: #666666; font-style: italic;"># 	delete the default created folder</span>
<span style="color: #666666; font-style: italic;"># 	rm -rf /home/username/public_html/redmine/</span>
<span style="color: #666666; font-style: italic;">#	create symlink to the public folder</span>
<span style="color: #666666; font-style: italic;"># 	ln -s /home/username/railsApps/redmine/public /home/username/public_html/redmine		</span>
<span style="color: #666666; font-style: italic;"># now redmine is located at http://yoursubdomain.example.com</span>
<span style="color: #666666; font-style: italic;"># login: admin</span>
<span style="color: #666666; font-style: italic;"># passw: admin</span>
<span style="color: #666666; font-style: italic;">#set this vars</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">MY_DB</span>=<span style="color: #ff0000;">&quot;dbName&quot;</span>
<span style="color: #007800;">MY_DB_USER</span>=<span style="color: #ff0000;">&quot;dbUser&quot;</span>
<span style="color: #007800;">MY_DB_PASSW</span>=<span style="color: #ff0000;">&quot;dbPassw&quot;</span>
<span style="color: #007800;">MY_DOMAIN</span>=<span style="color: #ff0000;">&quot;example.com&quot;</span>
<span style="color: #007800;">MY_MAIL_SUBDOMAIN</span>=<span style="color: #ff0000;">&quot;mail.&quot;</span>
<span style="color: #007800;">MY_MAIL_PORT</span>=<span style="color: #ff0000;">&quot;26&quot;</span>
<span style="color: #007800;">MY_MAILER</span>=<span style="color: #ff0000;">&quot;user+example.com&quot;</span>
<span style="color: #007800;">MY_MAILER_PASSW</span>=<span style="color: #ff0000;">&quot;mailPassw&quot;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#get redmine 0.8.4</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">56909</span><span style="color: #000000; font-weight: bold;">/</span>redmine-0.8.4.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf redmine-0.8.4.tar.gz
<span style="color: #c20cb9; font-weight: bold;">rm</span> redmine-0.8.4.tar.gz
<span style="color: #c20cb9; font-weight: bold;">mv</span> redmine-0.8.4<span style="color: #000000; font-weight: bold;">/*</span> .
<span style="color: #c20cb9; font-weight: bold;">rmdir</span> redmine-0.8.4
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#use fastCGI dispatcher</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> public<span style="color: #000000; font-weight: bold;">/</span>dispatch.fcgi.example public<span style="color: #000000; font-weight: bold;">/</span>dispatch.fcgi
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#set some permissions</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> public<span style="color: #000000; font-weight: bold;">/</span>dispatch.fcgi
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> tmp
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> log
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#force production environnement</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s|# ENV\[|ENV\[|g'</span> config<span style="color: #000000; font-weight: bold;">/</span>environment.rb <span style="color: #000000; font-weight: bold;">&gt;</span> TMPFILE <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> TMPFILE config<span style="color: #000000; font-weight: bold;">/</span>environment.rb
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#create config/database.yml</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'production:'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' adapter: mysql'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' database: '</span><span style="color: #007800;">$MY_DB</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' host: localhost'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' username: '</span><span style="color: #007800;">$MY_DB_USER</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' password: '</span><span style="color: #007800;">$MY_DB_PASSW</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">' encoding: utf8'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>database.yml
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#create config/email.yml</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'# Outgoing email settings'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'production:'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'  delivery_method: :smtp'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'  smtp_settings:'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    address: '</span><span style="color: #007800;">$MY_MAIL_SUBDOMAIN</span><span style="color: #007800;">$MY_DOMAIN</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    port: '</span><span style="color: #007800;">$MY_MAIL_PORT</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    domain: '</span><span style="color: #007800;">$MY_DOMAIN</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    authentication: :login'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    user_name: '</span><span style="color: #007800;">$MY_MAILER</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'    password: '</span><span style="color: #007800;">$MY_MAILER_PASSW</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> config<span style="color: #000000; font-weight: bold;">/</span>email.yml
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#create app</span>
rake db:migrate <span style="color: #007800;">RAILS_ENV</span>=<span style="color: #ff0000;">&quot;production&quot;</span>
rake redmine:load_default_data <span style="color: #007800;">RAILS_ENV</span>=<span style="color: #ff0000;">&quot;production&quot;</span></pre></div></div>

<p>If you plan to integrate with a repository don&#8217;t forget to check the settings>repositories tab, where it says &#8220;Fixing keywords&#8221;, it is a very cool function that allows you to automatically change the issue status by using keywords in the commit message.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bernawebdesign.ch/byteblog/2009/07/02/installing-redmine-on-bluehost-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

