SYSTEMS
ADMINISTRATION FOR
CODERS
Hints & tips to increase reliability & reduce maintenance
time.
WHAT IS A SYSTEM?
An assemblage or combination of things or parts forming
a complex or unitary whole.
WHAT DOES A SYSTEMS
ADMINISTRATOR DO?
• Introduces new technologies into an environment
• Analyses system logs and identifies potential issues
with a system.
• Plans and performs routine maintenance
• Performs and maintains backups
• Installs and configures new software and hardware
WHAT DOES A SYSTEMS
ADMINISTRATOR DO?
• Manages user accounts
• Responsibility for security
• Responsibility for documentation of the system
• Plans systems upgrades and outages to apply
upgrades
• Troubleshooting reported problems
• Deals with, often frustrated, system users... ... etc. etc.
A COMPUTER SYSTEM
• Many components working together - software
(application, web server, OS), hardware (disks, RAM,
CPU) & others (networking equipment, switches,
routers, load balancers)
• Provides stability and maintainability that underpins the
entire application.
• Supports your software for its lifetime.
• Can provide parts of your application. Sometimes a
problem has already been solved by some other
software.
START AT BEGINNING
• Start sysadmin tasks at the beginning of the project.
• Write tools to aid deployment.
• Write tools to set up environments.
• Iterate over these tools and stabilise for production
ENVIRONMENTS
• Dev, QA, Live
• Dev, Test, QA, UAT, Live ~~ Dev, Test, QA, UAT,
Staging, Live
• The nearer they get to live, the closer the should
resemble live.
• Dev environment should at least be the same major
versions, preferably OS version.
• Vagrant is a useful tool for this.
SSH
• Probably the most frequently used tool
• Forwarding SSH agent to allow key use remotely (e.g.
git, hopping between servers)
• Tunnels for access to remote resources
• Reverse tunnels for remote access to local resource
• Easy to configure the client
SSH-AGENT
• Generate keys >2048 bits (e.g. ssh-keygen -b 4096)
• ssh-add to load default key (~/.ssh/id_rsa)
• ssh-copy-id <server> to copy to remote server
• ssh -A <server> to forward agent back to local
instance.
• Agent runs at login for modern Linux desktop, Mac OS.
SSH-TUNNELS
• Local access to remote: ssh -L3307:localhost:3306
<server>
• Remote access to local: ssh -R:3307:localhost:3306
<server>
• SOCKS proxy: ssh -D5050 <server>
SSH CLIENT
CONFIGURATION
• Per user configuration: ~/.ssh/config
• Config options can be set per host or via wild card, e.g.
User, ForwardAgent, Hostname & many more
• manpage: ssh_config
UNIX/LINUX PRINCIPLES
• Most things in Linux & UNIX are text.
• Each command line tools does one task and does it
well.
• Command line tools process text with relative ease.
• Much of the text is separated into fields - especially
logs, or as key = value pairs.
• There are standard locations for many types of file.
BASIC TOOLS
• cat - display text
• grep - find text
• awk - field processing (and more)
• sed - search and replace text
• wc - count
• cut - simple field processing
• head, tail - print first and last lines of text
• sort - sort text
LOCATION, LOCATION,
LOCATION
• /etc - configuration
• /usr - read-only user data
• /var - variable length files (caches, logs, temporary files)
• /home - users' home directories
• /opt - optional applications
• /srv - served site specific data
• See the Filesystem Hierarchy Standard. Same across most distros
VARIABLE LENGTH FILES
• /var/log - Logs go here
• /var/cache - Cached files
• Watch your permissions
• During normal operation, /usr, /opt should be able to be
mounted read only
SOFTWARE DEPLOYMENT
• Use vendor supplied packages whenever possible:
• Reduces risk of misconfigurations
• Easier to seek help
• Usually well tested
• Easier upgrades, timely security fixes
• Building from source will take a fair amount of time, CPU
• Ruby may be an exception. PHP isn't
CHOICE OF LINUX
DISTRIBUTION
• Two main camps - Debian and RedHat
• Red Hat Enterprise Linux is rock solid but expensive &
packages tend to be older. CentOS is Enterprise Linux
recompiled from the same source RPMs.
• Debian stable is rock solid but packages tend to be old.
Community/3rd party support only.
• Ubuntu LTS is pretty solid, packages are more recent
than EL. Well supported in the Cloud - AWS,
OpenStack especially.
SOURCE OF PACKAGES
• Use as stable, well testing packages as much possible
• Ubuntu main, Debian stable ideally
• For EL distros, EPEL augments core packages well
• For EL, IUS provide recent versions of MySQL, PHP
but is less well tested.
• Avoid one person repos, PPAs if at all possible.
BUILDING FROM SOURCE
• Do not build on live servers. Deploy only compiled
code.
• Ideally produce a package.
• Avoid if possible. Increased risk of problems - more
moving parts.
DIAGNOSTICS
• Check disk space: df -h 100% full is bad.
• Check logs: /var/log, /var/log/syslog, /var/log/messages
- get to know your logs.
• dmesg for hardware information.
• Check RAM (free -m) and CPU usage with top.
• Install sysstat package early on - sar will gather data.
Also gives you iostat, vmstat, mpstat.
SECURITY
• Install denyhosts/fail2ban to help protect SSH.
• Disable SSH in as root, use SSH keys.
• Use host based firewalls, AWS security groups.
• Don’t run your servers as root. Try to split them over
different users with clear paths between them. One
user nginx, one. php-fpm
• Audit trials are useful.
BACKUPS
• Databases: Dump the DB, don’t take hot copies of the
DB files,
• Make use of your hosting providers backup services.
• Make sure you can restore. Test regularly.
PROCESS
• Repeat manual tasks often
• Try to use the same deployment system across stages
• Get live up early, treat it as UAT and deploy to it
regularly. Avoid 'big bang' deployment
• Use what suits - don't blindly follow trends, assess risks
as suits the type of project.
• Small steps, iterative improvement. Agile, Kanban,
Lean etc.
AUTOMATION
• CFEngine, Puppet, Chef can get you quick wins. They
can quickly become hard to manage. Learning curves
are steep.
• Ansible is simple to get going on. Can be hacked at
and still get good results. Data driven. Pretty new, but
growing fast.
• Nothing wrong with shell/Python/Ruby/Perl scripts.
Configuration management tools are not essential.
• Packaging gets you out of a lot of automation tasks.
THAT’S A LOT OF STUFF!
• Not touched on DR, monitoring, OS provisioning,
storage, networking...
• Hire a sys-admin :)
• A good sys-admin will work with you...
• ...to let you get on with the job you enjoy.
QUESTIONS?
matt@monki.org.uk
THANKS!
matt@monki.org.uk

