Tag: UNIX

Running Vhosts Under Separate UIDs/GIDs

Install apache2-mpm-itk apache2-mpm-itk is available as a Debian package for Debian Etch, so all we have to do is run. Configuring apache2-mpm-itk apache2-mpm-itk is configured on a per-vhost basis, i.e., we don’t have to set any global options, and there’s

Regular Expressions

Basic Syntax To use regular expressions first you need to learn the syntax. This syntax consists in a series of letters, numbers, dots, hyphens and special signs, which we can group together using different parentheses. In PHP every regular expression

SSH Password-less Login

The below example, describe how to set up SSH password-less automatic login from server A to B with user user. Create Authentication SSH-Keygen Keys on A Create .ssh Directory on B Upload Generated Public Keys to B Set Permissions on

String Pattern Using grep Command on Bash shell

How do I grep for multiple patterns? The syntax is: Use single quotes in the pattern: grep ‘pattern*’ file1 file2Next use extended regular expressions: egrep ‘pattern1|pattern2’ *.pyFinally, try on older Unix shells/oses: grep -e pattern1 -e pattern2 *.pl Grep searching

Install and Setup Redis for WordPress

Install the Latest Redis Server Run the command below to install Redis Verify that you have version 4 of Redis installed with the following command: Allocate Memory to Redis and Setup an Eviction Policy Now that Redis is installed, run

Clear Memory Buffer Cache

There are three options available to flush the cache of Linux memory. Use one of below as per your requirements. Free pagecache, dentries and inodes in cache memory Free dentries and inodes use following command Free pagecache only use following

Send PHP mail via SMTP

Overview When you use the PHP mail function, you are sending email directly from your web server. This can cause issues if the FROM address isn’t set properly or if your email isn’t hosted with DreamHost. Sending mail via SMTP

How to Install Pass in Linux

Debian based systems, use apt-get or apt package manager to install pass. How to generate GPG key pair Make sure you have your own GPG key pair. If no, create a GPG key pair by running following command on terminal

Fail2ban

Installing Fail2ban It operates by monitoring log files for certain type of entries and runs predetermined actions based on its findings. You can install the software with the following Once installed, copy the default jail.conf file to make a local

Certbot

Install Certbot Run this command on the command line on the machine to install Certbot. Choose how you’d like to run Certbot Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it,