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:
[Wed Aug 28 14:15:56 2013] [error] [client xxxxxxxxxxxxxxxxx] File does not exist: /var/www/js, referer: http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/
[Wed Aug 28 14:15:56 2013] [error] [client xxxxxxxxxxxxxxxxx] File does not exist: /var/www/js, referer: http://xxxxxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com/
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?
EDITED: webroot/index.php:
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');
BELOW THIS IS STANDARD CONTENT OF INDEX.PHP WHICH IT WRITTEN NOT TO CHANGE
sites-available/Default:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/FC/app/webroot
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
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/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
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?
*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...' ?? *