More Related Content

PPTX
Device drivers Introduction
PDF
Developing a Ceph Appliance for Secure Environments
PPTX
Device Drivers in Linux
PDF
Simplifying Ceph Management with Virtual Storage Manager (VSM)
PPT
2. introduction to linux
PPTX
Unix tc
PPTX
Server Hardening Primer - Eric Vanderburg - JURINNOV
PPT
Linux操作系统01 简介
Device drivers Introduction
Developing a Ceph Appliance for Secure Environments
Device Drivers in Linux
Simplifying Ceph Management with Virtual Storage Manager (VSM)
2. introduction to linux
Unix tc
Server Hardening Primer - Eric Vanderburg - JURINNOV
Linux操作系统01 简介

What's hot (18)

PDF
XPDS16: Xen Project Weather Report 2016
PDF
Embedded Systems: Lecture 5: A Tour in RTOS Land
PPTX
Arch linux and whole security concepts in linux explained
PPTX
What can QNAP Turbo NAS do for your business
PDF
Embedded Systems: Lecture 6: Linux & GNU
PPTX
SOUG_Deployment__Automation_DB
PPT
GPLS/PINES GenaSYS Presentation - EG2012
PDF
Building a Two Node SLES 11 SP2 Linux Cluster with VMware
PPTX
NGENSTOR_ODA_P2V_V5
PDF
Course 101: Lecture 4: A Tour in RTOS Land
PDF
My experience with embedding PostgreSQL
PDF
Gnubs-pres-foss-cdac-sem
PDF
XPDS16: Hypervisor Enforced Data Loss Prevention - Neil Sikka, A1LOGIC
PDF
Tuning DB2 in a Solaris Environment
PDF
Course 101: Lecture 6: Installing Ubuntu
PDF
Nagios Conference 2013 - John Sellens - Monitoring Remote Locations with Nagios
PPT
1184 Quayle
XPDS16: Xen Project Weather Report 2016
Embedded Systems: Lecture 5: A Tour in RTOS Land
Arch linux and whole security concepts in linux explained
What can QNAP Turbo NAS do for your business
Embedded Systems: Lecture 6: Linux & GNU
SOUG_Deployment__Automation_DB
GPLS/PINES GenaSYS Presentation - EG2012
Building a Two Node SLES 11 SP2 Linux Cluster with VMware
NGENSTOR_ODA_P2V_V5
Course 101: Lecture 4: A Tour in RTOS Land
My experience with embedding PostgreSQL
Gnubs-pres-foss-cdac-sem
XPDS16: Hypervisor Enforced Data Loss Prevention - Neil Sikka, A1LOGIC
Tuning DB2 in a Solaris Environment
Course 101: Lecture 6: Installing Ubuntu
Nagios Conference 2013 - John Sellens - Monitoring Remote Locations with Nagios
1184 Quayle

