language: python
python:
  - "2.7"
before_install:
  - sudo apt-get install apache2 libapache2-mod-wsgi
install:
  - pip install -r requirements.txt
before_script:
  - mysql -e 'create database pkppln;'
  - mysql -uroot pkppln < markstestdb.sql
  - eval "echo \"`cat wsgi.conf`\"" > /tmp/wsgi.conf
  - sudo cp /tmp/wsgi.conf /etc/apache2/conf.d/wsgi.conf
  - sudo chmod o+x ${TRAVIS_BUILD_DIR}
  - sudo service apache2 restart
script: "py.test tests.py"
after_failure:
   - cat /etc/apache2/conf.d/wsgi.conf

language: python
python:
  - "2.7"
before_install:
  - sudo apt-get install apache2 libapache2-mod-wsgi
  - sudo chmod o+x $TRAVIS_BUILD_DIR
install:
  - pip install -r requirements.txt
before_script:
  - mysql -e 'create database pkppln;'
  - mysql -uroot pkppln < markstestdb.sql
  - eval "echo \"`cat wsgi.conf`\"" > /tmp/wsgi.conf
  - sudo cp /tmp/wsgi.conf /etc/apache2/conf.d/wsgi.conf
  - sudo service apache2 restart
script: "py.test tests.py"
after_failure:
   - cat /etc/apache2/conf.d/wsgi.conf

Put chmod command in before_install section.
Put chmod command in before_install section.
