This blog is about technology, mainly Linux and Android. Mostly I shall share my own learning experience here. Tips and tricks, tutorials etc. I can't promise to be accurate here and welcomes all suggestions. I am getting these information from people and I am sharing it with you, so feel free to comment and spread this knowledge in rest of the world. Please experiment all advice on test systems, no guarantees :)

Deploying a facebook php app locally on Linux

As in my previous post I said that currently I am having a tryst with Facebook apps. Going further I thought of setting up a local environment where I could make changes locally and see them without uploading on heroku website. I find lots of issues which finally got resolved thanks to generous guys on internet. Following their path I am sharing the complete list of instructions I followed to deploy the Facebook app locally here.First of all you need to create an app on facebook and host it on heroku website following instructions from following link.

Please bear in mind that I chose to deploy the main app locally rather than creating a dev app.If you find any problem related to ssh keys these commands may help you as they did for me.

# ssh -vT git@heroku.com

Above command checks whether a secure connections with heroku site is possible or not. If you get any errors try generating a ssh key and submitting it to heroku.

# ssh-keygen
# heroku keys:add ~/.ssh/id_rsa.pub

Follow my previous post to create virtual hosts, also don’t forget to set facebook app id and app secret in “/etc/apache2/conf/extra/httpd-vhosts.conf” file under VirtualHost tag as below. You can these two from Facebook app site.

Still I kept getting permission error so I changed the owner of the directory to www-data as below.

# chown -R www-data .

So the permission error vanished, please bear in mind that may have further repercussions but for now things worked for me. I got this help while setting up Joomla! locally so applied this here as well.