Similar to Systems administration for coders presentation (20)

PDF
Web 2.0 Performance and Reliability: How to Run Large Web Apps
PPTX
'Intro to Infrastructure as Code' - DevOps Belfast
ODP
Deepa ppt about lamp technology
ODP
lamp technology
PDF
Servers for Hackers Server Administration for Programmers 1 (2018-06-19) Edit...
PDF
Deployment of WebObjects applications on CentOS Linux
PDF
Servers for Hackers Server Administration for Programmers 1 (2018-06-19) Edit...
PPT
Planning for-high-performance-web-application
PDF
Linux Unveiled: From Novice to Guru Kameron Hussain
PDF
PDF Servers for Hackers Server Administration for Programmers 1 (2018-06-19) ...
PPTX
linux_admin_course_full_for beginers.pptx
PPT
Network administrationcode Lecture 1.ppt
PPT
Lamp technology
PDF
Linux Administration for Developers
PDF
Top AWS DevOps course in Hyderabad
PPT
Planning For High Performance Web Application
ODP
Nadhiya lamp
PDF
Scalable, good, cheap
PDF
Puppet for Sys Admins
PDF
Get Started with Linux Management Command line Basic Knowledge
Web 2.0 Performance and Reliability: How to Run Large Web Apps
'Intro to Infrastructure as Code' - DevOps Belfast
Deepa ppt about lamp technology
lamp technology
Servers for Hackers Server Administration for Programmers 1 (2018-06-19) Edit...
Deployment of WebObjects applications on CentOS Linux
Servers for Hackers Server Administration for Programmers 1 (2018-06-19) Edit...
Planning for-high-performance-web-application
Linux Unveiled: From Novice to Guru Kameron Hussain
PDF Servers for Hackers Server Administration for Programmers 1 (2018-06-19) ...
linux_admin_course_full_for beginers.pptx
Network administrationcode Lecture 1.ppt
Lamp technology
Linux Administration for Developers
Top AWS DevOps course in Hyderabad
Planning For High Performance Web Application
Nadhiya lamp
Scalable, good, cheap
Puppet for Sys Admins
Get Started with Linux Management Command line Basic Knowledge

Recently uploaded (20)

PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
Applying Agentic AI in Enterprise Automation
PDF
Peak of Data & AI Encore: Scalable Design & Infrastructure
PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PDF
Altius execution marketplace concept.pdf
PDF
Fitaura: AI & Machine Learning Powered Fitness Tracker
PPT
Overviiew on Intellectual property right
PPTX
Blending method and technology for hydrogen.pptx
PPTX
CRM(Customer Relationship Managmnet) Presentation
PDF
Examining Bias in AI Generated News Content.pdf
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
substrate PowerPoint Presentation basic one
PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
Decision Optimization - From Theory to Practice
Child-friendly e-learning for artificial intelligence education in Indonesia:...
Applying Agentic AI in Enterprise Automation
Peak of Data & AI Encore: Scalable Design & Infrastructure
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
Altius execution marketplace concept.pdf
Fitaura: AI & Machine Learning Powered Fitness Tracker
Overviiew on Intellectual property right
Blending method and technology for hydrogen.pptx
CRM(Customer Relationship Managmnet) Presentation
Examining Bias in AI Generated News Content.pdf
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
Revolutionizing recommendations a survey: a comprehensive exploration of mode...
Domain-specific knowledge and context in large language models: challenges, c...
substrate PowerPoint Presentation basic one
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Presentation - Principles of Instructional Design.pptx
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
Decision Optimization - From Theory to Practice

