HTTP STATUS CODES – A tale of a man, a refrigerator and an ice cream!

HTTP STATUS CODES – By a tale of a man, a refrigerator and an ice cream! Basics of HTTP protocol HTTP is a request response protocol where, a client (usually an internet browser) sends a request to a server (Usually running a web-server application like Apache, NGINX) and the server replies back with the requested content. Now, the client server communication is of-course not in plain English like we humans do instead, they speak in…

Continue reading

Password Authentication with Apache using .htaccess file

How to enable password authentication with apache using .htaccess file   Prerequisites To get started, you will need access to any Ubuntu or RHEL based server. You will need a non-root user with sudo privileges in order to perform administrative tasks. Install the Apache Utilities Package In order to create the file that will store the passwords needed to access our restricted content, we will use a utility called htpasswd. This is found in the apache2-utils package within the Ubuntu…

Continue reading

SSH Overview | The Bigger Picture

Suppose I access any website from my computer. The ongoing connection itself, through which my computer communicates with the remote web-server, is managed on layer 5, the session layer, through the HTTP protocol. SSH and Telnet also operate on layer 5. While the session itself is maintained by layer 5, it doesn’t actually do anything. You can think of it as a phone call where no one is saying anything. Getting the JPEG file to…

Continue reading

Deep Dive | SSH Protocol Version 2

There’s a lot more happening under the hood – Deep Dive SSH Protocol Version 2 SSH protocol version 2 is the default protocol used these days. Most modern operating systems now a days by default select SSH version 2 for login and they switch to SSH version 1 in case version 2 is unavailable. From first point in the below table, multiple functions like authentication, key exchange and encryption were part of a single protocol…

Continue reading

Deep Dive | SSH Protocol Version 1

The workflow of SSH Protocol Version 1 SSH Protocol works on Layer 5 of the OSI model which is also known as Session Layer. A common mis-conception is that SSH works on Public Key Cryptography and not on Secret Key A good program that you would want to use for remote login should have the CIA features which are confidentiality, integrity and authentication methods where these three mean the following: Confidentiality – The data is private…

Continue reading

Find 504s in access logs, grep timestamps and correlate with error and php5-fpm logs

Web-Server throwing too many HTTP 504s? Use this script to drill down and find the cause Script finds the 504s in the access logs (across zipped access logs as well), greps the timestamp of the log files and then finds the error logs (Across zipped error logs as well) corresponding to the timestamps of 504’s access log entries found. OS – Linux 3.2.0-4-amd64 x86_64 Memory/RAM – 4GB MySQL DB is running on a different server…

Continue reading

Ways PHP can run with Apache Web Server

How PHP runs on your Apache Web-Server? Know the concept Basically, when loading mod_php  (mod_php means PHP, as an Apache module.) as an Apache module, it allows Apache to interpret PHP files (those are interpreted by mod_php). There are (at least) two ways of running PHP, when working with Apache: Using CGI : a PHP process is launched by Apache, and it is that PHP process that interprets PHP code — not Apache itself Using PHP as an Apache module (called mod_php) : the PHP interpreter…

Continue reading

Steps to setup WordPress site on EC2 instance in 2-3 minutes

Now host your own website on AWS + WordPress – Absolutely Free! Step 1 – Launch an EC2 (Amazon Linux or Centos/RHEL flavor) instance with PublicIP/ElasticIP address. Step 2 – Connect to the above instance. Step 3 – Install Apache (httpd) Step 4 – Install PHP Step 5 – Install MySQL Database Step 6 – Install WordPress Step 7 – DNS mapping (Optional Step)

Continue reading