Hello All,
Lately we have been digging into FB apps and all the "scaling" requirements that come along. For this reason I started looking into deploying an Apostrophenow project on Heroku (
http://heroku.com), and see what sort of walls I would encounter. Heroku applications are deploying using "git push" so there is not a lot of control over the environment.
This is going to be a bit longwinded, so bear with me.
I started off by reading this
http://blog.pajap.com/?p=102, which seemed simple enough, migrate .htaccess to the root of the project, work the Rewrite magic ( way beyond my comfort zone) and wallah! all done. At least that is what I thought so initially :), but 15 hours later I just gave up.
The first hurdle came with the database. On heroku you get a ClearDB Mysql instance for you to play with. So from my local command line I was able to create a "prod" environment in database.yml and run the appropriate doctrine commands. This successfully built the necessary tables on the the remote database. The problem started when I noticed that doing a "symfony cc --env=prod" would not empty the "a_cache_item" table in the remote database I had to do this manually.
Once I figured that one out I moved onto my next problem which was routing. For the life of me I couldn't get my request to look like this (htaccess attached)
The problem with this was that assets such as images would be requested like so "
http://host/images/...blah". Of course some others where being requested as "
http://host/web/images/...blah", so in order to get over this hurdle I introduced a RewriteRule to make the first case match the second ( which contains [web] in path).
Now the final issues (2 to be exact) was with asset-cache. I noticed that the "asset-cache" was not being created, even though a_project_root/web/uploads/ was empty. As it turned out it was because "a_cache_item" was not being emptied by the "cc" command, and aHelper would not create the files.
Once I fixed this, I came to the last issue which beat me to the ground, and eventually I gave up. When the assets (css,js) are combined into a single file all the urls in the resulting "asset-cache/{hash}.[css | js ]" files had "/uploads/cache/" PRE-PENDED. So "url(/images/hello.jpg)" would become "url(/uploads/cache//images/hello.jpg)" in the css file. The interesting part is that in the "a_item_cache" the css was correct, at some point when this information is written this occurs but I can fathom where.
I know this is not symfony/apostrophenow/http specific, but it was a little bit of everything. To conclude I would like to know if anyone is willing to get me through this. I promise an article by the end quoting all of you :) .
Best,
Fotis