Systems administration for coders presentation

  • 1. SYSTEMS ADMINISTRATION FOR CODERS Hints & tips to increase reliability & reduce maintenance time.
  • 2. WHAT IS A SYSTEM? An assemblage or combination of things or parts forming a complex or unitary whole.
  • 3. WHAT DOES A SYSTEMS ADMINISTRATOR DO? • Introduces new technologies into an environment • Analyses system logs and identifies potential issues with a system. • Plans and performs routine maintenance • Performs and maintains backups • Installs and configures new software and hardware
  • 4. WHAT DOES A SYSTEMS ADMINISTRATOR DO? • Manages user accounts • Responsibility for security • Responsibility for documentation of the system • Plans systems upgrades and outages to apply upgrades • Troubleshooting reported problems • Deals with, often frustrated, system users... ... etc. etc.
  • 5. A COMPUTER SYSTEM • Many components working together - software (application, web server, OS), hardware (disks, RAM, CPU) & others (networking equipment, switches, routers, load balancers) • Provides stability and maintainability that underpins the entire application. • Supports your software for its lifetime. • Can provide parts of your application. Sometimes a problem has already been solved by some other software.
  • 6. START AT BEGINNING • Start sysadmin tasks at the beginning of the project. • Write tools to aid deployment. • Write tools to set up environments. • Iterate over these tools and stabilise for production
  • 7. ENVIRONMENTS • Dev, QA, Live • Dev, Test, QA, UAT, Live ~~ Dev, Test, QA, UAT, Staging, Live • The nearer they get to live, the closer the should resemble live. • Dev environment should at least be the same major versions, preferably OS version. • Vagrant is a useful tool for this.
  • 8. SSH • Probably the most frequently used tool • Forwarding SSH agent to allow key use remotely (e.g. git, hopping between servers) • Tunnels for access to remote resources • Reverse tunnels for remote access to local resource • Easy to configure the client
  • 9. SSH-AGENT • Generate keys >2048 bits (e.g. ssh-keygen -b 4096) • ssh-add to load default key (~/.ssh/id_rsa) • ssh-copy-id <server> to copy to remote server • ssh -A <server> to forward agent back to local instance. • Agent runs at login for modern Linux desktop, Mac OS.
  • 10. SSH-TUNNELS • Local access to remote: ssh -L3307:localhost:3306 <server> • Remote access to local: ssh -R:3307:localhost:3306 <server> • SOCKS proxy: ssh -D5050 <server>
  • 11. SSH CLIENT CONFIGURATION • Per user configuration: ~/.ssh/config • Config options can be set per host or via wild card, e.g. User, ForwardAgent, Hostname & many more • manpage: ssh_config
  • 12. UNIX/LINUX PRINCIPLES • Most things in Linux & UNIX are text. • Each command line tools does one task and does it well. • Command line tools process text with relative ease. • Much of the text is separated into fields - especially logs, or as key = value pairs. • There are standard locations for many types of file.
  • 13. BASIC TOOLS • cat - display text • grep - find text • awk - field processing (and more) • sed - search and replace text • wc - count • cut - simple field processing • head, tail - print first and last lines of text • sort - sort text
  • 14. LOCATION, LOCATION, LOCATION • /etc - configuration • /usr - read-only user data • /var - variable length files (caches, logs, temporary files) • /home - users' home directories • /opt - optional applications • /srv - served site specific data • See the Filesystem Hierarchy Standard. Same across most distros
  • 15. VARIABLE LENGTH FILES • /var/log - Logs go here • /var/cache - Cached files • Watch your permissions • During normal operation, /usr, /opt should be able to be mounted read only
  • 16. SOFTWARE DEPLOYMENT • Use vendor supplied packages whenever possible: • Reduces risk of misconfigurations • Easier to seek help • Usually well tested • Easier upgrades, timely security fixes • Building from source will take a fair amount of time, CPU • Ruby may be an exception. PHP isn't
  • 17. CHOICE OF LINUX DISTRIBUTION • Two main camps - Debian and RedHat • Red Hat Enterprise Linux is rock solid but expensive & packages tend to be older. CentOS is Enterprise Linux recompiled from the same source RPMs. • Debian stable is rock solid but packages tend to be old. Community/3rd party support only. • Ubuntu LTS is pretty solid, packages are more recent than EL. Well supported in the Cloud - AWS, OpenStack especially.
  • 18. SOURCE OF PACKAGES • Use as stable, well testing packages as much possible • Ubuntu main, Debian stable ideally • For EL distros, EPEL augments core packages well • For EL, IUS provide recent versions of MySQL, PHP but is less well tested. • Avoid one person repos, PPAs if at all possible.
  • 19. BUILDING FROM SOURCE • Do not build on live servers. Deploy only compiled code. • Ideally produce a package. • Avoid if possible. Increased risk of problems - more moving parts.
  • 20. DIAGNOSTICS • Check disk space: df -h 100% full is bad. • Check logs: /var/log, /var/log/syslog, /var/log/messages - get to know your logs. • dmesg for hardware information. • Check RAM (free -m) and CPU usage with top. • Install sysstat package early on - sar will gather data. Also gives you iostat, vmstat, mpstat.
  • 21. SECURITY • Install denyhosts/fail2ban to help protect SSH. • Disable SSH in as root, use SSH keys. • Use host based firewalls, AWS security groups. • Don’t run your servers as root. Try to split them over different users with clear paths between them. One user nginx, one. php-fpm • Audit trials are useful.
  • 22. BACKUPS • Databases: Dump the DB, don’t take hot copies of the DB files, • Make use of your hosting providers backup services. • Make sure you can restore. Test regularly.
  • 23. PROCESS • Repeat manual tasks often • Try to use the same deployment system across stages • Get live up early, treat it as UAT and deploy to it regularly. Avoid 'big bang' deployment • Use what suits - don't blindly follow trends, assess risks as suits the type of project. • Small steps, iterative improvement. Agile, Kanban, Lean etc.
  • 24. AUTOMATION • CFEngine, Puppet, Chef can get you quick wins. They can quickly become hard to manage. Learning curves are steep. • Ansible is simple to get going on. Can be hacked at and still get good results. Data driven. Pretty new, but growing fast. • Nothing wrong with shell/Python/Ruby/Perl scripts. Configuration management tools are not essential. • Packaging gets you out of a lot of automation tasks.
  • 25. THAT’S A LOT OF STUFF! • Not touched on DR, monitoring, OS provisioning, storage, networking... • Hire a sys-admin :) • A good sys-admin will work with you... • ...to let you get on with the job you enjoy.