How to compile and install latest version of Nginx (1.6) from source with PageSpeed module (ngx_pagespeed)

PageSpeed (ngx_pagespeed) is a Nginx module created by Google to help Make the Web Faster by rewriting web pages to reduce latency and bandwidth.

The version included with Debian Wheezy is 1.2 which is getting pretty old. Here’s how to install the latest stable version of Nginx with the PageSpeed module.

This tutorial is tested on Debian 7.x (wheezy) but may work with other versions.

1. Install required packages

apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev git
Continue reading

How to compile and install Nginx from source with PageSpeed module (ngx_pagespeed)

PageSpeed (ngx_pagespeed) is a Nginx module created by Google to help Make the Web Faster by rewriting web pages to reduce latency and bandwidth.

In this tutorial you’ll be installing Nginx 1.2. If you want to install the latest stable version of Nginx (1.6), read this instead: How to compile and install latest version of Nginx (1.6) from source with PageSpeed module (ngx_pagespeed)

This tutorial is tested on Debian 7.x (wheezy) but may work with other versions.

1. Install required packages

apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev git
Continue reading

Install and configure PowerDNS with geo backend (CDN/geographic DNS blancing)

The Geo backend can be used to distribute queries globally using an IP-address/country mapping table, several of which are freely available online or can be acquired for a small fee.

This allows visitors to be sent to a server close to them, with no appreciable delay, as would otherwise be incurred with a protocol level redirect. Additionally, the Geo backend can be used to provide service over several clusters, any of which can be taken out of use easily, for example for maintenance purposes.

The Geo backend is in wide use, for example by the Wikimedia foundation, which uses it to power the Wikipedia global load balancing.

This tutorial has been tested on Debian 7.x (wheezy).

1. Install PowerDNS server and the Geo backend

apt-get install pdns-server pdns-backend-geo
Continue reading

How to detect if your server is vulnerable to the Shellshock bug and fix it

Shellshock vulnerability is a security bug affecting Unix/Linux operating system through the bash shell. Disclosed on September 24 2014, it has been rated 10 (the maximum score) for severity by NIST. Debian installs bash by default so you’re probably affected!

To check if your server is vulnerable, run this command:

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
Continue reading

How to detect if your server is vulnerable to the Heartbleed OpenSSL bug and fix it

HeartbleedThis is a serious bug affecting a lot of servers including Debian Wheezy. Act fast because everything is being scanned and information is being leaked right now!

The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. This weakness allows stealing the information protected, under normal conditions, by the SSL/TLS encryption used to secure the Internet. The Heartbleed bug allows anyone on the Internet to read the memory of the systems protected by the vulnerable versions of the OpenSSL software. This compromises the secret keys used to identify the service providers and to encrypt the traffic, the names and passwords of the users and the actual content. This allows attackers to eavesdrop on communications, steal data directly from the services and users and to impersonate services and users.

It’s really easy to use to bug to steal information from affected systems without having any access to it or the network. To check if your server is infected and see what information it is exposing you can use this python script: hb-test.py

To use the script, make sure you have python installed and run the following command:

python hb-test.py www.example.org
Continue reading

How to add a new hard disk or partition using UUID and ext4 filesystem

Adding a additional hard disk to your workstation or server is easy and often required. Here’s we’ll step through the process of identifing the newly attached drive, prepare and mount it by referencing UUID which is a preferred method today.

If you have just added a virtual disk to a virtual machine, make sure you restart the virtual machine before mounting the new disk.

1. Figure out the device name for the new device

fdisk -l
Continue reading

How to install Nginx with PHP and MySql support on wheezy

Nginx is an open source reverse proxy server, load balancer, HTTP cache, and a web server. The Nginx project started with a strong focus on high concurrency, high performance and low memory usage. Users have been moving to Nginx because of the high performance and stability and as of February 2014, Nginx is hosting around 15% of all web servers according to Netcraft’s Web Server Survey.

In this tutorial we’ll cover install and configuring Nginx, PHP (with PHP-FPM) and MySql server.

1. Install MySql server

apt-get install mysql-server
Continue reading

How to install ownCloud on wheezy

ownCloud gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web.

1. Add the ownCloud repository as apt source

echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list
Continue reading

How to install DirectAdmin on squeeze

DirectAdmin is a web hosting control panel providing a graphical interface and automation tools to simplify server and account management. Features include: E-mail, FTP, DNS and web management, Statistics, Apache configuration, User and reseller management and more.

Before you install DirectAdmin, make sure you have a fresh installation of Debian 6 (squeeze), either 32 or 64 bit. This tutorial is only tested on squeeze but it should also work on Debian 4 and 5. Continue reading