Kroko Just another WordPress weblog

May 3, 2010

Install Xenserver Hetzner for DS 5000 Guest Networking Enabled

Filed under: Uncategorized — admin @ 3:13 pm

I have tested XensServer and i am very impress with it performance, compare to Vmware Esxi or Server. even with Openvz (only Linux)

It takes me awhile until i am able to get it working on my dedicated server in Hetzner which has Diffrent IP addressing
First of all we would need :
– A webserver apart from the Dedicated server that we want to install XenServer.
– XenServer-5.5.0-Update2-install-cd.iso
– Fresh Install Centos Installed on Hetzner. ( this can be done on rescue mode Linux 32bit) and login to your server and execute “installimage” then follow all the wizard which kinda straight forward.
Ok here we are.
1. Download XenServer-5.5.0-Update2-install-cd.iso on your other webserver apart from hetzener we would use this server as source installation.
2. mount this iso with this command
# mount -o loop FREE_XenServer-5.5.0-install-cd.iso /mnt
# mkdir /var/www/xenserver
# cp -a /mnt/* /var/www/xenserver

3. Create file called xenserver.xml in /var/www/xenserver with this content below according to your needs.
<installation mode=”fresh” srtype=”lvm”>
<bootloader>grub</bootloader>
<primary-disk gueststorage=”yes”>sda</primary-disk>
<keymap>us</keymap>
<hostname>xen</hostname>
<root-password>my_password</root-password>
<source type =”url”>http://your_webserverip/xenserver</source>
<!– No Post install scripts configured –>
<admin-interface name=”eth0″ proto=”static”>
<ip>xxx.xxx.xxx.xxx</ip>
<subnet-mask>255.255.255.192</subnet-mask>
<gateway>xxx.xxx.xxx.xxx</gateway>
</admin-interface>
<nameserver>213.133.99.99</nameserver>
<nameserver>213.133.100.100</nameserver>
<timezone>Europe/Berlin</timezone>
<time-config-method>ntp</time-config-method>
<ntp-servers>ntp</ntp-servers>
<ntpservers>83.246.120.75</ntpservers>
<ntpservers>213.9.73.106</ntpservers>
<ntpservers>188.40.34.195</ntpservers>
</installation>
Attention: You must fill with your own IP and Gateway from Hetzener.
4. Login to your Dedicated server which we want to install XenServer and copy these 3 files from the iso files you have mounted and copy to your webserver public directory
#cd /boot
#wget http://your_webserverip/xenserver/boot/vmlinuz
#wget http://your_webserverip/xenserver/boot/xen.gz
#wget http://your_webserverip/install.img

5. Once they are downloaded to your Centos edit your /boot/grub/menu.1st
# Hetzner Online AG – installimage
# GRUB bootloader configuration file
#
timeout 5
default 1
title CentOS Linux (2.6.18-128.1.16.el5)
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-128.1.16.el5 ro root=/dev/md2 vga=0×317
initrd /boot/initrd-2.6.18-128.1.16.el5.img
title Install Xenserver
root (hd0,1)
kernel /boot/xen.gz dom0_mem=752M acpi=off nosmp noapic noirqbalance
module /boot/vmlinuz answerfile=http://my_webserver_ip/xenserver/xenserver.xml install
module /boot/install.img

6. now reboot your Centos and start to check the installation log by logging to your webserver and check tail -f access_log
it might take some times depend on the connection between the two servers.
Once installation has been completed login to your fresh new Xenserver.. and start to configure the networking….
7. Makse sure your /etc/sysctl.conf has this :
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
# Controls proxy arp
net.ipv4.conf.default.proxy_arp = 1
# Turn off redirects
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.lo.send_redirects = 0
net.ipv4.conf.xenbr0.send_redirects = 0
and validated with ’systcl -p’
# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.lo.send_redirects = 0
net.ipv4.conf.xenbr0.send_redirects = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
vm.dirty_ratio = 5
kernel.printk = 4 4 1 4

8. Disable SeLinux with
# system-config-securitylevel-tui
9. add your additional subnetwork to your xenserver
# ip addr add 78.47.193.23/29 dev xenbr0
10. shutdown the iptables
# service iptables stop
11. Create Dummy interface as we would use this as gateway for all Guest machine (Linux or Windows)
let say you have this Ip subnet from Hetzner 78.47.125.24 until 78.47.125.31.
Network: 78.47.125.24/29
Broadcast: 78.47.125.31
HostMin: 78.47.125.25 (this one we would use as gatway for our guesthost)
HostMax: 78.47.125.30
# nano /etc/sysconfig/network-scripts/ifcfg-xenbr0:1
XEMANAGED=yes
DEVICE=xenbr0:1
ONBOOT=yes
BOOTPROTO=none
NETMASK=255.255.255.248
IPADDR=78.47.193.23

12. bring our xenguest gateway ip up
#ifup xenbr0:1
13. now you can use this range 78.47.125.26 until 78.47.125.30
NETMASK = 255.255.255.248
GATEWAY = 78.47.125.25
NAMESERVER = 213.133.99.99 213.133.100.100
Good luck
Thanks to : Jonathan Thorpe
http://forums.citrix.com/profile.jspa?userID=8895058
and
http://www.simsonlai.org/install-xenserver-hetzner-for-ds-5000-guest-networking-enabled/

March 17, 2010

Iphone advanced call forward

Filed under: Uncategorized — admin @ 2:29 am

