Monday, December 20, 2010

VMWare ESXi error - Server could not interpret client request (fixed!)

My VMware Infrastructure client simply refused to connect to my ESXi server today. The error:
"Error - Server could not interpret client request".

Very uninformative.

Took a while to figure it out, VMWare's site was not too helpful.

Here is how to re-establish connectivity with your server.

1. Log on to the ESXi physical server directly (if its in a different building, put on your walking shoes)
2. Navigate to the Option: Restart Management Agents
3. Restart the management agent (F11 to confirm)
4. Log in using the VMWare Infrastructure Client

Connectivity should now be established.


-n

Thursday, October 14, 2010

Flat out

Procrastination: Something about some shit I'm gonna do tomorrow.

Thursday, September 2, 2010

Installing Rkhunter on CentOS 5.x

Rkhunter is a rootkit scanning tool for Linux/Unix type environments. If you are running a Linux based webserver, it is a good idea to install and configure this to run perhaps nightly.


0. Login as root or su (whatever floats your boat)

1. Install the RPMForge repo if not already installed.


This example is for a 32 bit system, there is a different rpm for 64 bit.
cd /temp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rm rpmforge-release-0.3.6-1.el5.rf.i386.rpm


2. Install rkhunter
yum install rkhunter -y

3. Perform Initial scan
rkhunter --propupd
rkhunter -c


Now it is recommended to execute this daily, especially for a high traffic server. Shell Script!

4. Create shell script
cd /your/script/directory
touch rkhunter.sh
chmod +x rkhunter.sh
nano rkhunter.sh


add lines

rkhunter --update
sleep 60
rkhunter --checkall --cronjob --skip-keypress

cat /var/log/rkhunter.log | mail -s "Daily rkhunter scan report" youremail@yourdomain.com

5. Add script to crontab
nano /etc/crontab
add line like:
#This will be executed at 1:00 am daily.

00 1 * * * root /bin/sh /your/script/directory/rkhunter.sh


done!

-n

Thursday, August 19, 2010

Show passwords on Browser page

This handy piece of javascript was written by:
http://www.raymond.cc/blog/archives/2007/07/13/easily-show-the-contents-of-password-fields/


Copy and paste this into your Browser's Address bar (only works on a page where password is saved and hidden)




Definitely works on IE and Firefox.


Cheers (with props to the original author),
-n

Setting up an NFS Share on CentOS 5.x

This outlines on how to setup a NFS Client/Server architecture.Used by myself for Moodle to access Datafiles, as I employ multiple webservers.

0. Package Installation

Login as root and install the following packages on NFS Client(s) and NFS Server
yum install nfs-utils nfs4-acl-tools portmap
chkconfig nfs on
chkconfig portmap on
service nfs start
service portmap start

1. Prep NFS Server
export share
nano /etc/exports
add lines like:
/mount/folder 192.168.0.0/255.255.0.0(rw) 10.0.0.0/255.0.0.0(rw)

allow clients to be able to connect.
nano /etc/hosts.allow
add lines like:
portmap: 192.168.0.0/255.255.0.0
add clients to hosts file
nano /etc/hosts
make sure all relevant hosts are listed in the format:
192.168.x.x server1.domain.com.local server1

restart the nfs and portmap service
service nfs restart
service portmap restart
2. Prep the NFS Client(s)
Repeat this step on each NFS client.
Edit the fstab
nano /etc/fstab

adding line:
server.ip.address:/mount/folder /mnt nfs rw,hard,intr 0 0
Mount the share
mount nfshostname:/mount/folder /mnt

restart services
service netfs restart
chkconfig netfs on

3. Test NFS

Create a file from one client, and it should be automatically available on the other clients.
From Client1
echo "This is an NFS Test" > /mnt/file.txt

Cheers,
-n

Tuesday, August 3, 2010

Sending mail from command line or shell script

How to send mail from the Linux Command line (or shell script) using the mail command.

echo "This is the body of the email" | mail -s "Email Subject" recipient@domain.com -- -f senderaddress@domain.com


The -- -f section is used to plug in a sender address, otherwise the mail will be sent from your root or user account from the actual physical server name - e.g root@server1.domain.com


This comes in handy for notification of script execution, for example, jobs in the crontab. Placing this code immediately after the last command in a shell script will ensure relevant person(s) are notified when the script is called.

-n

Friday, July 30, 2010

Load Balancing - Never a dull moment

Currently doing some research into implementing an updated version of session aware loadbalancing for a specialized Moodle installation.

The solution I inherited with the system was Ultramonkey in a High Availability setup, but I figure I'm gonna throw in some dedicated loadbalancing in the new equation.

Updates to follow soon, as well as some more scripting!