Install the web interface

The procces is describe for a Debian (lenny) and other debian like system (ubuntu,…)

Begin with the dependency :

# aptitude install apache2 php5 php5-cli php5-pgsql php5-xdebug php-apc php5-imagick php5-ldap

And don’t forget to set up your database.

check you have writing rights on /var/www/

and there, checkout the code :

git clone --recursive https://github.com/naturalsciences/Darwin.git

Then Go into /var/www/web folder (you can now remove writing rights on the /var/www directory if you want)

and configure the database connection :

cp config/databases.yml.init config/databases.yml

and settings :

cp config/darwin.yml.init config/darwin.yml

(and the config/app.yml if you wish)

and edit the databases.yml set your host / username / password .

Rem.: By default the public part of the application gets connected to the database with the same user who’s got right to do CRUD actions. If you wish to have the read only user to be used for the public part of the application connection, please do:

cp apps/public/config/databases.yml.init apps/public/config/databases.yml

and edit the databases.yml to set the host / read only username / read only user password.

Don’t forget to add the cache directory and the log directory:

mkdir /var/www/web/cache
 mkdir /var/www/web/log

Then, configure your apache often in /etc/apache2/sites-enabled/000-default

and set :

DocumentRoot /var/www/web/web
            DirectoryIndex index.php
            Alias /sf /var/www/web/lib/vendor/symfony/data/web/sf/
            <Directory "/var/www/web/lib/vendor/symfony/data/web/sf">
                    AllowOverride All
                    Allow from All
            </Directory>
            <Directory "/var/www/">
                AllowOverride All
                Allow from All
            </Directory>

add also the rewrite capabilities to apache :

sudo a2enmod rewrite

and don’t forget to restart apache :

sudo /etc/init.d/apache2 restart

and fix the permissions for symfony in the /var/www/web/ :

php symfony project:permission

You can then add the first administrator with the command :

php symfony darwin:add-admin

The task ask you for a given name, family name, login, and password. It add also every widgets for the user.

Application configuration :

You also may want to configure some settings in config/darwin.yml like http proxy settings or others…

Configure Php :

Modify the php config in the file /etc/php5/apache2.php.ini :

file_uploads = On
    upload_max_filesize = 10M



    memory_limit = 128M; At least 128M

Additional required tool :

At this step, darwin will work for a testing or demo environement but you need to add some configurations to automate some tasks

For Import module

You’ll need incron to react to a new file import and a cron to check rows

Install the software :

sudo aptitude install incron

Edit /etc/incron.allow file and add www-data

Create /etc/incron.d/import file and add the line below :

/var/www/web/uploads IN_CREATE sh /var/www/web/tools/import.sh

Create /etc/cron.hourly/check-import file and add the line below :

php /var/www/web/symfony darwin:check-import --do-import 2>/var/www/web/log/import_log_error.log

Multimedia temporary file management

In order to delete all files that are older than X hours, add a cron file in /etc/cron.d/clean_tmp_upload

and add this line

*  */2   * * *   root  find /http/darwin/uploads/multimedia/temp -mmin +120 -delete

To retrieve news from twitter (Caution …subject to change)

Add file in /etc/cron.d/fetch_news

*/10 * * * *     root /http/darwin/tools/fetch_feed.sh > /dev/null 2>&1