Posts by Category

Linux server

Configure RabbitMQ failover cluster

RabbitMQ is a universal bus to be used to exchange messages between the applications. There are other solutions like Kafka, AWS SQS, Google Pubsub, etc. If y...

Setup Unison in CentOS 7

Unison is one of the utilities that is used to replicate files between servers. A big advantage of Unison is its support for master-master replication.

OSSEC client-server installation

OSSEC is an open source attack detection and prevention system. It can be configured to monitor not only events in log files but also changes to files and ru...

Scan Linux server with maldetect

Malware Detect (LMD) is a utility that scans Linux systems for malicious files (malware). Distributed under the GNU GPLv2 license.

Disk space issue in Linux

Sometimes there’s plenty of free space on disk, but files stubbornly refuse to get created. In some cases you get an error saying the disk ran out of free sp...

Useful notes about Yum

A cheat sheet for working with the Yum (Yellowdog Updater, Modified) package manager which is used in popular Linux distributions: RedHat, CentOS, Scientific...

FireWall in CentOS7

In CentOS7 you can no longer edit the usual iptables firewall rules the way you’re used to. iptables itself is still there, but it’s now wrapped in firewalld...

Scan server with Chkrootkit

A rootkit is a hidden type of software. Usually it allows you to hide the existence of certain processes or programs from conventional detection methods or a...

Installing pecl on CentOS 6.5

PECL is a repository of PHP extensions. It gives you access to a catalog of all known extensions, plus tools for downloading and installing PHP extensions.

Install Mysql-Proxy into RedHat 6.4

While working with CentOS I had no issues to install Mysql-Proxy but with RedHad 6.4 this approach didn’t work. Here is why I made a second version on how to...

IpTables NAT in 3 steps

NAT — Network address translation — is a handy feature of any firewall, letting you translate the IP addresses of transit packets.

Setting up replication with lsync

For replicating data between servers, NFS isn’t always the right tool. If you need the same content in two directories across several servers, lsync works we...

What LVM is and what it’s for

LVM - logical volume manager. It lets you combine several physical disks into one logical device and treat that as a single disk.

Backup webiste to Dropbox

The other day I was wondering about the correct backup of several WordPress sites and then uploading them to some free storage. I would like it to be done wi...

Fail2Ban configuration

Fail2Ban is a software written in Python which is designed to prevent attacks on the server. It reads ssh, ftp, apache log files and blocks ip addresses by a...

Security tunning of SSH server

SSH is a secure terminal server (secure shell) that provides remote access to the linux system. Why safe? Because all traffic between the client and the serv...

Back to Top ↑

Apache

Configure SELinux for Apache on CentOS

SELinux is a Linux kernel module that provides an additional mechanism to determine folder and file permissions. Sometimes it creates considerable problems w...

Install Apache mod_evasive.

Description Mod_evasive, formerly known as mod_dosevasive, helps to safeguard your Apache web server against DoS, DDoS (Distributed Denial of Service), and b...

Install modsecurity for Apache

ModSecurity is a kind of firewall for Apache, Nginx and IIS. This is a module that provides a set of rules for filtering traffic. This is a ‘must have’ modul...

Use mod_substitute in Apache

The essence mod_substitute is to replace the text in the body of the response from the web server. With it you can change for example links to one domain wit...

Daily statistics in AwStats

AwStats is a log file parser written in perl, with which you can keep statistics of site visits based on information from log files. As a rule, awstats disp...

Install Apache Passenger for Ruby

A small note on how to install Apache passenger on CentOS to work with Ruby. I assume you have the following packages installed: ruby-mysql rubygems r...

Load Balancing with Apache

Greetings dear reader. In this article I want to describe how to configure Apache to load balance multiple back-end servers. You’ll need the following two mo...

Building a secure web server

To create the most secure web server we need the following: Create a sandbox chroot with debootstrap sandbox apache2, php5, mysql install and configur...

.htaccess tips and tricks

I’d like to present a set of interesting and not very features of .htaccess files and what can be done with them. Most of what is described here falls into t...

Back to Top ↑

Security

OSSEC client-server installation

OSSEC is an open source attack detection and prevention system. It can be configured to monitor not only events in log files but also changes to files and ru...

Configure SELinux for Apache on CentOS

SELinux is a Linux kernel module that provides an additional mechanism to determine folder and file permissions. Sometimes it creates considerable problems w...

