Archive for the ‘Linux’ Category

OpenVZ on CentOS 5.2

OpenVZ setup procedure followed – January 6th, 2009
host machine – 1.5ghz Pentium 4 (i386), 1GB ram, 40GB hard disk drive
host os – CentOS 5.2
for more detailed installation information see: http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

This installation of CentOS 5.2 is on a i386 machine, be sure to substitute in for a 64-bit machine if you have one. Following most/all of the instructions will give you an OpenVZ CentOS 5.2 host with browser-based administration of your VPS(es) with vtonf. This cookbook assumes running knowledge of how to edit configuration files via “vi”, using yum to install dependencies/software, and how to install via tarballs (.tar.gz).

  1. Install latest CentOS distro on physical server (at the time of writing this, it was 5.2)
    • minimal install only requires disc 1 – “CentOS-5.2-i386-bin-1of6.iso”
    • choose your mirror: http://isoredirect.centos.org/centos/5/isos/i386/
    • partition setup note: 5GB for root filesystem, 1.25X-2X size of RAM for swap, rest of space for /vz (the VPS nodes and OS templates)
    • During the category/task selection, deselect all package categories, and choose the “Customize now” option at the bottom of screen. During the customized package selection, deselect everything. This will allow for a “minimal” install with only disc 1.
  2. Configure static ipv4/ipv6 address(es) – /etc/sysconfig/network/
  3. Setup dns nameservers – /etc/resolv.conf
  4. Run an update: yum update
  5. Follow hotwo: http://www.howtoforge.com/installing-and-using-openvz-on-centos5.2
  6. Download VTONF – http://vtonf.com/downloads.html
  7. tar xzvf on the archive you just downloaded and cd into the created directory
  8. Follow on screen instructions to complete setup
  9. If you wanna go crazy with the customizations get into the “/etc/vtonf/” directory and check things out
  10. To allow connections to vtonf from IPv4/6 addresses other than through the localhost, modify the code block within “/etc/vtonf/vtonf.conf” so it looks like the below code block. Note the second line!

    fastcgi.server = ( ".php" =>
    ( "*" =>
    ( "socket" => "/tmp/vtonf.socket",
    "bin-path" => "/usr/local/vtonfphp/bin/php",
    "max-procs" => 1,
    "bin-environment" => (
    "PHP_FCGI_CHILDREN" => "4",
    "PHP_FCGI_MAX_REQUESTS" => "10000"
    ),
    )
    )
    )

  11. Remember to modify the OpenVZ host IPTABLES rules so that it allows traffic to the VPS nodes. I just turned mine off (service iptables stop; chkconfig iptables off), because I got an external firewall/router in my home LAN.

That’s it you are good to go to start reselling VPSes to clients!

OpenVZ on Debian Etch

OpenVZ setup procedure followed – January 5th, 2009
host machine – 1.5ghz, 1GB ram, 40GB hard disk drive
host os – Debian 4.0
kernel image – etchnhalf
for more detailed information see: http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf
for more information on symbolic linking see: http://www.ss64.com/bash/ln.html

