Here are some Linux command line tricks I use on occasion for search and replace. This presumes the use of GNU utilities, so commands and results will vary on different platforms. Some cheat sheets: Sed | Awk | Perl | Bash See also the sed/awk and grep pages. Replace A with B in all files […]
Tag: Linux
Drupal Development
Notes on Drupal development using Devel and some of its children. Install and Enable the Devel Module Devel can be downloaded from Drupal.org or by using the drush pm-download devel/drush pm-enable devel commands. Drupal Development with Devel Among other things, devel allows you to see inside the Drupal objects and arrays containing the different properties […]
Using Drush
This is quick overview of using Drush, or the Drupal shell, for updating and managing Drupal web sites. Attempting to administer Drupal through its GUI is a pain, but Drush allows you to run updates and alter your configuration quickly on the command line. Best of all, Drush is fully scriptable and provides its own […]
Installing Drush
PHP Composer provides an easier way to install Drush than the method below. Instructions for this can be found in the Drush 8/Drupal 8 version of this article, available here. After installing Composer, run the command php composer.phar global require drush/drush:7.* to install Drush 7. Procedures for installing Drush on Linux-like machines. The easiest method […]
Nginx + PHP-FPM + PHP Cache + SSL + Varnish + Drupal
Note: The below instructions are for Varnish 3 on Ubuntu 12. If you want to run Drupal with Varnish 4 on Ubuntu 16, updated instructions are here. So, you want to set up Nginx and Drupal with all the bells and whistles on Ubuntu Server 12.04. You want caching for both PHP and Varnish and […]
Ubuntu 14 Web Server With Apache and PHP
Ubuntu 14.04 LTS has been out for a while now, and it offers some nice enhancements over 12.04 in its default repos: Apache 2.4, PHP 5.5, and MySQL 5.5.3x. Starting from a bare server image, here’s how to get an Ubuntu 14 web server up and running for PHP. Install the Web Server Note: If […]
Expand a Hard Disk with Ubuntu LVM
So you’re running an Ubuntu server in a virtual machine, and now you need to add 20 GB of disk space to root (/). There are quite a few ways to do this, and fortunately you’re running the Logical Volume Manager (LVM) in Ubuntu, so the process isn’t too bad. (This example uses Ubuntu Server […]
Recompile Nginx Installed With Apt
—————Update, August 2016: This article refers to Nginx 1.5.x. As of version 1.9.11, Nginx supports loading modules dynamically at runtime, so I’d suggest that route instead. If you still want to recompile Nginx, an updated tutorial for recompiling Nginx 1.9+ installed with Apt on Ubuntu 16.04 is available here. Meanwhile, an updated tutorial for compiling […]
Comparison of Apache Multi-Processing Modules
A quick summary of the major Linux/Unix Apache multi-processing modules. Prefork Default MPM in Apache < 2.4 Consumes more RAM than threaded MPMs like Worker or Event Threadless design is safe for non-thread-safe modules like mod_php Spawns child processes that each deal with one request at a time Performs poorly on high-traffic servers with many concurrent […]
Use Fail2ban to Block Bot Attacks
The Fail2ban monitoring utility tracks your server logs and temporarily adjusts your firewall rules to block IP addresses that originate suspicious behavior. Out of the box, though, Fail2ban ignores some annoying activity. For example, in your Apache error logs, you’re seeing a lot of entries like this: These are bots or script kiddies attempting to […]