Skip to content

Instantly share code, notes, and snippets.

@dogmatic69
Created March 3, 2011 22:05
Show Gist options
  • Save dogmatic69/853711 to your computer and use it in GitHub Desktop.
Save dogmatic69/853711 to your computer and use it in GitHub Desktop.
My normal setup... (many cake sites from one cake install)
--------------------------------------------------------------------------------
sudo apt-get install php5-dev mysql-server apache2|cherokee etc
cd /var/www
mkdir frameworks
cd frameworks
git clone git://github.com/cakephp/cakephp.git cakephp/
# you could run different versions by cloaning things a few times
git clone git://github.com/cakephp/cakephp.git cakephp1.2/
cd cakephp1.2
git checkout 1.2
git clone git://github.com/cakephp/cakephp.git cakephp1.3/
cd cakephp1.3
git checkout 1.3
etc
/var
/www
/frameworks
/cakephp <- git repo
/cake
/plugins
/vendors
/sites
/site1.com
/public_html
<files from cake app dir>
/webroot <- if you can, set this as webroot
index.php
app_controller.php etc
/site2.com
/public_html
<files from cake app dir>
/webroot <- if you can, set this as webroot
index.php
app_controller.php etc
# add the following line to php.ini
# this will allow you to add cake sites without having to change anything in index.php
# normally you change CAKE_CORE_INCLUDE_PATH but not anymore, if you cant change this...
include_path = "/var/www/frameworks/cakephp/"
# then create a vhost that is something like the following (for apache)
# save this to /etc/apache/sites-available/site1.com
<VirtualHost *:80>
ServerAdmin admin@site1.com
ServerName site1.com
DocumentRoot /var/www/sites/site1.com/public_html/webroot/
<Directory /var/www/sites/site1.com/public_html/webroot/>
Order Deny,Allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
ErrorLog /var/www/sites/site1.com/logs/error.log
</VirtualHost>
# add it to enabled and then restart
sudo a2enmod site1.com
sudo serivce apache2 restart
# alternative setup might work if you cant change your webroot
# make sure you have follow symlinks, ive not tested, but should work.
/var
/www <- webroot that cant change
/* symlinked files */ <-----------------------<----------------------<----------------------------<-------------------
/frameworks |
/cakephp <- git repo |
/cake |
/plugins |
/vendors ^
/sites |
/site1.com |
/public_html |
<files from cake app dir> |
/webroot >---------------------->---------------------------->---------------------->-------------
index.php
app_controller.php etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment