Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-12 08:46:44

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Linux servers for dummies

I’m hoping to move into setting up and maintaining Linux LAMP servers at work (Ubuntu specifically). I have a little experience from experimenting with virtual machines and my Digital Ocean droplet; but I don’t know enough (I’m having a huge amount of fun figuring things out though).

Do any of you have any recommendations (YouTube videos, web links, books, etc.) that I can use to expand my knowledge. I’ve been trawling though the Ubuntu forums, Digital Ocean tutorials and random websites but I would quite like to find something that starts from scratch (e.g. somebody who hasn’t touched Linux before). Although I’m picking things up, I often don’t fully understand the commands I’m typing into the Terminal (or even what commands are available to me) and how the various configuration files I’m editing work, or even what the code I’m adding to the configuration files means.

Offline

#2 2016-05-12 10:42:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: Linux servers for dummies

Over the last month or so of setting up my own droplet, my go-to reference (aside from the DigitalOcean tutorials, which are usually excellent) has been… Pete Cooper :-)

Seriously, he’s been an absolute star as I floundered around. He had a fledgling setup guide that led me from zero to fully-fledged server in well under an hour. That included upgrades, hardening things (setting up firewall rules), mail configuration, installing unattended installs and reboots, turning unnecessary services on and off, installing the LAMP stack, moving stuff around, and so forth.

Unfortunately, the guide he sent me really was a list of bullet points, short explanations and long commands, which I tweaked. I already knew a lot of command line stuff so it was mainly a very helpful refresher from someone who had done it more recently than I had. So if you don’t know the commands to begin with, it’s not going to help. I didn’t know them all, but I Googled those I didn’t recognise or needed to brush up on.

The key ones during setup are:

  • sudo apt-get update; sudo apt-get install <something> to add packages to the system
  • sudo dpkg-reconfigure <something> to tinker with settings for a package, like postfix mail.
  • sudo ufw <rule> to set firewall rules

Along with user management commands like useradd, usermod, and passwd to set up a non-root user and add them to sudoers so they can run system commands via sudo. Plus the permissions utilities chown (change ownership), chgrp (change group ownership only) and chmod (change file permissions). And the usual suspects: ls (list files), cd (change directory), less (read text files), nano (or vi for the hardcore!) to edit files.

Some handy resources:

Some of those might be a bit too basic, but have helpful tips and commands anyway.

And the most useful tip not covered by those? Command searching in your command line history:

Edit the .inputrc file in your home directory:

nano ~/.inputrc

Paste the following lines in and save, then exit nano:

"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

When you next log in you can “search” your previous commands by typing a few letters of the command and hit up-arrow to cycle through the matches. Saves a tonne of typing/scrolling.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2016-05-12 14:32:47

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,259
GitHub

Re: Linux servers for dummies

My knowledge of Linux is evolving. The bullet point list that Stef mentioned was borne out of needing to build a secure server quickly and properly, and is a balance between the two. I started out with Linux some years ago and gradually learned what I needed to learn rather than everything. Books and videos were overwhelming to me, and as a pragmatist I found that learning by doing was much more effective.

Some recommendations:

  1. download VirtualBox
  2. download Ubuntu Server
  3. learn how to mount a disk image in VirtualBox
  4. install Ubuntu Server
  5. think of something you want to do with it (web server, mail server, git, database server, whatever you like)
  6. find out how to do that thing
  7. find out another way to do that same thing (maybe repeat this a few times)
  8. find out the differences between them
  9. make a note of what works best in algaris linux infodump.txt
  10. go to 5.

That was how I got started. Learn some stuff, smash up and delete your VirtualBox image, then start over with the notes you’ve made. You’ll improve your confidence with each iteration, and that’ll bolster your knowledge.

I chose Ubuntu because it’s a Debian fork backed by a company who seem to know what they’re doing. Documentation is vast for it, too, as the number of people using it is high. I also have a stack of Raspberry Pi servers in the office for AMP stack builds, and they run on Raspbian – another Debian fork – so there’s a lot of commonality between them.

Google or your search engine weapon of choice is your friend for Linux stuff. That, and the man command which shows you the documentation for a given commend. Note that man shows stuff that the authors want to show you, whereas search engine results will give you a broader view of opinions.

Right now, I’m putting together a script to build a Textpattern inside LXD, a container system from Canonical. I know virtually nothing about LXD, but I’ve almost got my head around some of the things I need to do with it. Thats the key: I don’t need to know everything, a general gist and copious note taking is working for me, and when I know the basics I can figure out whether something is possible or not.

Offline

#4 2016-05-12 15:43:58

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Linux servers for dummies

One quick slightly-offtopic aside:

If you need to create a LAMP server quickly and you don’t care about the fine details, sometimes you can find a Wordpress image like this one for Digital Ocean or one of these for Vagrant or the official Docker image.

Probably not the best way to learn but not necessarily the worst way to get started if you are in a hurry.

Offline

#5 2016-05-13 07:44:22

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: Linux servers for dummies

Sounds like you should look at Servers for Hackers. It’s an excellent guide to setting up and running your web server from scratch.

Offline

#6 2016-05-20 13:37:32

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 553

Re: Linux servers for dummies

Thank you everyone for your replies, they are very helpful. I’m busy digesting them and will reply back after further rumination.

Offline

Board footer

Powered by FluxBB