By Philip Knerr
This series of articles provides instructions for DevOps, system administration, and server configuration.
Each article can stand on its own. The articles can also be used in combination to configure a server offering the Ruby on Rails stack, the LAMP stack, or both.
The articles are intended to be usable by simply following the instructions. At the same time, the articles are intended to be educational. Rather than just listing commands to execute and configuration options to select, the articles strive to explain the reasoning behind these actions.
There’s more than one way to configure a server. The instructions describe one possible way which should work with minimal modification. Other ways are possible, and some users may be comfortable adapting the instructions to meet the unique needs of their environment.
The articles are primarily intended for people who are relatively new to DevOps. This is a conscious decision which was made in order to fill in a gap. Many tutorials target intermediate to advanced users, which is also worthwhile. But these tutorials often assume a baseline level of knowledge which some people may not have. This is especially problematic for DevOps, because many people who don’t specialize in DevOps may occasionally need to configure a server.
That said, the articles assume a basic familiarity with the Linux operating system and its command line.
The articles assume that the system being configured and administered is an Amazon Elastic Compute Cloud (EC2) instance hosted by Amazon Web Services (AWS). However, most concepts should be similar for other virtual or physical hardware and for other hosting providers.
The articles further assume that this system is based on the Amazon Linux operating system. However, most concepts should be similar if this system is based on any of the following:
- Another flavor of the Linux operating system.
- Another *nix operating system.
- The macOS (or OS X) operating system.
The articles additionally assume that your local system is based on one of the operating systems identified by (1) through (3) above.
Warning: There are substantial differences between the Windows operating system and any of the operating systems listed above. Making the instructions work on the Windows operating system would require major adaptations and may not be possible at all.
When it is necessary to edit a text file, the articles use the GNU nano text editor. This text editor is a good choice because it is relatively easy to use.
Nonetheless, if you prefer to use another text editor, that’s fine. In the commands to edit text files, just substitute
nano with the command to invoke your preferred text editor, such as
Checking for newer package versions
Versions listed in the articles are the most recent versions available as Amazon Linux packages as of when each article was written. However, for any given package, there may be a newer version available by the time you read this. You can determine whether this is the case by executing the following command, where
<basePackageName> is the package name without any version number:
yum list | grep <basePackageName>
yum list | grep httpd
yum list | grep mysql
yum list | grep php
If a different version of a package is installed, the matching version of any related package should also be installed. Typically, related Amazon Linux packages are specific to a minor version of the software which they extend. For example, if you install the
php72 package instead of the
php71 package, you would then install the
php72-mysqlnd package instead of the
Warning: Amazon Linux packages without version numbers frequently install outdated versions. For example, the
php package installs PHP 5.3.29, which is far enough out of date that it should not be used. On a similar note, predefined Amazon Linux package groups frequently comprise outdated versions of packages. For example, the
PHP Support group includes the outdated
Compiling from source
Unfortunately, there is often a delay between when new software versions are released and when they become available as Amazon Linux packages. If this is the case, you can install the latest version of the software in question by downloading the source code. For many open source software solutions, the source code is available on GitHub or the website for the software. Then, you can compile the source code on the system where the software is to be installed.
Compiling software from source code is generally superior to installing software from packages. Compiling locally often results in the software executing slightly faster, because the software is compiled for your exact system. However, compiling takes more time. It also requires a baseline level of knowledge about software development. Locally compiled software also cannot be updated in the organized way offered by modern package management.
The techniques for compiling software locally are beyond the scope of these articles.
The author would like to extend special thanks to the following people and organizations which assisted my personal and professional development:
- My family
- Wheaton-Warrenville Community Unit School District 200, Illinois, United States
- College of DuPage, Glen Ellyn, Illinois, United States
- North Central College, Naperville, Illinois, United States
I hope you find these articles to be useful and enjoyable. Good luck with configuring your server!