Installing Berylium

The Berylium codebase is meant to be installed once in /usr/local and shared by virtual servers on the same machine. It has yet to be scaled to a cluster of servers, but there's no reason it couldn't with some minor modification.

As of this writing, Berylium will not work on Win32. If you are interested in porting it, I'll be happy to help, but it relies pretty heavily on some Unix-only PHP features. You'd be better off finding an old Pentium-II and installing FreeBSD, it's fun to have a dedicated server. (My Celeron 400 works fine.)

You probably need to be root to install Berylium. If not root, then you should belong to the same group as the webserver, and you will need to have root patch httpd.conf for you.

Step-By-Step

  1. Check requirements
  2. Download the latest source tarball to /tmp
    cd /tmp
    wget http://berylium.org/source/be2-2003-08-05.tar.gz
  3. Unpack the source in /usr/local
    cd /usr/local
    tar xzvf /tmp/be2-2003-08-05.tar.gz
    cd berylium2/
  4. Create MySQL database and users
    mysql -u root -p
    CREATE DATABASE beryliumdb;
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON beryliumdb.* TO berylium@localhost IDENTIFIED BY '<administrative passphrase>' ;
    GRANT SELECT, INSERT, UPDATE ON beryliumdb.* TO beryliumweb@localhost IDENTIFIED BY '<webserver passphrase>' ;
    FLUSH PRIVILEGES;
    exit;
  5. Prepare and run install.php
    chmod 700 install.php
    ./install.php
  6. Add Apache directives to httpd.conf, then restart Apache
    cat apache.txt >> /usr/local/apache/conf/httpd.conf
    apachectl restart
  7. Look at code/berylium.conf and edit if necessary
  8. Check for working server: http://yoursite/be2
  9. Run addsite.php to initialize your site
  10. Go play with it.

Random Notes

As of this writing, Berylium is benchmarking at about 0.44 seconds per request on a 400MHz Celeron. There are two things that will improve this dramatically: a PHP cache, and using the built-in FTP publishing settings. A PHP cache will cut script execution time by saving pre-compiled bytecode instead of recompiling on every request. And FTP publishing allows Apache to serve your pages as plain old HTML files, which as we all know is blazingly fast.

The files/ tree is where Berylium stores all attachments (like images). The cache/ tree is where Berylium stores converted files made from attachments (like thumbnails of images). Both of these directories are orgainized by year and month to make it easy to add new storage in the future.

It is possible, desireable even, to use Apache's mod_rewrite to mix dynamic (Berylium) content and static content on the same site. (Documentation TBA)

The files/ tree can also hold per-site contexts and policies. If you need to modify an existing context or policy file, it's best to leave the default installation alone so that upgrades don't overwrite your modifications. (Documentation TBA)