Category Archives: Linux

Change Hostname & FQDN in RHEL or CentOS

Step 1: Edit the /etc/hosts file and give IP Address,FQDN name and Server name #vi /etc/hosts ipaddress_of_system server1 Step 2: Edit /etc/sysconfig/network file ,give HOSTNAME as machine name i.e server1 # vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=server1 Step 3: Restart the network service. /etc/init.d/network restart Now check the hostname and FQDN with command called “hostname” and… Read More »

How to Find Days modified in Linux

If you need to find files that were modified after a certain amount of days, the following command will do so: find ./ -mtime -7 -print Where -7 means the file has been modified in the last 7 days and ./ is the current directory.  This is useful for finding what files were changed recently… Read More »

Re-sizing a LVM Linux Partition

First, make sure you have either extended your virtual disk using HyperV or VMWare ESX interfaces.  This can be done a number of ways either by expanding in existing disk or adding in a secondary disk.  Since we are using the Logical Volume Manager (LVM) we can still make it appear as one volume.  Next,… Read More »

Lock down web site directory in Apache

First, make sure you Virtual Host container with your site configuration has the following section: <Directory “/var/www/path/to/your/website/html”> allow from all Options -Indexes AllowOverride All </Directory> This will you to create .htaccess files to have directory level control over certain sections of your site.  Next, we need to create the .htaccess file.  Go to your web… Read More »

Apache – Javascript and Image Caching

If you use the mod status module and you find that javascript and images are killing your Apache performance and using a lot of resources but you can not afford CDN services, here is a solution.  First, confirm you have the mod_expires module installed in Apache.  Searching the module under /etc/httpd/conf/httpd.conf will show you if… Read More »

MySQL Tuner Script for Windows

This is a port of the MySQL tuner script for use on Windows Servers.  Download this .exe and run it.  Don’t worry, you can trust meh 😉 MySQLTuner-0.6

How to lock down Coldfusion Securely

As of late, Adobe and Java have been getting pummeled with 0 day exploits leading to numerous hacks and compromised servers.  In light of this Adobe has taken the position that if you get hacked and did not follow the 60+ page guide it’s your own fault.  Well, if you’re interested in keeping CF Secure,… Read More »

The MySQL Tuner Perl Script!

#!/usr/bin/perl -w # – Version 1.2.0 # High Performance MySQL Tuning Script # Copyright (C) 2006-2011 Major Hayden – [email protected] # # For the latest updates, please visit # Git repository available at # # This program is free software: you can redistribute it and/or modify # it under the terms of… Read More »

Apache rewrite rules

To rewrite a to use this rule in the VHost config: RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.*) RewriteRule ^(.*)$ https://%1/$1 [R=301,L] Also for a simple redirect from http to https you can do the following: Redirect permanent / As I come up with good rewrite rules, I will add them here!