title: Cakephp application displays incorrect path on ec2
body: <p>I have a cakephp project under folder name FC which contains app folder, index.php etc. which i uploaded on ubuntu instance on ec2. When I uploaded the folder, it was showing index folder so I uploaded the contents directly under FC into www folder so it could get index.php file automatically. Now the website started displaying but plain, without css or images or js. I looked at error log, and it's displaying this:</p>
  
  <p>[Wed Aug 28 14:15:56 2013] [error] [client xxxxxxxxxxxxxxxxx] File does not exist: /var/www/js, referer: <a href="http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/" rel="nofollow">http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/</a></p>
  
  <p>[Wed Aug 28 14:15:56 2013] [error] [client xxxxxxxxxxxxxxxxx] File does not exist: /var/www/js, referer: <a href="http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/" rel="nofollow">http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/</a></p>
  
  <p>Clearly this shows that the paths are being set incorrectly. Now the path I've given for my js and images is in webroot folder, so I have my images in img folder and js in js folder under webroot so as path i just provide "filename.whatever" and that worked fine on localhost.
  How do I need to set my paths so they will point to the correct place? When I inspect element on a botched image, it shows path /img/xxxx.jpg. Which means cake automatcally goes into image/js/css folder which is how my code was working on local machine. Now when I manually give path, like /www/app/webroot/img/xxx.jpg, it attaches itlike this: img/www/app/...etc. Please help! Is there documentation available on this or if someone has done this before?</p>
  
  <p>EDITED:
  <strong>webroot/index.php:</strong></p>
  
  <pre><code>if (!defined('DS')) {
      define('DS', DIRECTORY_SEPARATOR);
  } 
  
  define('ROOT', '/var/www/FC');   
  
  define('APP_DIR', 'app');
  
  define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'FC' . DS . 'lib');
  </code></pre>
  
  <p><em>BELOW THIS IS STANDARD CONTENT OF INDEX.PHP WHICH IT WRITTEN NOT TO CHANGE</em></p>
  
  <p><strong>sites-available/Default:</strong></p>
  
  <pre><code>  &lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
  
      DocumentRoot /var/www/FC/app/webroot
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride All
      &lt;/Directory&gt;
      &lt;Directory /var/www&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          Order allow,deny
          allow from all
      &lt;/Directory&gt;
  
      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      &lt;Directory "/usr/lib/cgi-bin"&gt;
          AllowOverride All
          Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
  
      # Possible values include: debug, info, notice, warn, error, crit,
      # alert, emerg.
      LogLevel warn
  
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      Alias /doc/ "/usr/share/doc/"
      &lt;Directory "/usr/share/doc/"&gt;
          Options Indexes MultiViews FollowSymLinks
          AllowOverride All
          Order deny,allow
          Deny from all
          Allow from 127.0.0.0/255.0.0.0 ::1/128
      &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>By the way, my Index.ctp redirects to multiple links which are located in LocationsController including index.ctp, whereas cake is trying to find FCController. Do i need to rename locationscont to FCcont to match conventions maybe?</p>
  
  <p>*<em>I just found out, the urls inside the view and controller etc. all start like this '/FC/locations/...etc.' Do I need to give urls from base path, ie '/var/www/FC...' ?? *</em></p>