Installing VHCS on CentOS 4.4

I found an installation guide of VHCS on CentOS 4.x in its wiki. It looks a bit complicate but not too bad for me. So I suggested my friend to give it a try. He installed CentOS 4.4 as usual and then I have to install further packages to meet the requirements of VHCS. This is a long, long story. In fact, VHCS doesn't support CentOS exactly. The only distributions supported by VHCS are just Debian-based and SUSE. That's why I have to make it work myself.

In order to install VHCS on CentOS 4.4, you have to follow above document until you have all requirements installed but VHCS itself and then follow below procedures.

  1. Edit Makefile by changing HOST_OS to centos

    HOST_OS=centos
    
  2. Edit configs/Makefile to know about centos

    diff -ruN vhcs2-2.4.7.1.orig/configs/Makefile vhcs2-2.4.7.1/configs/Makefile
    --- vhcs2-2.4.7.1.orig/configs/Makefile 2005-12-31 18:13:02.000000000 +0700
    +++ vhcs2-2.4.7.1/configs/Makefile      2006-09-26 21:40:21.000000000 +0700
    @@ -16,6 +16,8 @@
                    cd ./logrotate && $(MAKE) install ; cd .. ; \
            elif $(HOST_OS) == suse ; then \
                    cd ./dists/suse && $(MAKE) install ; \
    +       elif $(HOST_OS) == centos ; then \
    +               cd ./dists/centos && $(MAKE) install ; \
            fi
    
     #      elif $(HOST_OS) == redhat ; then \
    @@ -37,6 +39,8 @@
                    cd ./logrotate && $(MAKE) uninstall ; cd .. ; \
            elif $(HOST_OS) == suse ; then \
                    cd ./dists/suse && $(MAKE) uninstall ; \
    +       elif $(HOST_OS) == centos ; then \
    +               cd ./dists/centos && $(MAKE) uninstall ; \
            fi
    
     #      elif $(HOST_OS) == redhat ; then \
    
  3. Then copy file from suse to centos as a template.

    cd configs/dists
    cp -Rp suse centos
    
  4. Edit Makefile and vhcs2.conf in configs/dists/centos

  5. Edit Makefile, httpd.conf, parts/vhcs2_base.tpl and working/vhcs2.conf in configs/dists/centos/apache

  6. Edit main.cf in configs/dists/centos/postfix/main.cf to make sure setgid_group is postdrop

    setgid_group = postdrop
    
  7. Make sure that all paths in configs are correctly set

  8. Edit vhcs2_daemon in configs/dists/centos/init.d as follow.

    #! /bin/sh
    #
    # skeleton      example file to build /etc/init.d/ scripts.
    #               This file should be used to construct scripts for /etc/init.d.
    #
    #               Written by Miquel van Smoorenburg <>.
    #               Modified for Debian GNU/Linux
    #               by Ian Murdock <>.
    #               Modified for SuSE
    #               by Carsten Schoene <>
    #
    # Version:      @(#)skeleton  1.8  03-Mar-1998  
    #
    # This file was automatically customized by dh-make on Mon, 22 Apr 2002 16:15:28 +0300
    ### BEGIN INIT INFO
    # Provides: vhcs2_daemon
    # Required-Start: $network $remote_fs
    # Required-Stop: $network $remote_fs
    # Default-Start: 3 5
    # Default-Stop: 0 1 2 6
    # Description: Start the vhcs2_daemon
    ### END INIT INFO
    
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/var/www/vhcs2/daemon/vhcs2_daemon
    PID=/var/run/vhcs2-daemon.pid
    NAME=vhcs2_daemon
    DESC=vhcs2_daemon
    
    test -x $DAEMON || exit 5
    
    #. /etc/rc.status
    . /etc/rc.d/init.d/functions
    
    # Shell functions sourced from /etc/rc.status:
    #      rc_check         check and set local and overall rc status
    #      rc_status        check and set local and overall rc status
    #      rc_status -v     ditto but be verbose in local rc status
    #      rc_status -v -r  ditto and clear the local rc status
    #      rc_failed        set local and overall rc status to failed
    #      rc_reset         clear local rc status (overall remains)
    #      rc_exit          exit appropriate to overall rc status
    
    # First reset status of this service
    #rc_reset
    
    case "$1" in
      start)
            echo -n "Starting $DESC: "
            daemon --check $NAME $DAEMON
            RETVAL=$?
            if [ $RETVAL -eq 0 ]; then
                success
            else
                failure
            fi;
            echo
            /etc/init.d/vhcs2_network
            ;;
      stop)
            echo -n "Stopping $DESC: "
            killproc $NAME
            RETVAL=$?
            if [ $RETVAL -eq 0 ]; then
                success
            else
                failure
            fi;
            echo
            ;;
      restart|force-reload)
            echo "Restarting $DESC: "
            $0 stop
            $0 start
            ;;
      status)
            echo "Checking for service $DESC: "
            status $DAEMON
            echo
            ;;
      *)
            echo "Usage: $0 {start|stop|restart|force-reload|status}"
            exit 1
            ;;
    esac
    
    #rc_exit
    
  9. Then run make install and vhcs2-setup as usual

Then you have to restart all services again.

for i in httpd named courier postfix proftpd vhcs2_daemon; do \
    chkconfig $i on; \
    service $i restart; \
done

All done.

