First time SSH

When ssh'ing to your server, very likely you will get warnings that the locale is not set correctly, or is not installed.

This is because the server (by default) accepts the locale that your machine sends when connecting to the server, in my case nl_NL is not by default installed on the server, therefor i get a warning.

To prevent this error from occuring, update the ssh configuration

sudo nano /etc/ssh/sshd_config

Find the following code (ctrl + w)

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

And change it to

# Allow client to pass locale environment variables
# AcceptEnv LANG LC_*

Restart the ssh service

sudo service ssh restart

And update the installed packages

sudo apt-get update && sudo apt-get upgrade

MongoDB installation

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

Apache installation

sudo apt-get install apache2

Enable mod_headers & mod_rewrite (for use in .htaccess)

sudo a2enmod rewrite
sudo a2enmod headers
sudo apachectl restart

Good practice for production servers would be to not broadcast your apache / php version:

sudo nano /etc/apache2/conf-enabled/security.conf
# Find the ServerTokens setting and set it to Prod
ServerTokens Prod

# Find the ServerSignature setting and set it to Off
ServerSignature Off

Restart apache

sudo apachectl restart

PHP + Phalcon + Mongo-php Installation

Install phalcon by adding the stable phalcon repository first,and then installing php plus the required modules:

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

Test your php installation

sudo nano /var/www/html/info.php
<?php
phpinfo();

Last updated: some time ago, I you have any improvements, write me on LinkedIn.