Linux Archives

Over 80% is running on some form of Linux – so does your Mac and you iPhone. Sometimes we have to get our hands dirty on the command line – it makes you feel like a proper hacker.

Here are some pointers I picked up on my journey.

How to avoid emails from Dr. Web

Dr. Web is a Russian anti-virus utility that comes bundled with Plesk. It’s good and it tries to keep the bad guys out.

To keep up with all the mutations out there it tries to update itself frequently. B default, Plesk sends the system admin an email when this happens – no matter if Dr. Web was successful or if there was a problem.

This is what a sample email looks like:

/etc/cron.daily/drweb-update:

Dr.Web update details:
Update server: http://update.us1.drweb.com/plesk/700/unix
Update has begun at Thu May 17 03:37:07 2011
Update has finished at Thu May 17 03:38:16 2011

Following files have been updated:
	/var/drweb/bases/drwdaily.vdb
	/var/drweb/bases/drwtoday.vdb
	/var/drweb/bases/dwmtoday.vdb
	/var/drweb/bases/dwntoday.vdb
	/var/drweb/bases/dwrtoday.vdb
	/var/drweb/bases/timestamp
	/var/drweb/updates/timestamp

Multiply that email by the number of servers you’re looking after, and you’ll soon have an overflowing inbox.

Here’s the solution: tweak a system file and divert those emails to nowhere.

Read more

How to install OSSEC HIDS on CentOS 6 and 7

Remote computers are under constant attack by Evil Dudes – that’s especially true for Linux servers. To prevent such attacks by Evil Dudes from Hacker Land, I’ve been relying on the amazing OSSEC Host Intrusion Detection System on all my machines.

Even though the OSSEC website is great, I always forget the simple steps that are involved in getting it up and running on a brand new server. Here are the steps that work for me.

I’ve originally written this article in 2011 for OSSEC 2.6, but I’ve just updated and tested the instructions again with OSSEC 2.8.1 on CentOS 7. It’s my go-to guide on how to get OSSEC up and running. However, by the time you read this it may all be completely out of date – please bear that in mind. Thanks 😉

Read more

How to amend an Application Vault Repository in Plesk

I’m currently building a WordPress Hosting Service where customers get hosting with WordPress pre-installed.

I also want to offer several pre-installed Themes and Plugins that I’ll deploy from the Plesk Back End using Application Vault.

WordPress is already available as a free repository, however it does take some time for new versions to be made available – and of course my Themes and Plugins aren’t there either.

So how can I amend or build a new Plesk Application Vault repository? Let’s find out in this article, in which I’m describing all my findings 😉

Read more

How to upgrade PHP on CentOS 5

With the recent end-of-life announcement it becomes clear that WordPress isn’t going to support PHP 5.1.6. for much longer anymore.

CentOS 5 however comes pre-compiled with PHP 5.1.6 and there are no plans to change this in the current version.

For simple folk like me it’s unimaginable to re-compile the entire OS from source or switch to a different distribution altogether. yum doesn’t help much by default – unless you’re looking in the right repositories.

Help is at hand, courtesy of the 1and1 Knowledge Base. Without further ado, here’s how to upgrade PHP on CentOS 5:

Read more

Linux Disk Space shown as Pie Chart

It's much easier to see a nice diagramme rather than a cryptic line of text from the command line interface

I’m managing a server for Loft London. They’re using it as FTP site for various clients, so I wanted to provide an easy way for them to keep an eye on how much space is used and how much is left.

I’ve done some digging and found this super handy PHP Pie Chart generator by Rasmus Peters. You can call it just like an image, give it some parameters and generate a very cool pie chart diagramme.

My challenge was to use it dynamically by calling the df command on th ecommand line and convert that into a pie chart. Here’s how I did it:

Read more

When Plesk fails to upgrade

I’ve had this issue before: you get a new server, the image is a few revisions behind the current release and your first line of business is to upgrade the system.

A few minutes later you check and find that Plesk refuses to start. Bugger. Now what?

My Customer Support Gurus always know what to do, but in an effort to not disturb them at night here’s what they did to make it all work again. These instructions work on a CentOS 5 system with Plesk 9.0.1 installed.

Read more

How to install Parallels Plesk on a new Linux server

So I’ve expanded my server arsenal to a fifith machine with Strato in Germany. Sadly they only offer an OpenSUSE installation bundled with Plesk (in German – unchangeable to English).

What I really wanted was another CentOS system though, which Strato offer – but without Plesk installed.

After a bit of hackage, I found out that it’s very easy to install Plesk from the command line via the Parallel’s Auto Installer.

These instructions should work on any distribution of Linux – just make sure you download the right auto installer package from the Parallels site (you need to create an account with them and log in for this link to work).

Read more

How to repair MySQL tables from the Command Line

Sometimes your tables crash and your website is unresponsive. You don’t have access to phpMyAdmin to do a repair, because you can’t access Plesk. That sucks! When you’re out in the field and all that’s at hand is a trusty SSH connection from your mobile, here’s an alternative way to bring your WordPress Sites back … Read more