These instructions are for setting up an OpenVZ system on Debian 4.0 (Etch) with browser-based administration via Webmin. I couldn’t get the OpenVZ plugin for Webmin working, but maybe you can. This cookbook assumes running knowledge of how to edit configuration files via “vi”, using apt-get to install dependencies/software, and how to install via tarballs (.tar.gz).

  1. Install latest Debian distro (Etch at the time of authoring) on your physical server. You can get the netinstall (what I used) here: http://www.debian.org/distrib/netinst. Partition setup note: 5-7GB for root filesystem, 1.25X-2X size of RAM for swap, rest of space for /var/lib/vz (for OpenVZ VPS nodes).
  2. Once installed, configure static ipv4/ipv6 address(es) on interfaces (/etc/network/interfaces) and nameservers in the /etc/resolv.conf file.
  3. Modify apt-get sources if incorrect and add line “deb http://download.openvz.org/debian-systs etch openvz”
  4. Run command to update apt-get with new openvz repository: wget -q http://download.openvz.org/debian-systs/dso_archiv_signing_key.asc -O- | apt-key add – && apt-get update
  5. apt-get install ssh (so we don’t have to sit in front of the server rack anymore)
  6. apt-get upgrade (update to the newest software versions)
  7. You might need to execute “shutdown -r now” if debian installed a new kernel and/or other critical operating system feature.
  8. Now we can get to the good stuff. It’s time to install the OpenVZ kernel: http://wiki.openvz.org/Installation_on_Debian#Kernel_installation
  9. After installing the OpenVZ kernel and rebooting into your new OpenVZ kernel based system (and making sure you have all the OpenVZ shiz running properly), we can now install some webmin dependancies: apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
  10. I suggest running the webmin minimal install – http://webmin.com/tgz.html
  11. install openvz webmin module – http://www.provider4u.de/openvz.tar.gz
  12. install various openvz os templates to /var/lib/vz/template/cache from: http://download.openvz.org/contrib/template/precreated/

subversion and warehouse

I had first heard about the Warehouse subversion browser a couple of months back. At the time it was still closed source and cost $30 per server license. Recently though, it went open source and is now freely available. For those of you with about 1-2 hours of time and know how to setup and run subversion on a Linux/Unix box (with WebDAV) it really isn’t that hard to get up and running.

I installed this on one of my home Debian Etch (4) servers and it took me about 30 minutes once I understood the entire process.

  1. Install some necessary dependencies for building (I prolly left out a few) – make, rake, unzip, zip, tar, gzip, bzip2, libc6, gcc, cpp, g++
  2. Install Ruby
    • download the latest tarball (source code in tar.gz) here – http://www.ruby-lang.org/en/downloads/wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
    • run – tar xzvf ruby*.tar.gz – to open up the archive
    • cd into the directory – cd ruby*
    • configure, make and then install –> 1) ./configure 2) make 3) make install (as root)
  3. Install Swig
    • download one of the latest tarballs – wget http://internap.dl.sourceforge.net/sourceforge/swig/swig-1.3.31.tar.gz
    • unarchive the archive – tar xzvf swig-1.3.31.tar.gz
    • get into the directory – cd swig-1.3.31
    • configure, make, then install –> 1) ./configure 2) make 3) make install (as root)
  4. Install Subversion and the Swig-Ruby bindings
    • download one of the latest subversion archives – wget http://subversion.tigris.org/downloads/subversion-1.5.5.tar.gz
    • unarchive that sucker – tar xzvf subversion*.tar.gz
    • get into the directory that was just created – cd subversion*
    • configure for installation (and if you are missing anything be sure to install it!) – ./configure –enable-shared –enable-static –enable-debug –with-ssl –with-swig
    • make and install –> 1) make 2) make install
    • now install the swig-ruby bindings –> 1) make swig-rb 2) make install-swig-rb
  5. Install various dependencies for later: apache2 with WebDAV support, ruby gems, MySQL server/client, PHPMyAdmin might be handy as well
  6. Download the Warehouse source code – http://github.com/entp/warehouse/tree/master
  7. Untar into where you want Warehouse to start from: tar xvzf, mv, and whatnot.
  8. Setup a 3 MySQL databases (warehouse_test, warehouse_production, warehouse_dev) that can be accessed by 1 user for testing, production and development.
  9. Now run the warehouse bootstrapping program and setup procedures. (No registration key needed now that it is open source, so leave that field blank.) – http://www.warehouseapp.com/installing/installing-and-registering-warehouse
  10. In the Warehouse settings, be sure to setup warehouse so that it updates your WebDAV permissions and passwords.
    • Shell command to run when permissions are updated. This will auto-generate the necessary permission file for WebDAV: rake warehouse:build_config CONFIG=[warehouse directory]/config/access.conf
    • Shell command to run when someone’s password is updated. This will auto-generate the necessary password file for WebDAV: rake warehouse:build_htpasswd CONFIG=[warehouse directory]/config/htpasswd.conf

Return top