Useful list of commands for linux server management

Useful list of commands for linux server management
by Janeth Kent Date: 09-07-2013 unix linux commands commandlist management server

List of checks that you can perform on a linux server to try and figure out why it keeps going down

Disk Space:

df -h

(Make sure you have enough disk space)

Memory:

free -m

(Check you're not out of memory)

Processes / Load average

top (shift + m)
htop

(Check for processes that are taking up a lot of memory/CPU)

Apache errors

cat /var/log/apache2/error.log

(Look for 500 errors caused by erroneous code on the server)

High hit rate

grep MaxClients /var/log/apache2/error.log

(Check for MaxClients warningdamn in your apache error logs)

tail -f /var/log/apache2/access.log

(Check for bots/spiders) [You might need to lower your MaxClients settings]

Check recent logs

ls -lrt /var/log/

(the -lrt flag will show you the most recently modified files at the end)

Check your cronjobs

ls -la /var/spool/cron/*
ls -la /etc/cron*

(You might find your server is going down at a certain time, this could be result of a cronjob eating up too many resources)

Check Kernel Messages

dmesg

Check inodes

df -i

(Check inodes remaining when you have a disk that looks full but is reporting free space)

Install Systat for collective stats (cpu, i/o, memory, networking)

http://www.thegeekstuff.com/2011/03/sar-examples/

Determine how many apache threads are running (if you're not using mod_status)

ps -e | grep apache2 | wc -l

For DOS attacks: Start

Number of active, and recently torn down TCP sessions

netstat -ant | egrep -i '(ESTABLISHED|WAIT|CLOSING)' | wc -l

Number of sessions waiting for ACK (SYN Flood)

netstat -ant | egrep -i '(SYN)' | wc -l

List listening TCP sockets

netstat -ant | egrep -i '(LISTEN)'

List arguments passed to program

cat /proc/<PID>/cmdline

For DOS attacks: END

 
by Janeth Kent Date: 09-07-2013 unix linux commands commandlist management server hits : 6073  
 
Janeth Kent

Janeth Kent

Licenciada en Bellas Artes y programadora por pasión. Cuando tengo un rato retoco fotos, edito vídeos y diseño cosas. El resto del tiempo escribo en MA-NO WEB DESIGN AND DEVELOPMENT.

 
 
 

Related Posts

How To Use Varnish As A Highly Available Load Balancer On Ubuntu 20.04 With SSL

Load balancing with high availability can be tough to set up. Fortunately, Varnish HTTP Cache server provides a dead simple highly available load balancer that will also work as a…

How to install a Linux partition on a Windows 10 PC

In spite of a past we could say almost confronted, the approach between Windows and Linux is accelerating more and more, drawing a story closer to love than to hate.…

WSL2 is released to run Linux distributions on Windows

If you are reading about this for the first time, the Windows Subsystem for Linux is a kind of virtual machine that allows you to run the Linux terminal on…

Linux For Dummies: Permissions

In the previous articles I made a short introduction to the Unix world and in the following article I have dealt with the basic commands for the file system management. Today we are…

Linux for Dummies: Ubuntu Terminal

I introduced in the previous article, available here, the basic concepts concerning the Linux world. Today we are going to have a look to some basic operations that we can perform…

Linux for Dummies: Introduction

If you have thought about migrating from Windows to a Unix operating system, or Linux specifically there are things you should know. The goal is to give essential information (and…

The Best RSS Readers for Ubuntu

Even if most of the tech experts actively claim that RSS (Rich Site Summary) is dead especially after Google Reader was discontinued 5 years ago but it isn’t yet as…

80 Linux Network Monitor Software & Tools for Managing & Monitoring Unix/Linux Systems

It’s hard work monitoring and debugging Linux performance problems, but it’s easier with the right tools at the right time. Finding a Linux Network Monitor tool or Software package for…

How to install Letsencrypt Certificates with Certbot in Ubuntu

In this article we will explain how to install, manage and configure the SSL Security certificate, Let's Encypt in NGINX server used as proxy. This certificate is free but does…

How to Set up a Fully Functional Mail Server on Ubuntu 16.04 with iRedMail

Setting up your own mail server from scratch on Linux is complex and tedious, until you meet iRedMail. This tutorial is going to show you how you can easily and…

Useful Terminal Commands Every Web Developer Should Know About

The command line interface (CLI), or Terminal is considered by many to be the Holy Grail of computer management. At one time the CLI was the only way to accomplish…

GIMP 2.10 released: Features 32-bit support, new UI and A Ton Of Improvements

It's been over a half-decade since the GIMP 2.8 stable debut and today marks the long-awaited release of GIMP 2.10, its first major update in six years. And among other…

Clicky