background preloader

Webserving-apache/modwsgi/modpython/nginx

Facebook Twitter

CentOS - Nginx Virtual Hosts. Now we have Nginx installed (whether via the package manager or from source) we are in a position to serve multiple domains using Virtual Hosts.

CentOS - Nginx Virtual Hosts

Do note the layout used in this article is explained here - feel free to use the directories of your choice. Create the layout In this example we'll be creating two domains, domain1.com and domain2.com As the default permissions only allow us, the 'demo' user, to browse our home folder, let's start off by giving Nginx access to this folder as well: chmod 755 /home/demo OK, good. We can now create the basic layout for each domain. Mkdir /home/demo/public_html Now for each domain you want to host (I use the examples of domain1.com and domain2.com) create a folder with a standard set of sub-folders: Nginx: An Introduction to the Nginx Configuration File. Nginx is a constantly evolving web server rapidly growing in popularity.

Nginx: An Introduction to the Nginx Configuration File

In July of 2013 nginx even managed to become the most used web server amongst the top 1000 sites ranked by traffic. It’s safe to say that these days you cannot afford to not know about nginx or how to use it. Unfortunately the nginx documentation is more of an API documentation than it’s an introduction to how nginx actually works. This post is aimed at correcting that by walking you through the most important parts of the nginx configuration file in a logical order. The Basics of the Nginx Configuration Nginx is in all fairness a fairly simple HTTP server, however, because most people come from Apache there are a few gotchas in the nginx configuration that people need to be aware of before they start using this web server.

There are 3 hierarchies which are usually referred to as blocks. Furthermore there are two special locations, an event block and the root which the event block and the http block reside in. Running Supervisor — supervisor 3.0a12 documentation. This section makes reference to a BINDIR when explaining how to run the supervisord and supervisorctl commands.

Running Supervisor — supervisor 3.0a12 documentation

This is the “bindir” directory that your Python installation has been configured with. For example, for an installation of Python installed via . /configure--prefix=/usr/local/py; make; make install, BINDIR would be /usr/local/py/bin. Python interpreters on different platforms use a different BINDIR. Look at the output of setup.py install if you can’t figure out where yours is.

Adding a Program¶ Before supervisord will do anything useful for you, you’ll need to add at least one program section to its configuration. One of the simplest possible programs to run is the UNIX cat program. [program:foo]command=/bin/cat This stanza may be cut and pasted into the supervisord.conf file. Running supervisord¶ To start supervisord, run $BINDIR/supervisord. You may start the supervisord executable in the foreground by passing the -n flag on its command line. Warning action [arguments] Signals¶

Load Balancing

Basic UNIX commands. Note: not all of these are actually part of UNIX itself, and you may not find them on all UNIX machines.

Basic UNIX commands

But they can all be used on turing in essentially the same way, by typing the command and hitting return. Note that some of these commands are different on non-Solaris machines - see SunOS differences. If you've made a typo, the easiest thing to do is hit CTRL-u to cancel the whole line. But you can also edit the command line (see the guide to More UNIX). UNIX is case-sensitive. Files ls --- lists your files ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified. Directories Directories, like folders on a Macintosh, are used to group files together in a hierarchical structure. mkdir dirname --- make a new directory cd dirname --- change directory. Finding things ff --- find files anywhere on the system.

About other people.

P3P

How to Speed up Your Django Sites with NginX, Memcached, and django-compress. A lot of these steps will speed up any kind of application, not just django projects, but there are a few django specific things.

How to Speed up Your Django Sites with NginX, Memcached, and django-compress

Everything has been tested on IvyLees which is running in a Debian/Ubuntu environment. These three simple steps will speed up your server and allow it to handle more traffic. Reducing the Number of HTTP Requests Yahoo has developed a firefox extension called YSlow. It analyzes all of the traffic from a website and gives a score on a few categories where improvements can be made. It recommends reducing all of your css files into one file and all of your js files into one file or as few as possible. Setting up Memcached Django makes it really simple to set up caching backends and memcached is easy to install. sudo aptitude install memcached, python-setuptools We will need setuptools so that we can do the following command. sudo easy_install python-memcached Once that is done you can start the memcached server by doing the following: CACHE_BACKEND = ' and replace it with.