2010-01-11

abyss webserver (abyssws) -- RH Linux integration

abyss webserver by Aprelium
A nice commercial web server. 
The only free (as in money) web server that has great user and group account control (when I searched about 2 years ago).
Stable, simple, seems to work well.

Here are the pre-setup steps for integrating this into a Red Hat-type Linux setup (I'm using CentOS 5.1)
if you want a safe read-only http-based file server with user and group password permissions.


Specifically,
  • integrate with init.d service interface (the command line script service, common to Red Hat distro's)
  • use new isolated user for abyss process security
Shell Steps
    1. # unloading package
      cd /tmp

      wget http://www.aprelium.com/data/abwsx1.tgz


      tar -xvcf abwsx1.tgz


      mkdir /var/www-abyssws


      mv abyssws /var/www-abyssws

    2. # system interaction
      useradd -c "a user for the abyssws webserver" -d /var/www-abyssws/ -M -r -s /sbin/nologin user_abyssws

      chown -R user_abyssws /var/www-abyssws/
    3. # service interaction
      echo '\# if you need to start other stuff before abyss, then do that here
      sudo -u user_abyssws /var/www-abyssws/abyssws &' > /root/bin/abyss-start.sh

      chmod 755 /root/bin/abyss-start.sh


      touch /etc/init.d/rc.d/abyssws

      # copy the following grayed text to the just touched file /etc/init.d/rc.d/abyssws
      #!/bin/sh
      #
      # abyssws
      #
      # chkconfig: - 85 15
      # description: abyss ws
      #
      # processname: abyssws

      ### BEGIN INIT INFO
      # Provides: abyssws
      # Required-Start: $local_fs $network
      # Required-Stop: $local_fs $network
      # Short-Description: start and stop abyss web server
      ### END INIT INFO

      # Source function library
      . /etc/rc.d/init.d/functions

      progname=abyssws
      abysswsprog="/var/www-abyssws/abyssws"
      abysswsstart="/root/bin/abyss-start.sh"
      RETVAL=0

      start() {
      echo -n $"Starting $progname: "
      $abysswsstart
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$progname
      return $RETVAL
      }

      stop() {
      echo -n $"Stopping $progname: "
      $abysswsprog --stop
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$progname
      return $RETVAL
      }

      reload() {
      echo -n $"Reloading $progname: "
      $abysswsprog --restart
      RETVAL=$?
      echo
      return $RETVAL
      }

      case "$1" in
      start)
      start
      ;;
      stop)
      stop
      ;;
      restart)
      stop
      start
      ;;
      condrestart)
      if [ -f /var/lock/subsys/$progname ]; then
      stop
      start
      fi
      ;;
      reload)
      reload
      ;;
      status)
      status $progname
      RETVAL=$?
      ;;
      *)
      echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
      RETVAL=1
      esac

      exit $RETVAL
    4. ln -s /etc/rc.d/init.d/abyssws /etc/rc0.d/K15abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc1.d/K15abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc2.d/K15abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc3.d/S85abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc4.d/K15abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc5.d/S85abyssws
      ln -s /etc/rc.d/init.d/abyssws /etc/rc6.d/K15abyssws
       
    Now you're done with the Linux integration.

    Other things to do:
    1. # this many not work, since no file /var/www-abyssws/abyss.conf exists
      start-abyss.sh
    2. with a browser go to
         http://hostname:9999
      complete the web-based setup
    3. # now you can use the service interface
      service abyssws restart

    Other things to consider:
    • Directories for access with abyssws should have read and execute priviledge for user user_abyss
      For me, this means adding user_abyss to my web_friends group.
      This means using the command
       chmod g+rx $directory_for_abyss
    • This exact sequence of instructions was not tested. You get the idea.

    No comments: