by Daniel Davies

I'd like to introduce Marlow, my brand new web server! This site here is being hosted on it, and I have a number of other Django sites to get up there over the coming months. Marlow was setup because my other server, Apollo was simply over capacity. I wanted a more "pure" environment for my Django work, a server that only does exactly what is needed to get a Django site running, is secure, and is easy to manage.

In this series of posts I'll be documenting everything I did, command by command, as well as providing the reasons and links to help explain my decisions.

First things first

There are many guides out there on the web, not a single one of them will satisfy everyone's needs. Some will give you more than your need, others will leave you still needing to install more. This guide ...

Read full article…

by Daniel Davies

The last post setup a basic Linux environment with secure access for administration. This post will now turn that basic install into a web and database server. I'll be using Apache 2 and Postgresql to achieve this. Both are very simple to setup, especially on Ubuntu.

Apache 2

  • $ sudo apt-get install apache2
    Will install Apache, configure it all and start it running.
  • $ sudo ufw allow 80/tcp
    This will open up the firewall on port 80 for Apache.
  • To verify that Apache installed correctly open a browser and type in your IP to the address bar. You should see "It works!"

"It works!" is the default Apache page, that lives inside the default web folder. You can change this page in /var/www/. Because this server is going to be hosting multiple sites I won't actually be using the /var/www/ folder, every site is going to be ...

Read full article…

by Daniel Davies

The new server is almost ready now, but the most important bit is still to come - setting up Django itself! The Django documentation is pretty thorough in its explanation, so in this post I'm going to focus on setting up Django and the various add-ons in an easy to manage way.

Structure

Structure is generally quite unique to people, most of whom have their own preferred way of doing things. A lot of servers are setup using home directories to host websites, but because this is a private server only being used for my own projects I'll be using a similar structure from my time working on servers day to day.

  • $ sudo mkdir /web
    This creates a directory called web at the root of the file system. Its going to contain everything web related for the server and because its all in one folder its dead easy to ...

Read full article…

by Daniel Davies

The server is now ready to host Django websites. In this final part I'll actually deploy a site to the server. Before doing this make sure that you have setup two domains for the site.

  1. Primary Domain - The domain used to access the website
  2. Media Domain - A mod_python virtual host can only serve Python generated content, so you'll need a different domain for serving your static content such as CSS, images and javascript.

Uploading Files

In the last post the directory for the server was setup. Website files will live in /web/sites/

  • $ sudo su www-data
    Switch to www-data user again
  • $ cd /web/
  • $ mkdir ./sites/<project-name>/ ./logs/<project-name>/ ./sessions/<project-name>/
    Create the relevent folders for this site

Now upload the site to /web/sites/<project-name>/. You might have noticed I've not installed FTP on to this server. This is because FTP provides little more than a less ...

Read full article…

Showing page 1 of 1
1

Contact Daniel…

Request a Quote