When you run a web agency, it is important to hold internal training, both in the systems we run today, but also the systems we will use in the future. We started on the 1st of February with a training in basic system administration so that everyone has the same foundation, and so that everyone would learn how to use our ECS service and how to set up virtual machines.
Since we always run the same software on all our virtual machines, Debian with Nginx and MariaDB, I have created a script that automates large parts of the installation, called boostrap.sh, to save a lot of time and make it easier to get a web server up and running with full php support. In the presentation you will also learn a very basic configuration to set up a vhost in Nginx that can run Wordpress. The software and Nginx settings are far from optimal, but it is enough to get started and start coding, so to put a web server into full production requires a little more love than what I go through in the presentation. But the point was not for everyone to become an expert in system administration, but just to learn enough to have a server to develop against.
What I have gone through in brief is:
- What is an ECS?
- How to set up an ECS via webbguit
- Why we run Debian
- What to do once you have started an ECS instance
- Basic configuration of the Nginx web server
What is an ECS?
ECS stands for Elastic Cloud Server, and it is the service we use for almost all our clients.
The advantage is that we can install whatever we want and customise the installation to suit the client’s website, which is much more difficult with a classic shared web hosting. It also means that the customer only pays for the capacity that is actually used, which usually makes it cheaper for the customer. And we can easily scale up the capacity of the site if the client starts to get enough visitors, which means you can start cheaply and grow into your site as time goes on, something our clients appreciate.
How to set up an ECS via webguit
When setting up a new instance in the control panel, there are a number of steps you need to go through, and choose which level you want to go to. To make it easier for clients to understand how much they will pay per month, we have developed a standard level that is enough for most people. This makes it easier to provide a good quote on how much the hosting will cost.
It also means that generally all machines have the same configuration, which makes it easier to manage, for example this is where we tell Ipeer that we want to run Debian.
Why we run Debian
There are many good, and not so good Linux distributions out there. Almost all of them have slightly different ways of installing things, and differ slightly in function and how to do different things. That’s why we always run Debian, so you know what you’re going to encounter and how things work, instead of having to learn how to do the same thing in several places. Debian is also one of the most used distributions, which means that security holes and bugs are discovered very quickly, this together with the fact that there is a large community around Debian means that we know that we have a stable platform. In addition, it’s very easy to find information on how to do different things, like installing special programmes.
What to do once you have started an ECS instance
Once you have your ECS instance, there are a few things you need to do. Firstly, you need to install all the software needed for a website, which we are currently doing with a single command:
wget -qO https://plux.se/bootstrap.txt | bash
What that command will do is download a bash file and run it directly, the script will do some basic configuration and install the software we need for our wordpress sites. Note that the script only works with Debian Squeeze at the moment.
What that command will do is download a bash file and run it directly, the script does some basic configuration and installs the software we need for our wordpress sites. (Note that the script only works with Debian Squeeze right now.)
The advantage of having a boostrapscript for our environments is that it saves a lot of time, and you don’t miss installing anything that we actually need. And you don’t have to remember which third-party repos we use for mariadb, php and nginx, for example.
Basic configuration of the Nginx web server
The configuration we go through for nginx is the minimum possible to get a server up and running, when my colleagues set up a server themselves it is for development. Thus it is not adapted for production use and it can be done much better, but it also makes it harder to remember everything you need to remember.
As you can see from the slideshow above, the last part of this in-house training consisted of a workshop. It was largely based on the participants themselves finding out the answers to what they did not know. This is because everything in IT is changing and no ready-made instruction stays relevant for very long. So it is simply more important to learn how to find the information than to memorise it.
For the sake of this blog post, however, we thought we’d share what we found and how we went about using our newfound knowledge.
For configuring Nginx for WordPress, we found the following configuration example via the Nginx website: https://kbeezie.com/nginx-configuration-examples/
Furthermore, you need to configure MySQL/MariaDB and for this we found instructions on the WordPress Codex: https://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client
Once the database and web server are ready, all that’s left is to install the WordPress files in the webroot and configure wp-config.php. Done!
Sysadmin from Plux Stahre