Blogs

Run a script when the system starts up or reboots on Ubuntu.

1) Create script, on this example I'm starting the gluu-server service as the root user

$sudo nano /etc/init.d/MyScriptName

Copy/paste the following script, update accordingly:

#! /bin/sh
# /etc/init.d/MyScriptName
#

case "$1" in
  start)
    echo "Attempting to Start Gluu Server..."
    sudo -H -b service gluu-server start
    ;;
  stop)
    echo "Attempting to Stop Gluu Server..."
    sudo -H service gluu-server stop
    ;;
  *)
    echo "Usage: /etc/init.d/MyScriptName {start|stop}"
    exit 1
    ;;
esac

exit 0

2) Give the script executable permission

$sudo chmod +x /etc/init.d/MyScriptName

3) Tell script to run at startup. This tells the script be the first to shutdown and the last to…

Read more...
Monday, July 13, 2015

Update: I have updated this tutorial to a latest release of Varnish, read here.

By default, Varnish does not work and it will never work with HTTPS requests it only understands plain HTTP. This means, that on mixed content websites, sites serving HTTPS and HTTP pages, the secure pages won't be or cannot be cached on Varnish reducing the load time compared to the non-secure version of the page for example.
There are many sites that offer lots of static content through HTTPS that can definitely be cached using Varnish and in order to do so we need to implement an extra layer before any request goes to our Varnish Server. This layer is going to be handled by a Load Balancer/Proxy Server which will take care of routing the HTTP and the HTTPS requests, by interpreting SSL and converting the…

Read more...
Friday, March 27, 2015

Another good option to run Drupal sites nowadays is Nginx. Nginx is a Proxy/Web Server not as complex as Apache and is well known for is security, responsiveness and speed when handling PHP apps together with PHP-FMP. On this this post I will introduce you on how to manually install and run Nginx and PHP-FPM so you can host any Drupal site with SSL support.

Recommended posts:

The suggested installation instructions by drupal.org: https://www.drupal.org/node/2310819
Perusio Nginx suggested Drupal Configuration https://github.com/perusio/drupal-with-nginx/tree/D7#installation…

Read more...
Thursday, February 26, 2015

Angular JS is one of the most popular and robust Frameworks available today to build SPA, Single Page Apps.

Here's a quick tutorial on how to quick install it on Ubuntu 14.04.

Get the latest nodejs and npm packages:

$sudo add-apt-repository ppa:chris-lea/node.js
$sudo apt-get update

Install node.js and its package manager npm:

$sudo apt-get install nodejs

Now, let's install Yeoman angular generator, which is a nice angular project generator, it will handle you project packages, as well as create the initial project structure, folders etc.
Visit the project page for more reference and documentation: https://github.com/yeoman/generator-angular

$sudo npm install -g…
Read more...
Sunday, February 22, 2015

On this tutorial I will show you how to configure Varnish as a proxy server so you can re route you requests to any Apache or Nginx Server. 
Configuring Varnish on Ubuntu on distributed Servers is not a complex task, we just need to download some packages and then we will have to copy/paste the configurations below in order to start. Feel free to modify the provided configurations according to your needs. This post assumes there is another server Apache/Nginx listening on port 80 and running a Drupal site. 
Ok, Let's begin.

Install Varnish 3.0.5 from Ubuntu 14.04 repositories:

$sudo apt-get install varnish

Configure varnish deamon:

$sudo nano /etc/default/varnish


DAEMON_OPTS="-a :80,:…
Read more...
Tuesday, January 20, 2015