Skip to content

How to set up a new dev site (subdomain)

benomatis edited this page Sep 9, 2017 · 3 revisions

Note: this process can only be used by someone with access to the server

I. Set up DNS on the hosting side (Pete).

II. Set up the code

  1. ssh into server1
  2. cd /var/www/Sites
  3. (assuming there is an up-to-date version of the VE repo in my home folder, and that my user is part of the sudoers) sudo git clone ~/Yii/.git xxxx.vocaleyes.org
  4. su - root
  5. cd /var/www/Sites/xxxx.vocaleyes.org
  6. Copy db, debug and params from database to protected/config: cp database/db.php protected/config (…etc)
  7. nano protected/config/db.php
  8. Change host localhost to localab2 > Save (Ctrl + X, Y, Enter)
  9. chmod 777 protected/runtime
  10. mkdir assets
  11. chmod 777 assets
  12. cd ..
  13. chown -R developer:developer xxxx.vocaleyes.org
  14. su - developer
  15. cp dev.vocaleyes.org/.git/config xxxx.vocaleyes.org/.git/config
  16. cd xxxx.vocaleyes.org
  17. git checkout -b xxxx
  18. git pull origin xxxx:xxxx

III. Set up apache redirection

  1. cd /etc/apache2/sites-available
  2. cp dev.vocaleyes.org.conf xxxx.vocaleyes.org.conf
  3. nano xxxx.vocaleyes.org.conf
  4. Replace every occurrence of dev with xxxx
  5. Ctrl + w
  6. Ctrl + r
  7. Type dev > Enter
  8. Type xxxx > Enter
  9. a
  10. Ctrl + x
  11. Y > Enter
  12. cd ../sites-enabled
  13. ln -s /etc/apache2/sites-available/xxxx.vocaleyes.org.conf /etc/apache2/sites-enabled/xxxx.vocaleyes.org.conf
  14. service apache2 restart

IV. Edit crontab

  1. nano /export/users/developer/update-script.sh
  2. Add the following lines at the logical place

cd /var/www/Sites/xxxx.vocaleyes.org/ git fetch -a &&
git checkout xxxx &&
git pull origin xxxx && \