Posts

Showing posts from May, 2012

Redirect apache request to another domain

if you have example portal.tenerife.com portal.mazaredo.com portal.antolines.com and you want to redirect it to www.mazaredo.com in httpd.conf put this line RewriteEngine on RewriteCond %{HTTP_HOST} !^portal\.!^\.com$ [NC] RewriteRule ^(.*)$ http://www.mazaredo.com/$1 [R=301,L] As you can see the the url has 3 parts    portal, domain, com  !^portal\.!^\.com$ first part is !^portal\     you can also remove portal so any .com request going to your site will be redirected. second part is !^\ where it is like * anything. last part is .com$

Xen Hvm Multi Home Different Subnet, Guest Multi Home Different Subnet Crap!

Setup: Centos 5.8 HVM Xen (Use Default Installation) My ethernets are eth1 and eth2 since somethings wrong with eth0 so change eth numbers to your needs 1. Edit Xen Config : xend-config.sxp edit the network script to (network-script network-xen-multi-bridge) 2. Copy network-bridge to network-bridge.xen in scripts folder ---- network-xen-multi-bridge script---- #!/bin/sh # network-xen-multi-bridge # Exit if anything goes wrong. set -e # First arg is the operation. OP=$1 shift script=/etc/xen/scripts/network-bridge.xen case ${OP} in start)         $script start vifnum=1 bridge=xenbr1 netdev=eth1         $script start vifnum=2 bridge=xenbr2 netdev=eth2         ;; stop)         $script stop vifnum=1 bridge=xenbr1 netdev=eth1         $script stop vifnum=2 bridge=xenbr2 netdev=eth2         ;; status)         $script status vifnum=1 bridge=xenbr1 netdev=eth1         $script status vifnum=2 bridge=xenbr2 netdev=eth2         ;; *)         echo 'Unknown c