Tuesday, November 27, 2012

Setting up a LEMP Virtual Server part 3

Introduction

This is the third part of my LEMP virtual server setup. This portion involves installing the NginX web server, MySQL database, and PHP software.

Tuesday, November 20, 2012

Setting up a LEMP Virtual Server part 2

Introduction

This is the second part of my LEMP virtual server setup. This portion involves configuring various virtual machine settings. I'll also go over the basic setup for SSH and SAMBA access.

Tuesday, November 13, 2012

Setting up a LEMP Virtual Server Part 1

Introduction

Recently I was in the process of setting up a LEMP virtual server. The idea was to have a private web server that I could play around and test with. Since I didn't have a spare computer to host my server, I decided to go with a virtual server. A LEMP server consists of:

  • Linux Operating System
  • NginX Web Server
  • MySQL Database
  • PHP5 dynamic webpage scripting

For those familiar with the more common LAMP server, the LEMP server is a slight modification. It uses the NginX Web Server instead of the Apache Web Server. There are a few key benefits of using NginX over Apache. The primary claimed benefit is that NginX scales better to large server loads. I haven't verified this claim myself yet, but there are various benchmarks online which seem to back this claim. The great thing about the setup I have is I could easily setup a LAMP server as well and compare the two.

In this part I'm going to go over the various setup required on the host machine and Virtual Box settings, as well as installing the Ubuntu operating system.

Here's a few of the details for the virtual server I'm setting up:

  • Virtual Box for the virtual machine software.
  • Ubuntu 12.04 LTS 64-bit Server OS. Note that at the time of this writing the latest version of Ubuntu is 12.10. I'm not entirely sure what the technical differences between the two are. Ubuntu 12.10 is advertised to have the latest technology, but it isn't a LTS (Long Time Support) version of Ubuntu, which Ubuntu 12.04 is. The LTS versions are supported for 5.5 years vs. the 2.5 years for non-LTS versions. This isn't a major factor for a private test server, but may be a deal breaker for production-quality/public servers.
  • Putty Telnet/SSH client for Windows. Note that for people using a Linux OS or any OS with good SSH support via the terminal you won't need a separate client.
  • MySQL Workbench for managing the MySQL database on my host machine.

Wednesday, November 7, 2012

Blogger Syntax Highlighting

Introduction

One of the greatest features of any code editor is syntax highlighting. It makes code much easier to read. Luckily, there are several ways to add Syntax Highlighting to webpages, too. Like pretty much anything else on the web, you have two places you can perform the syntax highlighting: On the server, or on the client.

For server-side syntax highlighting there is the GeSHi tool written in PHP. For the client-side, there's Alex Gorbatchev's Syntax Highlighter written in Javascript. Both support a wide variety of languages and are fairly easy to use. There are pros and cons with each option.

A server-side solution obviously requires a server, and the server needs to be able host dynamic content.

A client-side solution doesn't need a server, but it does require the client to run a javascript program in order to get syntax highlighting. For most clients this is fine, but some clients, particularly older mobile clients, this can make your website fairly slow to load.

Because I want to use syntax highlighting with Blogger and I don't have access to the Blogger servers, the only option I have is a client-side solution, so I'll be using Alex Gorbatchev's Syntax Highlighter.

Note: at the time of this writing the latest version of Alex Gorbatchev's Syntax Highlighter is 3.0.83