IT Knowledge Base

Technical Repository

HowTo: Configure Lighttpd to redirect HTTP to HTTPS

$HTTP[“scheme”] == “http” { # capture vhost name with regex conditiona -> %0 in redirect pattern # must be the most inner block to the redirect rule $HTTP[“host”] =~ “.*” { url.redirect = (“.*” => “https://%0$0”) } }

Read More


HowTo: Linux – How to find out which file system is causing the DF command to hang

If you type “df -k” in a terminal window, and the command hangs (does not return), to find which filesystem is causing the hang: 1. Type mount -p to print the list of mounted file systems: # mount -p 2. Now type your df command again: # df -k Compare the output of the two commands, […]

Read More


HowTo: Linux Shell Scripting – Concatenate two variables with an underscore.

Wrap each variable in a curly brackets. #!/bin/bash _Directory=$/backups/ _FileName=$myfiles.bak echo ${_Direcotry}_${_FileName}) Output is: /backups/myfiles.bak

Read More


HowTo: Configure RedHat for ISCSI SAN Access

Install iSCSI Initiator Utils, Install Device Mapper Multipath and lsscsi # sudo yum install iscsi-initiator-utils # sudo yum install device-mapper-multipath # sudo yum install install lsscsi Find the name of the initiator server in the file /etc/iscsi/initiatorname.iscsi. In this example, the name of the server is iqn. # cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1994-05.com.redhat:46bf8e2794f Let’s change the initiator […]

Read More


HowTo: Configure SNMP on Linux

Just copy and paste the following commands in the terminal. They will update the configuration file and restart the service. Enable SNMP to listen on all interfaces sed -i ‘s/agentAddress udp:127.0.0.1:161/#agentAddress udp:127.0.0.1:161/g’ /etc/snmp/snmpd.conf Change SNMP Community String sed -i ‘s/ rocommunity public default -V systemonly/rocommunity MYSECURESNMPSTRING default -V systemonly/g’ /etc/snmp/snmpd.conf Allow SNMP connectinos from this […]

Read More


HowTo: Find the public IP address that a Linux server is behind

Install curl. apt-get install curl Run the following command: [email protected]:~# curl ifconfig.me 65.x.x.x

Read More


Postfix – Useful Commands

1. Give an approximation of the number of emails in the mailq. mailq | wc -l 2. Pause email delivery but still accept email. May be useful when needing to queue a large number of mail at once or when a mail needs to be deleted from the mail queue without stopping the mail server […]

Read More


HowTo: Fix VMware Tools Services Failure after Upgrading Linux Kernel

After upgrading the kernel on a Red Hat server, we see the following vmware-tools services fail to start: Checking acpi hot plug [ OK ] Starting VMware Tools services in the virtual machine: Switching to guest configuration: [ OK ] VM communication interface: [FAILED] VM communication interface socket family: [FAILED] Guest operating system daemon: [ […]

Read More


HowTo: Debian/Ubuntu – nslookup Not Found

You need to install the dnsutils package. The Berkeley Internet Name Domain (BIND) implements an Internet domain name server. BIND is the most widely-used name server software on the Internet, and is supported by the Internet Software Consortium, www.isc.org. This package delivers various client programs related to DNS that are derived from the BIND source tree. dig – query the DNS […]

Read More


HowTo: Enable the Status page for NGINX

Nginx has status page to give you information about Nginx’s server health including Active connections and other data. These statistics applied to the entire Nginx server and not per virtual host. nginx -V | grep –color -o http_stub_status Open Nginx.conf file to enable the status page. nano /usr/local/nginx/conf/nginx.conf Update the server { } block with […]

Read More