I’ve been running Linux servers long enough to watch hardware die, kernels panic, filesystems fill up at midnight hours, and network cards slowly burn out like old light bulbs.
Over time, you learn that keeping a server alive is less about “perfect architecture” and more about steady discipline – the small habits built to manage the machines, helps prevent big disasters.
Here are some practical, battle-tested lessons that keep my boxes running for years with minimal downtime. Most of them were learned the hard way.
1. Monitor Before You Fix – and Fix Before It Breaks
Most Linux disasters come from things we should have noticed earlier. The lack of monitoring, there is modern day saying that should become your favourite if you are a sysadmin or Dev Ops engineer.
"Monitoring everything !"
The disk that was at 89% yesterday will be at 100% tonight.
The log file that grew by 500 MB last week will explode this week.
The swap usage creeping from 1% → 5% → 20% means your next heavy task will choke.
The unseen failing BIOS CMOS battery
The RAID disks degradation etc.
You don’t need enterprise monitoring to prevent this. And even simple tools like monit or a simple zabbix-agent -> zabbix-server or any other simplistic scripted monitoring gives you a basic issues pre-warning.
Even a simple cronjob shell one liner can save you hours of further sh!t :
#!/bin/bash
df -h / | awk 'NR==2 { if($5+0 > 85) print "Disk Alert: / is at " $5 }' \ | mail -s "Disk Warning on $(hostname)" admin@example.com
2. Treat /etc directory as Sacred – Treat It Like an expensive gem
Every sysadmin eventually faces the nightmare of a broken config overwritten by a package update or a hasty command at 2 AM.
To avoid crying later, archive /etc automatically:
# tar czf /root/etc-$(date +%Y-%m-%d).tar.gz /etc
If you prefer the backup to be more sophisticated you can use my clone of the dirs_backup.sh (an old script I wrote for easifying backup of specific directories on the filesystem ) the etc_backup.sh you can get here. Run it weekly via cron. This little trick has saved me more times than I can count — especially when migrating between Debian releases or recovering from accidental edits.
3. Automate everything what you have to repeatevely do
If you find yourself doing something manually more than twice, script it and forget it.
Examples:
rotating logs for misbehaving apps
restarting services that occasionally get “stuck”
syncing backups between machines
cleaning temp directories
Here’s a small example I still use today:
#!/bin/bash
# Kill zombie PHP-FPM children that keep leaking memory
Dirty way to get rid of misfunctioning php-fpm ? Yes. But it works.
4. Backups Don’t Exist Unless You Test Them
It’s easy to feel proud when you write a backup script. It’s harder – and far more important – to test the restore.
Once a month or at least once in a few months, try restore a random backup to a dummy VM. Sometimes backup might fails, or you might get something different from what you originally expected and by doing so you can guarantee you will not cry later helplessly.
A broken backup doesn’t fail quietly – it fails on the day you need it most.
5. Don’t Ignore Hardware – It Ages like Everything Else
Linux might run forever, but hardware doesn’t.
Signs of impending doom:
dmesg spam with I/O errors
slow SSD response
increasing SMART reallocated sectors
random freezes without logs
sudden network flakiness
Run this monthly:
6. Document Everything (Future You Will Thank Past You)
There are moments when you ask yourself:
“Why did I configure this machine like this?”
If you don’t document your decisions, you’ll have no idea one year later.
A simple markdown file inside /root/notes.txt or /root/README.md is enough.
Document:
installed software
custom scripts
non-standard configs
firewall rules
weird hacks you probably forgot already
This turns chaos into something you can actually maintain.
7. Keep Things Simple – Complexity Is the Enemy of Uptime
The longer I work with servers, the more I strip away:
fewer moving parts
fewer services
fewer custom patches
fewer “temporary” hacks that become permanent
A simple system is a reliable system. A complex one dies at the worst possible moment.
8. Accept That Failure Will Still Happen
No matter how careful you are, servers will surely:
crash
corrupt filesystems
lose network connectivity
inexplicably freeze
reboot after a kernel panic
Don’t aim for perfection.Aim for resilience.
If you can restore the machine in under an hour, you're winning and in the white.
Final Thoughts
Linux is powerful – but it rewards those who treat it with respect and perseverance. Over many years, I’ve realized that maintaining servers is less about brilliance and more about humble, consistent care and hard work persistence.
I hope this article helps some sysamdmin to rethink and rebundle servers maintenance strategy in a way that will avoid a server meltdown at night hours like 3 AM.
It is the first week after Orthodox Christian Easter. This year 2012, the Orthodox Christians Easter date was on fifteen of April. We've not just had a feast of an Eastern, but we actually celebrated the greatest day in all human history that happened 2012 years ago – The Glories Resurrection of our Lord Jesus Christ from the Death in the Third day!
Some Roman Catholic Christians, might be wondering, why the Orthodox Church is celebrating one week after Jewish Pascha, so in short I will explain in the reason.We orthodox christians do not celebrate with Roman Catholics Easter because Roman Catholics use the gregorian calendar to calculate and decided the day in which the Eastern celebrations should occur, where we the Orthodox Christians use still the old moon calendar (which the jews used too), when Jesus was crucified. The gregorian calendar is very precise from a scientific point of view, however from a Church stand point it is completely wrong because, plainly taking the gregorian calendar math model doesn't take in consideration, that the jews are still celebrating their pascha following the old moon calendar.
The consequence is this year Roman Catholics, celebrated with Jewish. This from our Orthodox Christian point of view is incorrect, because Christ's Cross suffering is the pascha for us christians. We Christians consider that the old God ordained jewish pascha was a prophecy feast, simply to remind jewish people before Christ's coming that Messiah (Christ) will come to say his people. As Jewish rejected their true Messiah and Crucified him on the Cross, they have rejected to accept Christ as being the true pascha lamb slained for our sins.
Hence the Orthodox Christian Church teaches even to this day, that it is not righteous to celebrate Christ's Glorious Resurrection with Jewish Pascha. Prohibition to celebrate Easter and Jewish Pascha on the same day is an Orthodox Church rule, since the early church days. The Holy Fathers in their Church councils Council of Nicaea etc. has established as unchangable Church rule that, Jesus's Resurrection day feath, should never-ever coincide with the Jewish Pascha Celebrations.
The reasons the Church fathers ordered the Church Easter day to be always 1 week after Jewish Pascha is our saviour Jesus Christ ate pascha with his desciples as we can read in the 4 gospels in Holy Bible. After Jesus ate pascha, he was caught mocked, tortured and crucified (killed on a cross shaped trees).
Jesus is Risen! Truly He is Risen!
The Slavonic Paschal Greeting, translated words, we use across the Slavonic dome: ( Bulgaria / Russia / Ukraine, Serbia) is:
Христос Воскресе ! Воистину Воскресе!
According to our Church Tradition, Christians should great each other with the Paschal greeting Hristos Voskrese during the whole "bright week" instead of the usual Hi / Hello phrase.
The current Bulgarian version of Христос Възкресе ! Воистину Воскресе! is
Христос Възкръсна! Наистина Възкръсна!
One great miracle that testifies about the Christ's resurrection each and every year happens on each Orthodox Christian Eastern in Jerusalem in the Temple of Holy Sepulchre (where the saviour's grave cave, before the resurrection used to be). Last year, I've written to great all Christians for the Resurrection with the joyful Paschal Greeting Jesus is Risen and the Miracle of the Holy Fire Pitily, the number of Roman Catholics who heard or know about this amazing miracle are mostly within the clergy. Its very rare a layman Christian in Roman Catholic realm heard of the miracle. Once again as a closure I want to great everyone with the joyful paschal greeting in the manners of Russians which say it three times during the paschal period.
Христос Воскресе! Воистину Воскресе ! Христос Воскресе! Воистину Воскресе ! Христос Воскресе! Воистину Воскресе !
After a recent new Debian Squeeze Apache+PHP server install and moving a website from another server host running on CentOS 5.7 Linux server, some of the PHP scripts running via crontab started displaying the following annoying PHP Warnings :
debian:~# php /home/website/www/cron/update.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/suhosin.so' – /usr/lib/php5/20090626/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
Obviously the error revealed that PHP cli is not happy that, I've previously removes the suhosin php5-suhosin module from the system. I wouldn't have removed php5-suhosin if sometimes it doesn't produced some odd experiences with the Apache webserver. To fix the PHP Warning, I used first grep to see, where exactly the suhosin module gets included in debian's php.ini config files.
debian:~# cd /etc/php5
debian:/etc/php5# grep -rli suhosin *
apache2/conf.d/suhosin.ini
cgi/conf.d/suhosin.ini
cli/conf.d/suhosin.ini
conf.d/suhosin.ini
Yeah that's right Debian has three php.ini php config files. One for the php cli – /usr/bin/php, another for the Apache webserver loaded php library – /usr/lib/apache2/modules/libphp5.so and one for Apache's cgi module – /usr/lib/apache2/modules/mod_fcgid.so .
I was too lazy to edit all the above found declarations trying to include the suhosin module in PHP, hence I remembered that probably all this obsolete suhosin module declaration are still present because probably the php5-suhosin package is still not purged from the system.
A quick check with dpkg , further strenthened my assumption as the php5-suhosin module was still hanging around as an (rc – remove candidate);
A Hunting Accident is another one of those many Classic Soviet Movies. It is produced in 1978. As most Russian movies you have to be russian to understand it 🙂 The movie doesn't have a too special plot but has unique scenes very much reminding me of Gothism. Its really worthy to see the movie just for the sake of getting to know better Soviet Culture. White Horses beautiful ladies, elegant gentleman in white carrets this is the accident of the movie. The main actress is stunningly beautiful just like most Russian ladies 🙂 Movie is a great one for people who value Art movies.
A Hunting Accident (Russian: Мой ласковый и нежный зверь, translit. Moy laskovyy i nezhnyy zver, My Affectionate and Tender Beast) is a 1978 Soviet drama film directed by Emil Loteanu. It was entered into the 1978 Cannes Film Festival.[1] It is adapted from Anton Chekhov's "The Shooting Party."
For those understanding Russian here is some more information in Russian. Сюжет[править] Дочь лесничего – Скворцова Ольга (Галина Беляева) — красивая девушка 19 лет. По первому впечатлению, естественна и легка, как «ангел во плоти», однако позже выясняется, что она по-житейски расчётлива и тщеславна. В Ольгу влюбляются трое мужчин: Урбенин (Леонид Марков), граф Карнеев (Кирилл Лавров) и судебный следователь Камышев (Олег Янковский). Ольга, желая избавиться от нищеты, без любви выходит замуж за управляющего имением — дворянина, 50-летнего вдовца Урбенина. В день своей свадьбы она признаётся в любви Камышеву, однако отказывается уехать с ним. Камышев — высокий, широкоплечий красивый мужчина около 40 лет, изысканно одевается. Ольга думает, что он богат, но скоро узнаёт, в каких непрезентабельных условиях он живёт. После этого она становится сожительницей графа Карнеева. Во время охоты её убивают. Подозревают и ссылают на каторгу её мужа Урбенина, где он через четыре года умирает. Однако истинным убийцей является Камышев.
I'm not a big fan of Steve Jobs, neither I like the cult that is nowdays to his personality. After his recent death the cult to Jobs and his works has bloomed once again. From philosophical point of view I don't like Jobs ideas that there is no good and bad but only success matters. However I should admit as a SEO and as a business enterpreneur his achievements are significant. Hence I decided to share with you a video of SEO Summit ex-employee Guy Kawasaki, who "worked for jobs twice and survived". Jobs is famous for not being loved too much by his employees. Also it is not a secret historically he screw up, Steve Wozniak and a number of other people who were either employeed or worked in any way with him.
The points his ex-employee KAWASAKI shares on this SEO Summit presentation are quite interesting and are things, beginning business enterpreneurs like me could learn tremendously from. One key point that is hardly underlined in the presentation is the importance of simplicity.
* Simplicity in everything is essential for the success. It was quite curious to me Steve Jobs presentations were consisting often with a slides of just one word. Obviously this means Jobs was a simplicity freak.
Some of other concepts of Jobs was:
Either it works or it doesn't work.
You see again his trend to be simplifying things. In business we all know the SMART (Keep it Simple And Stupid). It seems Jobs SMART was only SAS (Simple and Stupid) 🙂 ….
Some other things Kawasaki learned from Jobs was:
Never believe Experts
– If someone tells you he is an expert in something he is definitely not ….
Another belief (understanding) of Jobs and probably many other succesful enterpreneurs is that DESIGN COUNTS. Design is one of the most crucial points in any product, so one has to be extra-careful here. A fail in design is a fail in product line ….
There is plenty of other interesting stuff in the video but the key point is SIMPLICITY. Enjoy Kawasaki Speech …
I'm studying Project Management, right now. In that spirit of thoughts I and a couple of other guys are building a Project Plan. As it Project Plan it's necessary to put a GANTT Chart in it to show visually the project timeline (the phases), the duration and the inter-relation between the different tasks which leads the project to an actual completion.
After a bit of thorough research online on available software to deal with project management and particularly, ones that are capable to build a GANTT charts on Linux / BSD.
I've come with the following list of software capable to be a substitute for the Microsoft Project software. Redmine GANTT Chart
3. Task Juggler Project Manager with GANTT Capability for (KDE) Task Juggler
4. JxProject – This software is not free, though it can be considered almost free Take a look also at: 5. Trac , though it doesn't really support GANTT charts it's a lovely software to be used for PM.
Another option you have is to try out: 6. PHProjekt
Update 20.09.2016 – PHPProject Old download link is no longer active
It is this link http://www.phprojekt.com/, but the page doesn’t seem to be active any more. I thought you might want to update.
If you are looking for an alternative please check out http://wiht.link/PHProjekt-PM, it may make a suitable replacement.
Kind Regards, Tom Wilcox
That piece of softwre really looks promising, especially if we consider that it's web based and how much essential is today to have an anline tools for doing the ordinary desktop jobs.
As I've tested the software the software is easy to be used, however it still is missing some essential parts that Microsoft Project includes so it's not 100% substitute. Also it's not able to open Microsoft Project (MPP) files, neither able to save the charts in the .mpp format.
Moving ahead I've came across DotProject DottProject Gantt Chart
I haven't took the time to test it myself but however, as I go through the software website the project looked quite good. Lastly you can take a look at: 7. PStricks as a mean of project management, however I think it doesn't support GANTT chart building. >
These days it is not common to install Windows XP however for some old unsupproted applications that still work on XP in many countries in Africa, Asia, Europe and even America. Custom patched Windows XP is still heaveily used for some corporate businesses in accounting and on airports and other government institutions even to these day, I'm aware of Windows still heavily used especially in Russia, Belarus,Ukraine, Kazakhstan, Armenia, Bulgaria etc.
Hence still there is plenty of softwares designed to work XP the good old Win XP and thus often XP needs to be emulated on VMs though officially not supported any longer by Microsoft (its Support lifecycle End was for a last time on April 14, 2009).
Now I guess these days I guess nobody doesn't install and use Windows XP on a normal hardware PC Desktop / laptop but XP is continually installed on Virtual machine servers VMWare / VirtualBox.
Hence if you happen to have already migrated or installed some old Windows XP operating systems under VMWare for a corporate clients single core machine (no matter virtual or physical) and the client requires an update of hardware of the Virtual Machine you will be surprised that even though you add a second / third etc. core (new CPUs) the virtual machine hardware and restart the Windows XP installation.
It seems XP is designed to remember the install time CPU model hardware so once the VM and doesn't have a way to update its HAL (Hardware Abstraction Layer) definitions if you install it in Virtualbox thus to make XP recognize the extra added CPU cores it is necessery to do a small hack with a devcon.exe utility downloadable from Microsoft site to do the trick
Note that it will work only if you use the correct version depending whether XP is (x86/x64) bit install so check it out from My Computer -> Properties.
devcon.exe will let the automatic hardware detection find out the extra CPU (multicores) added. Wait 'till you get prompted for a reboot. Be brave Reboot! 🙂
There is pretty much more fun useful things you can do with devcon.exe such as disabling USBs from command line,
listing your PCI devices and so on:
You should now see all cores, hooray cores will appear in Task Manager / System Information.
Just wanted to say that I'm quite satisfied with Godaddy's SSL certificate generation.
SSL certs generation with Godaddy is dramatically more easy and intuitive than with certs bought from Enom.com.
To generate a new certificate with Godaddy, login to your godaddy account, press My Account -> SSL Certificates
Godaddy does grant you new credits whenever you have purchased a new ssl certificate for them, 1 credit is equal to one certificate.
You later use this credit to get your SSL certificate which will appear in the list of ssl certificates.
To manage the new certificate I had to press over Manage Certificate Next over 3 steps it's necessery to place a newly generated CSR file to generate the CSR file I issued:
/usr/bin/openssl genrsa -des3 -out www.domain.com.key 2048
Enter pass phrase for www.domain.com.key:
There is a field which requires you to paste in the newly generates csr file with the above command in Godaddy's SSL generation step 2.
Step 3 does not require anything special.
After this steps if the domain for which an SSL cert is generated doesn't contain some specific banned words which prohibits automatic approval of a certificate an email is received in the email set for the godaddy account.
After Godaddy approves the generation of the respective ssl cert it starts appearing in the menu: Manage Certificates -> Certificates tick over to choose the common name of your certificate and a button a bit above with a green down arrow will turn green. Press over it and you will be offered a menu whether you can choose the version of the webserver for which you will need the newly generated SSL certificate to install on.
In my case it was Apache so I choose Apache, gt the certificate put it and install it to apache and restart Apache and you're done.
Something very useful that most Apache LAMP (Linux Apache MySQL PHP) admins should know ishow to check Apache Webserver uptime and MySQL server running (uptime). Checking Apache / MySQL uptime is primary useful for scripting purposes – creating auto Apache / MySQL service restart scripts, or just as a quick console way to check what is the status and uptime of Webserver / SQL.
My experience as a sysadmin shows that lack of Periodic Apache and MySQL restart every week or every month often creates sys-admin a lot of a headaches cause (Apache / NGINX / SQL server) starts eating too much memory or under some circumstances leads to service or system crashes. Periodic system main services restart is especially helpful in case if Website's backend programming code is writetn in a bad and buggy uneffient way by unprofessional (novice) programmers. While I was still working as Senior SysAdmin in Design.BG, I've encountered many such Crappy Web applications developed by dozen of different programmers (because company's programmers changed too frequently and many of the hired Web Developers ,were still learning to program, I guess same is true also for other Start-UP Web / IT Company where crappy programming code is developed you will certainly need to keep an eye on Apache / MYSQL uptime. If that's the case below 2 quick one liners with PS command will help you keep an eye on Apache / MYSQL uptime
Though example is for mysql and Apache you can easily use ps cmd in same way to check any other Linux service uptime such as Java / Qmail / PostgreSQL / Postfix etc.
As part of my passion for ASCII art, I've found another interesting tool useful to ASCII art maniacs like me, the tool is called ditta and is able to convert manually drawn ASCII art diagrams to graphics, below is tool description from my debian apt-cache as well as a screenshot:
apt-cache show ditaa|grep -i ditaa -A 4
Package: ditaa Priority: optional Section: graphics Installed-Size: 164 Maintainer: David Paleino <dapal@debian.org> — Filename: pool/main/d/ditaa/ditaa_0.9+ds1-2_all.deb Size: 107270 MD5sum: 05ec52d9274b954b053f1835ca5d7a7f SHA1: 792d91d05fff2a2a19c0ebce317351d138436c18 SHA256: c4319d32e7918aab782e2f38cdad745bc9023f9f09a999033d983095ee4f70d5 — DiTAA is a small command-line utility that can convert diagrams drawn using ASCII art ("drawings" that contain characters that resemble lines, like | / and -), into proper bitmap graphics. . DiTAA also uses special markup syntax to increase the possibilities of shapes and symbols that can be rendered. Homepage: http://ditaa.org
To install ditaa on Debian and Ubuntu Linux:
debian:~# apt-get install --yes ditaa
...
Ditaa text diagram to Graphics converter is also available in Fedora Linux and in Source RPMs to be used on Redhat Based RPM distributions. To install in most of RPM based Linuxes:
[root@fedora:~]# yum install -y ditaa …
For most people probably Ditta will not be of any value except as a PoC and of a Hack value just like Ditaa's home page suggests. Nomatter that Ditta is cool but has just 2 drawback it doesn't understand non-latin characters i.e. Cyrillic and requires Java Virtual Machine .. but if you're a real geek you will do the sacrifice to install a whole bunch of the heavy java for the sake of some oldschool fun 🙂 Being written in Java makes Ditta multi-platform, but you will need a Java VM version of at least 1.6 (it doesn't work with Java 1.5).