Tags: , , ,

Did you forget to place a

Did you forget to place a step for editing the other Makefiles in the centos tree or is it not needed?

that's all

That's all I did and used for several months.

hrm... No no extra

hrm... No no extra whitespaces... here's exactly what i have in there... ----------------------------------------------------------------- export install: if [[ $(HOST_OS) == debian ]] ; then \ cp ./vhcs2.conf $(SYSTEM_CONF) ; \ cd ./apache && $(MAKE) install ; cd .. ; \ cd ./bind && $(MAKE) install ; cd .. ; \ cd ./crontab && $(MAKE) install ; cd .. ; \ cd ./database && $(MAKE) install ; cd .. ; \ cd ./init.d && $(MAKE) install ; cd .. ; \ cd ./postfix && $(MAKE) install ; cd .. ; \ cd ./courier && $(MAKE) install ; cd .. ; \ cd ./proftpd && $(MAKE) install ; cd .. ; \ cd ./logrotate && $(MAKE) install ; cd .. ; \ elif [[ $(HOST_OS) == suse ]] ; then \ cd ./dists/suse && $(MAKE) install ; \ elif $(HOST_OS) == [[ centos ]] ; then \ cd ./dists/centos && $(MAKE) install ; \ fi # elif [[ $(HOST_OS) == redhat ]] ; then \ # cd ./dists/redhat && $(MAKE) install ; \ # fi uninstall: if [[ $(HOST_OS) == debian ]] ; then \ rm -rf $(SYSTEM_CONF)/vhcs2.conf ; \ cd ./apache && $(MAKE) uninstall ; cd .. ; \ cd ./bind && $(MAKE) uninstall ; cd .. ; \ cd ./crontab && $(MAKE) uninstall ; cd .. ; \ cd ./database && $(MAKE) uninstall ; cd .. ; \ cd ./init.d && $(MAKE) uninstall ; cd .. ; \ cd ./postfix && $(MAKE) uninstall ; cd .. ; \ cd ./courier && $(MAKE) uninstall ; cd .. ; \ cd ./proftpd && $(MAKE) uninstall ; cd .. ; \ cd ./logrotate && $(MAKE) uninstall ; cd .. ; \ elif [[ $(HOST_OS) == suse ]] ; then \ cd ./dists/suse && $(MAKE) uninstall ; \ elif [[ $(HOST_OS) == centos ]] ; then \ cd ./dists/centos && $(MAKE) uninstall ; \ fi # elif [[ $(HOST_OS) == redhat ]] ; then \ # cd ./dists/redhat && $(MAKE) uninstall ; \ # fi --------------------------------------------

lol... after copying what i

lol... after copying what i just put and pasting it, i get " missing seperator... Evidently the indentation of the code was the syntax error... now to fix the missing seperator... what ever that is...

fixed it.. eroneous

fixed it.. eroneous keystroke in there by accident on line 1.. wierd.. THanx alot for this howto guide, is a lifesaver :) THe final Makefile was: --------Begin------- export install: if [[ $(HOST_OS) == debian ]] ; then \ cp ./vhcs2.conf $(SYSTEM_CONF) ; \ cd ./apache && $(MAKE) install ; cd .. ; \ cd ./bind && $(MAKE) install ; cd .. ; \ cd ./crontab && $(MAKE) install ; cd .. ; \ cd ./database && $(MAKE) install ; cd .. ; \ cd ./init.d && $(MAKE) install ; cd .. ; \ cd ./postfix && $(MAKE) install ; cd .. ; \ cd ./courier && $(MAKE) install ; cd .. ; \ cd ./proftpd && $(MAKE) install ; cd .. ; \ cd ./logrotate && $(MAKE) install ; cd .. ; \ elif [[ $(HOST_OS) == suse ]] ; then \ cd ./dists/suse && $(MAKE) install ; \ elif $(HOST_OS) == [[ centos ]] ; then \ cd ./dists/centos && $(MAKE) install ; \ fi # elif [[ $(HOST_OS) == redhat ]] ; then \ # cd ./dists/redhat && $(MAKE) install ; \ # fi uninstall: if [[ $(HOST_OS) == debian ]] ; then \ rm -rf $(SYSTEM_CONF)/vhcs2.conf ; \ cd ./apache && $(MAKE) uninstall ; cd .. ; \ cd ./bind && $(MAKE) uninstall ; cd .. ; \ cd ./crontab && $(MAKE) uninstall ; cd .. ; \ cd ./database && $(MAKE) uninstall ; cd .. ; \ cd ./init.d && $(MAKE) uninstall ; cd .. ; \ cd ./postfix && $(MAKE) uninstall ; cd .. ; \ cd ./courier && $(MAKE) uninstall ; cd .. ; \ cd ./proftpd && $(MAKE) uninstall ; cd .. ; \ cd ./logrotate && $(MAKE) uninstall ; cd .. ; \ elif [[ $(HOST_OS) == suse ]] ; then \ cd ./dists/suse && $(MAKE) uninstall ; \ elif [[ $(HOST_OS) == centos ]] ; then \ cd ./dists/centos && $(MAKE) uninstall ; \ fi # elif [[ $(HOST_OS) == redhat ]] ; then \ # cd ./dists/redhat && $(MAKE) uninstall ; \ # fi ---------END-------- hope that's helpful to anyone else :)

Post new comment