Ajenti + Nginx + Phalcon

Recently I was supposed to deploy a Phalcon code on an Ajenti based VPS. Seems that Google is not familiar with this type of configuration on internet, so I decided to drop few lines on setting up Ajenti. This short tutorial is tested on:

  • Ubuntu 14.04.1 LTS
  • Nginx 1.4.6
  • Ajenti
  • Phalcon 1.3.0

Step 1: Make sure dependencies are met.

Use Ajenti to open Terminal, and install Phalcon from the repository:

sudo apt-add-repository ppa:phalcon/stable
sudo apt-get update 
sudo apt-get install php5-phalcon

If not using Ubuntu, follow the tutorial here to compile and install Phalcon.

Step 2: Make sure Phalcon is present in the php.ini files. Running

cat /etc/php5/mods-available/phalcon.ini

should output the following:

extension = phalcon.so

Step 3: Setup Nginx to use Phalcon

Make sure that you point to the public folder of the Phalcon app as the root of the website. Once the website is created, add the following in Advanced -> Custom configuration :

try_files $uri $uri/ @rewrite;
location @rewrite {
 rewrite ^/(.*)$ /index.php?_url=/$1;

And this should do it.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s