Tag Archives: Apache

How to Scale Django: Beyond the Basics

Getting Started

You’ve deployed Django to your Droplet and life is good. You bumped into some performance problems as your site’s traffic grew but you’ve found the bottleneck and fixed it. However, your site’s traffic keeps growing. Somehow you need more performance…what can you do?

Let’s dig into the guts of our application and server configuration a little. This article is written on the assumption that you’re using Ubuntu 12.04, but the principles work with any version of Linux.

If you’re using Apache then you should have followed the instructions for optimizing your webserver. If you are using Nginx, these tips will work for you as well. Continue reading How to Scale Django: Beyond the Basics

How To Optimize Apache Web Server Performance

Introduction

Apache is an amazingly powerful and capable web server. In order to make initial setup as easy as possible, it comes with numerous modules pre-installed. This makes it a great choice for new projects when you need to quickly be productive. However, as your site grows you may start to bump into performance problems.

What first attracted me to DigitalOcean was the low cost to get started. The smallest and cheapest droplets have 512MB of RAM, which doesn’t seem like much in today’s world of big frameworks. However, you’d be surprised what you can do with a small server like this if you take a little time to tweak the settings.

If you’re running Apache on one of the smaller sizes of droplets, or if you want to maximize your performance on the bigger droplets, here are a few things you should do. I’ll be using Ubuntu 12.04 in the examples but the principles I’m demonstrating are applicable to other versions of Linux as well. Continue reading How To Optimize Apache Web Server Performance

How To Install an Apache, MySQL, and PHP (FAMP) Stack on FreeBSD 10.1

Introduction

A FAMP stack, which is similar to a LAMP stack on Linux, is a group of open source software that is typically installed together to enable a FreeBSD server to host dynamic websites and web apps. FAMP is an acronym that stands for FreeBSD (operating system), Apache (web server), MySQL (database server), and PHP (to process dynamic PHP content).

In this guide, we’ll get a FAMP stack installed on a FreeBSD 10.1 cloud server using pkg, the FreeBSD package manager.

Prerequisites

Before you begin this guide, you should have a FreeBSD 10.1 server. Also, you must connect to your FreeBSD server as a user with superuser privileges (i.e. is allowed to use sudo or change to the root user).

Step One — Install Apache

The Apache web server is currently the most popular web server in the world, which makes it a great choice for hosting a website.

We can install Apache easily using FreeBSD’s package manager, pkg. A package manager allows us to install most software pain-free from a repository maintained by FreeBSD. You can learn more about how to use pkg here.

To install Apache 2.4 using pkg, use this command: Continue reading How To Install an Apache, MySQL, and PHP (FAMP) Stack on FreeBSD 10.1

Troubleshoot Common HTTP Error Codes

How To Troubleshoot Common HTTP Error Codes

Introduction

When accessing a web server or application, every HTTP request that is received by a server is responded to with an HTTP status code. HTTP status codes are three-digit codes, and are grouped into five different classes. The class of a status code can be quickly identified by its first digit:

  • 1xx: Informational
  • 2xx: Success
  • 3xx: Redirection
  • 4xx: Client Error
  • 5xx: Server Error

This guide focuses on identifying and troubleshooting the most commonly encountered HTTP error codes, i.e. 4xx and 5xx status codes, from a system administrator’s perspective. There are many situations that could cause a web server to respond to a request with a particular error code–we will cover common potential causes and solutions.

Client and Server Error Overview

Client errors, or HTTP status codes from 400 to 499, are the result of HTTP requests sent by a user client (i.e. a web browser or other HTTP client). Even though these types of errors are client-related, it is often useful to know which error code a user is encountering to determine if the potential issue can be fixed by server configuration.

Server errors, or HTTP status codes from 500 to 599, are returned by a web server when it is aware that an error has occurred or is otherwise not able to process the request.

General Troubleshooting Tips

  • When using a web browser to test a web server, refresh the browser after making server changes
  • Check server logs for more details about how the server is handling the requests. For example, web servers such as Apache or Nginx produce two files called access.log and error.log that can be scanned for relevant information
  • Keep in mind that HTTP status code definitions are part of a standard that is implemented by the application that is serving requests. This means that the actual status code that is returned depends on how the server software handles a particular error–this guide should generally point you in the right direction

Now that you have a high-level understanding of HTTP status codes, we will look at the commonly encountered errors. Continue reading Troubleshoot Common HTTP Error Codes