Published on

Symfony2 deployment target configuration


A checklist for the things that need to be configured in our Symfony2 deploy target

  1. Rent VPS solution
  2. Install ubuntu 12.04 with LAMP and SSH server
  3. Upgrade PHP to PHP5.4
    1. add php5 repository
      • sudo apt-get install python-software-properties
      • sudo add-apt-repository ppa:ondrej/php5
    2. apt-get upgrade
    3. apt-get dist-upgrade
    4. restart apache2
  4. install node and less
   apt-add-repository ppa:chris-lea/node.js
    apt-get update
   apt-get install nodejs
   sudo npm install less
  1. sudo apt-get install openjdk-7-jre (for yuicompressor)
  2. sudo apt-get install php5-intl (for lib-icu)
  3. sudo apt-get install git
  4. sudo apt-get install acl
  5. configure mysql user, password and db
   mysql -u root -p
   create database dbname;
   grant all privileges on dbname.\* to username@localhost identified by 'password';
  1. create unix deploy user and set password
sudo useradd -m deploy
sudo passwd deploy
  1. put in "acl,defaults" into /etc/fstab , then mount -a to remount it.
  2. set permissions on cache and logs folder
    - setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
    - setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
  1. configure apache2 to load /var/www/deployname/current/web in /etc/apache2/sites-available/000-default.conf
  2. enable mod_rewrite sudo a2enmod rewrite
  3. set timezone in /etc/php5/apache2/php.ini date.timezone = "Europe/Amsterdam"
  4. set AllowOverride All in /etc/apache2/apache2.conf
  5. ensure authorization is rewritten:
   RewriteEngine on
   RewriteCond %{HTTP:Authorization} ^(._)
   RewriteRule ._ - [e=HTTP_AUTHORIZATION:%1]
  1. configure capifony deploy script