iPhone is considered as a revolutionary mobile phone. May be it’s too revolutionary that it lacks some very basic features. Some iPhone users(including my wife) complain about the absence of conditional call forwarding feature (which can be found in most mobile phones):

  • Call forward if busy – Forward incoming call to another number if you’re on call
  • Call forward if not answered – Forward the incoming call to another number if it is not answered for a predefined period of time
  • Call forward if not reachable – Forward incoming call to another number if the phone is off or without signal

Iphone allows you to setup basic call forwarding to direct all calls to another phone number. However, it doesn’t provide any interface to setup “Call forward if busy” and other conditional call forwarding.

Despite the lack of user interface on iPhone to activate conditional forwarding, you can use the so-called “Call Forwarding Code” to activate it. Here are the tricks:

[ad#ad-1]

Activate Call Forwarding

To setup “Call forward if busy”, simply dial *67*[another phone number]# and tap “Call”

on the iPhone “Busy”  = forwards to the desired number when tapping the “ignore button” ( when receiving a call it will give you an option to answer it or ignore it) I have this set to go to my business partners cell phone when I tap ignore.

To setup “Call forward if not answered”, simply dial *61*[another phone number]# and tap “Call”

on the iPhone  “No answer”  = forwards to the desired number when you let your phone ring without answering it. I set “No answer” with my Voice mail Number… it would be the default number. However, when receiving a call, you can mute the ring by tapping the volume button once if you don’t want to listen to the ringer but want it to forward to the desired number. ( it will still go to the desired number, in this case my voicemail)

To setup “Call forward if unreachable/Unavailable”, simply dial *62*[another phone number]# and tap “Call”

on the iPhone  “Unavailable”  = forwards to the desired number when iPhone is turned off or iPhone is out of the coverage area and/or you can manually tell your iPhone you are unavailable by simply Pressing the Sleep/Wake button twice (2x) I have this set to go to my office so I don’t ever lose a call when I am not able to answer the call like when I am with a customer….

Deactivate Call Forwarding

To deactivate “Call forward if busy”, simply dial #67# and tap “Call”

To deactivate “Call forward if not answered”, simply dial #61# and tap “Call”

To deactivate “Call forward if not reachable”, simply dial #62# and tap “Call”

You do not need to remember all these codes. Say, you usually use “Call Forward if busy”, save the number as a new contact. Next time, when you need to activate call forwarding, just look up that contact and dial the number.

Note: The above codes should work with most GSM . If it doesn’t work, please further check with your carrier.

[ad#ad-1]

January 10, 2010

Install Phusion Passenger (mod_rails) on cPanel Server

Filed under: Uncategorized — admin @ 1:49 am

Although cPanel has built in support for running Ruby or Rails apps, it uses Mongrel as the server and doesn’t allow more than one instance per user. That makes it pretty useless for any application that gets even a moderate amount of traffic. Instead we can install Phusion Passenger (a.k.a mod_rails), which in my opinion is a much nicer solution anyway.

First we need to make sure Ruby is installed via a cpanel script:

sudo /scripts/installruby

Now we can install the passenger gem:

sudo gem install passenger

Next, compile the apache2 module

sudo passenger-install-apache2-module

The installer may tell you that the the Apache development headers are needed and will suggest ‘yum install httpd-devel’. Since cPanel compiles it’s own version of apache, yum is configured to ignore that package. That is OK, because the program we need is already installed, we just have to tell Passenger where to find it.

APXS2=/usr/local/apache/bin/apxs PATH=$PATH:/usr/local/apache/bin passenger-install-apache2-module

Everything should go OK this time, and the installer will give you a few lines to add to your apache config file. It’s best practice with cPanel not to put these in your main httpd.conf, but rather the pre_main_global.conf:

vi /usr/local/apache/conf/includes/pre_main_global.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-X.X.X/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-X.X.X
PassengerRuby /usr/bin/ruby
[ad#ad-1]

Now we need to setup passenger to run on a per virtual host basis. Open up the httpd.conf file and find the virtual host you want to run a Rails app and add this line:

Include “/usr/local/apache/conf/userdata/std/2/username/domain_name/*.conf”

Replace username with the username of the account.

Now we need to create the directory we just specified, and also create a configuration file letting passenger know it should load for this host:

mkdir -p /usr/local/apache/conf/userdata/std/2/username/domain_name/ vi /usr/local/apache/conf/userdata/std/2/username/domain_name/rails.conf

PassengerAppRoot /home/username/railsapp

RailsBaseURI /

To make sure those files load, run this:

/scripts/ensure_vhost_includes –user=username

We need to make sure cPanel records the changes we have for when it rebuilds those files, so run the following two commands:

/usr/local/cpanel/bin/apache_conf_distiller –update /usr/local/cpanel/bin/build_apache_conf

We can now restart apache:

/etc/init.d/httpd restart

Since by default the Apache Document Root for each host is /home/username/public_html, you will probably need to symlink that to your applications public directory:

ln -s /home/username/railsapp/public /home/username/public_html

To restart that application, you just need to touch the restart.txt file:

touch /home/username/railsapp/tmp/restart.txt

And there you have it, a working high performance rail application server on cPanel! For more information on tuning the Passenger configuration, read the complete docs.

PS:

I just modified few lines from this article after i installed passenger on my cpanel server.

original source of this article is: http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/
« Newer PostsOlder Posts »

Powered by WordPress