Scan Linux server with maldetect

Malware Detect (LMD) is a utility that scans Linux systems for malicious files (malware). Distributed under the GNU GPLv2 license.

Scan server with Lynis

Lynis (formerly RkHunter) is a security auditing tool for Linux and BSD systems. It performs a detailed audit of many aspects of your system’s security and c...

Install modsecurity for Apache

ModSecurity is a kind of firewall for Apache, Nginx and IIS. This is a module that provides a set of rules for filtering traffic. This is a ‘must have’ modul...

Recover compromized Linux server

If you are reading this article than your site has been hacked. You have seen that spam is being sent from your server and you can’t figure out what to do wi...

Scan server with Chkrootkit

A rootkit is a hidden type of software. Usually it allows you to hide the existence of certain processes or programs from conventional detection methods or a...

Create SSL certificate in Linux.

In continuation of the series of articles about SSL I would like to describe the steps for the appearance of certificates. I will not repeat the terminology....

Install modsecurity for Nginx

ModSecurity is a kind of firewall for Apache, Nginx and IIS. This is a module that provides a set of rules for filtering traffic. This is a must have module ...

Building a secure web server

To create the most secure web server we need the following: Create a sandbox chroot with debootstrap sandbox apache2, php5, mysql install and configur...

Back to Top ↑

Email

Postfix change sender domain

Out of the box postfix is sending emails using the domain name that is returned by the following command in the linux shell: uname -n

Working with the mail queue in Qmail

Qmail is not the last word in mail delivery technology, but this smtp daemon is still very widespread. In particular many servers with the Plesk panel use ex...

Installing and configuring Postfix

