Ubuntu Gutsy - Nginx vhosts, rails and mongrels

There are several ways of serving a Ruby on Rails application, one of which is to use Nginx to proxy requests to mongrels.

There are a few ways of completing this and we're going to look at one solution. Other methods, such as using a mongrel cluster will be looked at in future articles.


Ubuntu Gutsy - Nginx, SSL and vhosts

So you've followed the Nginx self signed certificate article and now you want to configure Nginx to serve your site on the standard HTTPS port (443).

With Nginx, it is very easy to configure your virtual host to use a secure connection.


Ubuntu Gutsy - self signed SSL certificates and Nginx

Secure connections to your website are vital when entering passwords or entering administration areas.

This article will take you through generating a self-signed certificate to use with Nginx.


Ubuntu Gutsy - Nginx Virtual Hosts #2

The previous Ubuntu Gutsy Nginx Virtual Hosts article introduced the basics of the setting up virtual hosts.

This allowed us to serve multiple domains from a single IP address and Slice. Now we can look in detail at some more settings available to us in the Virtual Hosts files.


Ubuntu Gutsy - Nginx Virtual Hosts

Now we have Nginx installed and running, we can configure it to serve multiple domains using Virtual Hosts.

Do note the layout used in this article is explained here - feel free to use the directories of your choice.


Ubuntu Gutsy - Nginx configuration #1

Let's take a look at the main nginx.conf file for our Ubuntu Gutsy install of Nginx.

Although I'll make some suggestions, the aim here is not to change a lot at this point. Rather, we will look at the main settings, see what they mean and what a change will actually do.


Ubuntu Gutsy - Nginx config layout

Assuming you have followed this article and have installed Nginx via the Aptitude package manager, we can now have a look at what the install, um, installed.

If you have used Apache with a debian based layout, you will note some very nice similarities and consistencies.


Ubuntu Gutsy - Installing Nginx via aptitude

Nginx is a popular server for those who do not need the bulk and extra services that Apache may offer.

This article will look at installing Nginx on an Ubuntu Gutsy Slice using the package manager 'aptitude'.


Ubuntu Gutsy - adding an nginx init script

In the previous article we installed nginx from source. However, installing from source does not create an init script.

Let's create such a script so we can easily start, stop and restart nginx and, perhaps more importantly, ensure it automatically starts on a reboot.


Ubuntu Gutsy - Installing Nginx from source

Nginx is a popular server for those who do not need the bulk and extra services that Apache may offer.

This article will look at installing Nginx from source on an Ubuntu Gutsy Slice.


Ubuntu Gutsy - Django installation

Django is a commonly used framework when developing webapps.

Let's take a look at installing Django on an Ubuntu Gutsy Slice and look at integrating database support.


Ubuntu Gutsy - mongrel clusters and surviving a reboot

Proxying requests to a mongrel cluster is one of the ways of serving your Ruby on Rails web application.

Let's create a cluster of mongrels and configuring it to restart after a reboot.


Ubuntu Gutsy - Apache vhosts, rails and mongrels

There are several ways of serving a Ruby on Rails application, one of which is to use Apache to proxy requests to mongrels.

There are a few ways of completing this and we're going to look at one simple solution. Other ways will be looked at in future articles.


Ubuntu Gutsy - Apache, SSL and vhosts

So you have a new SSL certificate (see here for self signed certs) and you want to configure Apache to serve your site on the standard HTTPS port (443).

No problem, it's easily done with a new Apache vhosts configuration file.


Ubuntu Gutsy - generating a self signed SSL certificate

Secure connections to your website are vital when entering passwords or entering administration areas.

This article will take you through generating a self-signed certificate to use with https (port 443) connections.


Ubuntu Gutsy - Apache Virtual Hosts #2

The previous Ubuntu Gutsy Apache Virtual Hosts article introduced the basics of the setting up virtual hosts.

This allowed us to serve multiple domains from a single IP address and Slice. Now we can look in detail at the settings available to us in the Virtual Hosts files and introduce some new ones.


Ubuntu Gutsy - Apache Virtual Hosts

Now we have Apache installed and running, we can configure it to serve multiple domains using Virtual Hosts.

Do note the layout used in these articles is explained here - feel free to use the directories of your choice.


Ubuntu Gutsy - Apache configuration #2

Continuing from the first Ubuntu Gutsy Apache configuration article, we now look at some of the other settings in the main apache2.conf file and what they can do.

Concentrating on efficiency and security, this will end our apache2.conf journey (for now).


Ubuntu Gutsy - Apache configuration #1

Let's take a look at the main apache2.conf and ports.conf for our Ubuntu Gutsy install.

We're not actually going to change a lot at this point, just look at the main settings and see what they mean and what a change will actually do


Ubuntu Gutsy - Apache config layout

Ubuntu Gutsy uses a slightly different Apache layout than you may have encountered if you have used Apache with non Debian based Operating Systems.

The differences are not huge and, indeed, help in configuring and deploying websites.


Ubuntu Gutsy - installing Apache and PHP5

Ubuntu Gutsy comes with Apache v.2.2.4 and PHP v.5.2.3 and they are easily installed via the default Ubuntu Package Manager 'aptitude'.

The advantage of using aptitude is that you will get any security updates from Ubuntu (if and when distributed) and dependencies are automatically taken care of.


Ubuntu Gutsy - MySQL and RoR

In the Ubuntu Gutsy setup articles (page 1 and page 2) we secured, updated and personalised the install ready to add some working software.

As such, we can now install MySQL and Ruby on Rails with subversion and Postfix support.


Ubuntu Gutsy setup - page 2

In page 1 of the Ubuntu Gutsy setup, we completed the ssh configuration along with a basic iptables install.

Let's move on and install some personal configuration files to make our life easier. Once done, we can update the install and create a solid base for the 'meat' of the server.


Ubuntu Gutsy setup - page 1

These Ubuntu Gutsy articles will take you from a 'barebones' Ubuntu Gutsy Slice to a secured and up to date Slice ready for your server software (or whatever you use the Slice for).

Securing your Slice as soon as possible is a great way of starting your Slice administration.