Skip to content
Vasilis Kalintiris edited this page Mar 12, 2014 · 3 revisions

Packages

Update Packages

sudo apt-get update
sudo apt-get upgrade

Install Apache:

sudo apt-get install apache2 libapache2-mod-php5 php-pear

Install SQLite

sudo apt-get install sqlite php5-sqlite

Install MySQL:

sudo apt-get install mysql-client mysql-server php5-mysql

Then, create a MySQL user.

Install PHPMyAdmin (Optional)

sudo apt-get install phpmyadmin

Install Git

sudo apt-get install git

Install curl:

sudo apt-get install curl php5-curl

Download codebender

git clone https://github.com/codebendercc/bachelor

Configure Symfony:

cd to the `Symfony` folder
curl -s https://getcomposer.org/installer | php
php composer.phar install

Create database and schema:

cd to Symfony/
php app/console doctrine:database:create 
php app/console doctrine:schema:create
php app/console doctrine:fixtures:load
sudo chmod -R 777 app/cache/ app/logs/

Fix Permissions for FileDisk Controller (if you use disk as the storage layer)

sudo chmod -R 777 path_to_your_codebender_fs_dir

Enable mod_rewrite:

sudo a2enmod rewrite

Restart apache:

sudo service apache2 restart

Configure apache:

sudo vim /etc/apache2/sites-available

Paste the following:

<VirtualHost *:80>
    ServerName codebender.cc
    ServerAdmin root@localhost
    DocumentRoot /var/www/codebender.cc/Symfony/web
    DirectoryIndex app.php
    SetEnv APPLICATION_ENV "production"
    <Directory /var/www/website/Symfony/web>
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Use Fixtures to load sample data

(TODO)

Log in as sample user

(TODO)

PHPUnit Setup (optional)

If you want to use PHPUnit to run unit tests on the command line, or using the compiler's testing API (more info on that in the Compiler API page), you'll need to install PHPUnit. In ubuntu 12.04, you'll need to run the following commands.

sudo apt-get install phpunit
sudo pear upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover pear.symfony.com
sudo pear install --alldeps phpunit/PHPunit

Compiler

Install PEAR

sudo apt-get install php-pear

Install Clang

sudo apt-get install clang

Install avr-gcc:

sudo apt-get install gcc-avr

To be fixed

Install Arduino files

sudo apt-get install arduino
  • Cron tasks for auto-git-fetch

Libraries

Install codebender-libs

git clone https://github.com/codebendercc/libs

* Configure `Symfony/app/config/parameters.yml` based on `Symfony/app/config/parameters.dist.yml`
* Set directory in `parameters.yml`

Set permissions for app/cache and app/logs dirs

Enable mod_rewrite:

sudo a2enmod rewrite

Restart Apache:

sudo service apache2 restart

In Apache configuration file add the following:

<VirtualHost *:80>
    ServerName libs.codebender.cc
    #ServerAlias www.example.com
    ServerAdmin root@localhost
    DirectoryIndex index.php
    DocumentRoot /var/www/libs/Symfony/web

    <Directory /var/www/libs/Symfony/web/>
          Options -Indexes FollowSymLinks MultiViews
          AllowOverride All
          Order allow,deny
          Allow from all
    </Directory>
</VirtualHost>

Sender

Install TFTP

Install a tftp server daemon locally to test shit:

sudo apt-get install tftpd-hpa