This article opens a series of articles about setting up a mail server. The whole story starts with the configuration of the so called mail transfer agent (M...

Installing PostfixAdmin and RoundCube

This note tells how to install the mailbox management tool - PostfixAdmin, and a convenient interface for reading mail - RoundCube, on a server running CentO...

Moving SmarterMail to a new server

At any moment, for one reason or another, the question of moving SmarterMail to a new server can come up. The reasons can be different and I am not going to ...

Back to Top ↑

WordPress

Creating a child theme in WordPress

Inspired by an article on Habr, I decided to write my own take on creating a child theme in WordPress, since the Habr one has way too much text and explanati...

AdSense in a dynamic WordPress sidebar

I’ve had an AdSense block sitting in my sidebar for a while now. It only recently occurred to me that the sidebar has a dynamic size (22% of the page body), ...

Adding meta tags to WordPress

By default WordPress doesn’t output the tags you set on a post anywhere in the page source. According to this article meta tag support was removed from WordP...

IIS, PHP, OpenSource CMS and rabbits

Personally I consider hosting open-source projects on Windows Server a sacrilege, a stupidity and a moral defect. But sometimes there is a project where the ...

Back to Top ↑

Nginx

Install Nginx from the source code

There are many casess when we need to compile the the sofware from the source code. Nginx is a briliant case when the can’t enable geoip module or mod_securi...

Setting up Nginx + perl-fcgi

Everyone praises Nginx for its performance. But nobody accounts for the fact that it’s so fast because it’s missing all those modules that extend Apache’s fu...

Stats for NginX Upstream

When using NginX as a load balancer, the question comes up of how to properly track traffic delivery stats for the servers in the Upstream section.

Enabling the stats page in NginX

To enable the NginX stats page, add these lines to the nginx.conf config file, or the file where your sites are described. Add them inside the server { ... }...

Load balancing with NginX

Hello, dear reader. In this article I want to describe how to set up NginX for load balancing across several back-end servers, say Apache.

GeoIP for Nginx

The GeoIP module lets you determine a client’s location based on their IP address. It resolves city, region, country, longitude, latitude, and other info. Ve...

Setting up Nginx + php-fcgi

I assume nginx is already installed. What’s left is to set up php handling. Everything below was done on CentOS Linux. You can repeat the same steps on Linux...

Back to Top ↑

bash

Using expect in bash scripts

Expect is a wrapper that provides the ability to program the input for interactive programs. Interactive programs are applications that require the input of ...

SED Cheat Sheet

Sed is a stream editor on UNIX-like operating systems that is used to filter and transform text.

Interesting Bash Programming Tricks

These tricks were described in Google’s internal project “Testing on the Toilet” (handing out flyers in restrooms to remind developers about testing). This p...

Back to Top ↑

MySQL

Mysqldump using PHP

I’ve run into this more than once: you need to pull a dump of a large database from hosting, but there’s no remote access to the mysql engine. PhpMyAdmin mig...

MySQL: setting up replication

OK. This isn’t an original article. There’s plenty like it on the internet already. I need it so I don’t have to google it every time I need a cheat sheet.

Back to Top ↑

Monitoring

Installing monit on Debian/Ubuntu

Monit — a program for checking the state of services and keeping them running, which can send notifications when something goes wrong. It runs on linux, bsd ...

Installing Munin on CentOS

Munin is a tool for monitoring network devices with the ability to keep a history of their performance. You can view the performance graphs in a browser.

Uptime in Cacti Monitoring

Cacti does get SNMP-Uptime from devices, but it only shows it on the device’s own page, and once you have more than 100 such devices, opening each page becom...

Monitoring Squid with the SqStat Script

I’m sure every sysadmin has had to answer the why is the internet slow question from users, with something like someone hogging the bandwidth downloading end...

Configuring Awstats for Apache

Awstats is a free log analyzer written in Perl. It lets you build nice visit report graphs for your site based on info from log files.

Back to Top ↑

WHM/cPanel

Using cPanel (WHM) to Manage a Cluster

WHM is a decent server management tool. It’s paid, but the developers did a solid job. It’s fairly common to install WHM/cPanel on a single server that holds...

Back to Top ↑

Plesk

Tunning fail2ban in Plesk

Plesk allows to tune configuration of almost everything. fail2ban configuration is locates on the page Tools & Settings. Locate the section of IP Address...

How to Disable php safe_mode in Plesk

First log into Plesk. Go to the subscriptions page and pick the site you need. Then on the Websites&Domains tab expand Advanced Operations and pick Websi...

Back to Top ↑

PHP

Mysqldump using PHP

I’ve run into this more than once: you need to pull a dump of a large database from hosting, but there’s no remote access to the mysql engine. PhpMyAdmin mig...

Installing ionCube Loader for PHP

ionCube Loader is needed to run paid components on your server that the site relies on. Such components usually have obfuscated code, which makes them unread...

Back to Top ↑

Jenkins

Problems with re-login into Jenkins

Today I ran into a problem with re-login in Jenkins. After the session was broken as a result of restarting the Tomcat daemon, I was asked to log in with a n...

Back to Top ↑

Ubuntu Linux

How to Enable Hibernate on Linux Ubuntu

On some laptops, after installing Linux Ubuntu (12.04 LTS in my case), hibernate is disabled. Looks like it’s because such devices aren’t officially supporte...

Back to Top ↑

IIS

Configuring ETags in IIS7

Entity tags (ETags) are the mechanism web servers and browsers use to determine whether an element in the browser cache matches the object on the server.

404 errors in ColdFusion10

After the move from an IIS6+ColdFusion8 server to a server with IIS7+Coldfusion10 I did not enjoy the fact that all the start pages of the sites open for ver...

IIS, PHP, OpenSource CMS and rabbits

Personally I consider hosting open-source projects on Windows Server a sacrilege, a stupidity and a moral defect. But sometimes there is a project where the ...

Back to Top ↑

Other CMS

Meet Django

Django is a web framework written in Python, that provides a basic set of components for building a site. This article is about exactly that. I’ll cover sett...

Installing Drush by Hand

Drush is a cli for Drupal. In this article I’ll cover how to install it without pear. I won’t go into details on that.

Back to Top ↑

Clusters

A short overview of what HaProxy can do

HaProxy is a wonderful and very flexible tool for balancing traffic. It has a whole pile of options and configuration variants, and it has its own quirks. It...

Back to Top ↑

Windows Server

The WinSxS Folder in Windows Server

The Windows component store (C:\Windows\winsxs) is used during so-called servicing operations when installing software. These operations include Windows upda...

IIS, PHP, OpenSource CMS and rabbits

Personally I consider hosting open-source projects on Windows Server a sacrilege, a stupidity and a moral defect. But sometimes there is a project where the ...

Back to Top ↑

FTP

Back to Top ↑

Windows server

Back to Top ↑

MSSQL Server

Back to Top ↑

Joomla

Back to Top ↑

CentOS

Back to Top ↑

HaProxy

HaProxy configuration examples

Following up on the first article, in this one I want to look at a few examples of configuring HaProxy for balancing traffic.

Back to Top ↑

AWS

Back to Top ↑

Terraform

Back to Top ↑

SSL

Create SSL certificate in Linux.

In continuation of the series of articles about SSL I would like to describe the steps for the appearance of certificates. I will not repeat the terminology....

Back to Top ↑

Varnish

Varnish Configuration Review

There are plenty of articles about how to configure Varnish. Let me say right away that there’s no single correct approach to configuration. The more options...

Back to Top ↑

Perl

Perl Dancer + mysql + memcached

Most of the people writing Perl have heard about the Perl Dancer micro-framework. But did they use it for anything beyond generating a project, writing a ‘He...

Back to Top ↑

Clouds

RackSpace CloudFiles - uploading files

To upload files into the CloudFiles storage you can use the SDK for PHP. Other programming languages are supported too. The full installation description is ...

Back to Top ↑

Linux Server

Scan server with Lynis

Lynis (formerly RkHunter) is a security auditing tool for Linux and BSD systems. It performs a detailed audit of many aspects of your system’s security and c...

Recover compromized Linux server

If you are reading this article than your site has been hacked. You have seen that spam is being sent from your server and you can’t figure out what to do wi...

Back to Top ↑

Python

Back to Top ↑

FromHabrSandbox

Back to Top ↑

nginx

Install modsecurity for Nginx

ModSecurity is a kind of firewall for Apache, Nginx and IIS. This is a module that provides a set of rules for filtering traffic. This is a must have module ...

Back to Top ↑

jQuery

Simple and lightweight tabs with jQuery

A Habr user called Lzhedmitriy was not happy with the horizontal text tabs he found on the internet. As a result a simple jQuery plugin that does what he nee...

Back to Top ↑

Docker

Run Yii in Docker container locally

In this article I want to tell you what I did to automatically deploy NginX, php-fcgi and install Yii using docker. It can be usefull for local development. ...

Back to Top ↑

RackSpace

RackSpace CloudFiles - uploading files

To upload files into the CloudFiles storage you can use the SDK for PHP. Other programming languages are supported too. The full installation description is ...

Back to Top ↑

git

GIT cheatsheet

This is one of the cheetsheets I have at this website. The primary purpose of this one is to collect all usefull commands you might need in your daily work. ...

Back to Top ↑

PostgreSQL

psql command line cheat sheet

I switch between MySQL and PostgreSQL often enough that the psql meta-commands never stick in my head. Every time it’s the same five minutes of googling \d v...

Back to Top ↑

Control Panels

Back to Top ↑

DNS MX

Back to Top ↑

Magento

Back to Top ↑

Active Directory

Back to Top ↑

Javascript

Back to Top ↑

Tomcat

Back to Top ↑

Load balancing

A short overview of what HaProxy can do

HaProxy is a wonderful and very flexible tool for balancing traffic. It has a whole pile of options and configuration variants, and it has its own quirks. It...

Back to Top ↑

SQL Server

T-SQL Cheat Sheet - Part 1

In this post I put together a basic set of t-sql scripts that give you metadata about MSSQL. If you’ve ever tried getting some of this info through the GUI, ...

Back to Top ↑

Linux_server

Back to Top ↑

Mail

Back to Top ↑

Puppet

Puppet - Entry Point

Puppet is a set of utilities written in Ruby that let you manage a large number of servers from one place. It lets you describe the desired state for every s...

Back to Top ↑

Windows

Back to Top ↑

WHM

Create account in WHM/cPanel from cli

WHM provides a very friendly interface for managing sites, users and databases on the server. Sometimes you have to create several hundreds of accounts for d...

Back to Top ↑

cPanel

Create account in WHM/cPanel from cli

WHM provides a very friendly interface for managing sites, users and databases on the server. Sometimes you have to create several hundreds of accounts for d...

Back to Top ↑

Archive

Back to Top ↑

DevOps

DevOps CoE Best practices

DevOps Center of Exelence (CoE) is a new trend in team work when DevOps team is no longer concentrated on the single project. It is more a service team insid...

Back to Top ↑

cloudflare

Back to Top ↑

GCP

Back to Top ↑