Monday, February 24, 2014

CakePHP - multiple projects on one Apache and CakePHP core

CakePHP - get multiple projects working on apache.
If you want to run two cakephp projects on one instance of Cake core, and apache, here is some useful info:

Edit - /etc/apache2/extra/httpd-vhosts.conf 
Add the following:

    ServerAdmin webmaster@one.local
    DocumentRoot "/Users/d/Documents/project/one/webroot/"
    ServerName one.local
    ServerAlias www.one.local
    ErrorLog "/private/var/log/apache2/one-error_log"
    CustomLog "/private/var/log/apache2/one-access_log" common

   
      Order allow,deny
      Allow from all
      #Options +Indexes
      Options -Indexes +FollowSymLinks
      AllowOverride All
   

    ServerAdmin webmaster@app.local
    DocumentRoot "/Users/d/Documents/project/app/webroot/"
    ServerName app.local
    ServerAlias www.app.local
    ErrorLog "/private/var/log/apache2/app.com-error_log"
    CustomLog "/private/var/log/apache2/app.com-access_log" common

   
      Order allow,deny
      Allow from all
      #Options +Indexes
      Options -Indexes +FollowSymLinks
      AllowOverride All
   



Now you have the two apps at:
http://one.local/
http://app.local/