Turbulences installation

Prerequesites

  • a linux server (reportedly working on Windows but this is not supported for now - see at the end of this page)
  • Apache 2 (+ access to its configuration to add a virtualhost on your system)
    • mod rewrite enable.
  • MySQL 5+
  • PHP 5.2+ with:
    • mbstring
  • ImageMagick?

TODO:

  • check symlinks
  • you can try to install with the install script?
  • check windows install procedure (end of file); update script as well

Install

  • create a directory for your project
    $ mkdir myproject
    $ cd myproject
    
  • install a copy of Turbulences there
    $ svn export -rHEAD svn://turb.ulenc.es/turb/trunk .
    $ ls -1
    base
    whitecopy
    
  • you have two directories: base which contains all framework libraries and whitecopy which is a skeleton for your app; so you shall rename it:
    $ rename whitecopy myapp
    

Register new !MySQL database and user for your application (say turb_db with turb_user and turb_pass on your localhost).

$ cd myapp/vendor/turbulences
$ ln -s ../../../base
$ cd -

Configure

Now you need to configure your application:

Apache virtualhost

Configure a virtualhost in your Apache config;

  • set AllowOverride All and DocumentRoot to myproject/myapp/public (think of setting the right full system path here; sample below)
    NameVirtualHost turbapp
    <VirtualHost turbapp>
      ServerAdmin your.email@example.org
    
      DocumentRoot /var/www/test-turb/public/
      <Directory /var/www/test-turb/public/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
      </Directory>
    
      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
      </Directory>
    
    
      LogLevel warn
    </VirtualHost>
    

var/host

Put the name of your virtualhost AND the port number in a myproject/myapp/var/host file (for instance, 'localhost' or 'localhost:80' or 'localhost:8888')

conf.yaml

Update your application configuration file (in myproject/myapp/conf/conf.yaml):

  • the "env" section allows to define a list of environments (dev, test, prod), the list being "vhost:port": env_name
  • then you define env_name detailed configuration below
  • see the example below:
    app:
        id: tuto
        name: tuto
        version: 0.1
    env:
        vhosts:
            'tuto': prod
            'tuto:8080': dev
        dev:
            public_url: http://$vhost/
            db:
                user: turb_user
                pass: turb_pass
                base: turb_db
                host: localhost
                privileges: ALL
            imagemagick_path: /usr/bin/
            mysql_filename: /usr/bin/mysql
        prod:
            public_url: http://$vhost/
            db:
                user: turb_user
                pass: turb_pass
                base: turb_db
                host: localhost
                privileges: ALL
            imagemagick_path: /usr/bin/
            mysql_filename: /usr/bin/mysql
    

FS permissions

Now, make sure the permissions of myapp/var are properly set up:

$ chgrp -R www-data myapp/var
$ chmod -R g+w myapp/var
$ find myapp/var -type d -exec chmod g+s {} \;

Run install script

Finally, run the install script:

$ php myapp/script/install

that will check everything is ok and install default SQL files.

You are done. Go to http://yourvirtualhost.

If things work as expected, you may continue to the first tutorial. Else, please feel free to report the issue using the ticket system.


Install on Windows

by Emmanuel Mazurier (DoYouBuzz).

In order to run Turbulences on a Windows host, we must recreate symbolic links (NTFS mandatory).

Windows 2000 / xp

Windows Vista / 2008

Contrary to junction, mklink makes true symbolic links; see http://www.mydigitallife.info/2007/05/22/create-symbolic-links-hard-links-and-directory-junctions-in-vista-with-mklink/

Setup

  • In base : go to base/lib:
    • junction nusoap ..\vendor\nusoap
    • junction pear ..\vendor\pear
    • junction smarty ..\vendor\smarty
    • junction spyc ..\vendor\spyc
  • in your white copy: go to myapp/vendor/turbulences:
    • junction base ..\..\..\base
  • go in myapp
    • junction tmp var\tmp
  • go in myapp/public
    • junction var ..\var\data\public

  • go in myapp/public/script
    • junction cache ..\..\tmp\cache\script
  • go in myapp/public/style
    • junction cache ..\..\tmp\cache\style

This should make it run under Windows but other setup may be needed still (apache, mysql, php tuning).