transparent squid proxy error
Posted: October 19, 2012 Filed under: System Administration Leave a comment »I had setup squid as a transparent proxy. After setting up, still client was not able to access the web page. There was error message logged in by squid server in /var/log/squid3/access.log
The error message was
NONE/400 3505 GET / – NONE/- text/html
Solution :
#vi /etc/squid3/squid.conf
put the word “transparent so the line should look like below
http_port 172.16.26.1:3128 transparent
then /etc/init.d/squid3 restart
Every thing is hunky-dory
Have Fun
Recovering or troubleshooting GRUB2 prompt in Debian GNU/Linux
Posted: September 7, 2012 Filed under: System Administration Leave a comment »Due to some reason, I was in need to replace existing HDD with new one. So I cloned it using CloneZilla. It was a GNU/Linux Machine. First of all CloneZilla refuses copy partitions, one after another and flagged error for each of one. I remembered the reason for errors and turned off the machine. Turned on again and SHUTDOWN properly. The point is, if Machine is not shutdown properly, file system is unclean and ColneZilla will complaint while cloning. So I fixed that first. Then cloned without any error. But Computer refuses to boot from newly cloned HDD. It stayed at grub> prompt
Then I did the following to troubleshoot
Step1. grub> set root=(hd0,1) # / (root) partition was /dev/sda1
Step2. grub> linux /vmlinuz root=/dev/sda ro
step 3 grub> initrd /initrd.img
step3. grub>boot
Machines rebooted
on the command prompt as a root
#grub-install /dev/sda
Rebooted again. Its done.
Reference: https://help.ubuntu.com/community/Grub2/Troubleshooting
Iptables rules to limit time & quota based access
Posted: May 21, 2012 Filed under: System Administration Leave a comment »Here are the rules i have add to my GNU/Linux Firewall to limit time and quota for my kids for internet and Xbox live
To limit Quota ( I have just allotted 2GB will increase later on)
iptables -I FORWARD 5 -s 172.16.0.33 -p tcp -m quota –quota 2147483648 -j ACCEPT
iptables -I FORWARD 6 -s 172.16.0.33 -j DROP
For quota ofcourse i have to reset the quota again. I will try to automate it some how
To limit time
iptables -I FORWARD 7 -s 172.16.0.33 -p tcp -m multiport –dport http,https -o eth0 -i eth1 -m time –timestart 16:00 –timestop 18:00 –weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j ACCEPT
Reference: http://linuxgazette.net/108/odonovan.html
(Above said link had a little typo in time based rule is –days instead of –weekdays
Debian GNU/Linux Nagios3 Bug
Posted: March 2, 2012 Filed under: System Administration Leave a comment »I had installed the Nagios3 form package. Installation was fine. I was getting the error message as shown in Screen shot
Even making changes for ACL’s in Apache conf result noting.
Google is always our friend.The link shown below explained about the bug.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626462
I have changed file as shown
Added the index.html in /etc/apache2/conf.d/nagios3.conf. So the line should be
DirectoryIndex index.php index.html
not
DirectoryIndex index.php
/etc/init.d/apache2 restart
Done!
Have Fun
Ucarp setup for Debian Squeeze
Posted: February 20, 2012 Filed under: System Administration 1 Comment »It was easy
Do the following on both Load Balancers ( I did it on Nginx LBs)
1. apt-get install ucarp
2. vi /etc/network/interfaces and append the lines starting from ucarp-vid 3
3. replace password and ip (192.168.69.11) with your own
4. Reboot
I have followed the link below. Tested it by shutting down both Load Balancers one by one.
Will dig more in to it. It is Awesome!.
Reference http://forsetti.wordpress.com/2011/09/10/ucarp-and-squeeze/
Have Fun
GNU/Linux Screen Utility
Posted: February 19, 2012 Filed under: System Administration Leave a comment »screen command refrence nice link
http://aperiodic.net/screen/quick_reference
Have FUN
Powering on the virtual machine fails with the error: The file specified is not a virtual disk
Posted: December 19, 2011 Filed under: System Administration | Tags: virtual machine, vmdk Leave a comment »It happens to when I have migrated the Virtual Machine from One network to another. I followed the procedure as mentioned in the link listed below
This issue occurs when the .vmdk descriptor file is corrupt or missing. I my case it was corrupt.
Follow the Resolution heading in above said link. The step by step procedure is given in the link below
In step 3 Instead of scsi1.virtualDev = “lsilogic”
My Virtual server show me scsi1.virtualDev = “lsilogic1068″
So the corresponding command ( vmkfstools -c 4294967296 -a lsilogic -d thin temp.vmdk ) does not work for me. But i had replaced the lsilogic1068 with lsilogic in command and it works fine. Rest is same and i followed step by step
It works awesome!
Have FUN!
Nginx as a Load Balancer
Posted: October 22, 2011 Filed under: System Administration Leave a comment »It is very basic setup of Nginx as a load balancer. I have two Apache servers (web1.meapay.com & web2.meapay.com). Ngnix will act as a load balancer in front of these two servers
I have done it on Debian squeeze. So first we have to install nginx package
#apt-get install nginx
Edit the nginx configuration file. Before editing, I have copied the original nginx conf file as default.orig
#cd /etc/nginx/sites-available/
#/etc/nginx/sites-available# cp default default.orig
#vi /etc/nginx/sites-available/default
upstream mysite {
server web1.meapay.com;
server web2.meapay.com;
}
server {
server_name http://www.meapay.com:80;
#listen [::]:80 default ipv6only=on; ## listen for ipv6
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://mysite;
proxy_set_header Host $host;
}
}
#/etc/init.d/nginx restart
Its done.
Have FUN
Reference:
http://mickeyben.com/blog/2009/12/30/using-nginx-as-a-load-balancer/
Mounting RAID array device in /etc/fstab in Debian GNU/Linux
Posted: October 18, 2011 Filed under: System Administration Leave a comment »May be helpful for you while mounting RAID array device in /etc/fstab
While making entry in /etc/fstab for newly created RAID device, we need either device name (/dev/md7) or UUID. I got the UUID using the command
#mdadm –detail /dev/md7
and made the entry in fstab. But it did not worked as per expectation
Searched Google about the problem as usual. I found that we have to use the UUID provided by the following command
#blkid /dev/md7
not by the command mdadm. Both UUID are different. It works. I have no idea why they are different. So please if you find please tell me as well.
Have FUN! again
Copy GPT Partitioning layout to other hard disk drive
Posted: October 18, 2011 Filed under: System Administration Leave a comment »To copy GPT Partition layout to many drives we need sgdisk. sfdisk cant do that.
As of Debian 6.0. Installer does not have sgdisk. So I had rebooted the machine from Gparted live cd. and ran the command given below.
Note that the /dev/sdb is destination drive and source is second device(/dev/sda) (exchange them at your own risk). It will copy partition layout from /dev/sda to /dev/sdb
#sgdisk -R=/dev/sdb /dev/sda
The command below is required coz the first command copy/assign the same GUID to new device. So to assign another random unique GUID run the following command
#sgdisk -G /dev/sdb
Have FUN!


