HostMaster Easy One Page Install

You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!
Boris Mann's picture
public
Boris Mann - Fri, 2008-06-06 16:51

We try to document here the most current install process of hostmaster and current issues. Please share your steps on installing and setting up HostMaster and related dependencies (Apache, MySQL, cron, etc.).

Dedicated Server

See the Ubuntu/debian procedure below, it should be sufficient...

On your Mac Laptop

For download, feel free to substitute CVS checkout

  1. Download Drupal 5 into your root web server docroot (e.g. /Library/WebServer/Documents)
  2. Download the hostmaster install profile into the profiles folder, so that it is at /profiles/hostmaster
  3. Download required modules: views, drush, ...
  4. Create a new directory in the /sites folder with a name equivalent to your local machine -- this can be either 127.0.0.1, localhost, or your machine name (in my case, sleipnir.local) -- and copy over the settings.php file; NOTE: currently, the main hostmaster site can't be run out of the "default" folder
  5. Navigate to the new site created in the last step by going to it in your local web browser -- e.g. http://sleipnir.local
  6. You should now see the profile selection install screen -- select the Hostmaster option and install
  7. Once installed, run through the wizard
  8. The only snag you should hit is when it asks you what user/group to use for running the system; the default should show your currently logged in username (e.g. 'bmann'), and the help instructions explain how to use vigr to add that user to a group. This does not work on Mac OS X. This page explains dscl, which is what is used on OS X. On Leopard, you'll need to run the following command: sudo dscl . -append /Groups/_www GroupMembership bmann Alternately, you can also follow instructions on that page to ccreate a brand new 'hm' user and add that user to the '_www' group.

Additional notes

  • I ended up using our Bryght Basic Drupal 5 SVN checkout for my D5 base install -- since we backported watchdog you'll need to edit the hostmaster.profile to comment out watchdog as a required module

On a Debian/Ubuntu laptop

Those are notes taken by the Koumbit team when doing a training on hostmaster. It was performed on 3 laptops (2 Debian, 1 Ubuntu) and one dedicated server (at OVH). The Ubuntu laptop failed to be installed properly, but that might be related to bugs fixed since and/or operator errors.

Configure missing packages

This should be enough to get you running:

# apt-get install apache2 libapache2-mod-php5 mysql-server php5-cli php5 sudo

Substitute apache2 by apache1 and php5 by php4 if you want, but the rest of this doc assumes apache2/php5.

Download Drupal and required modules

We checkout from CVS, see also http://drupal.org/repos. Note that this will give us the 5.8-dev version of Drupal right now.

cd /var
mkdir hostmaster
cd hostmaster/
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -rDRUPAL-5 -d drupal-5.x drupal # checkout de Drupal 5
cd drupal-5.x/
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout  -d profiles/hostmaster contributions/profiles/hostmaster # checkout de l'install profile
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout  -d profiles/hostmaster/modules/hosting contributions/modules/hosting # checkout de hosting
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout  -d profiles/hostmaster/modules/provision contributions/modules/provision # checkout de provision

drush, cvs_deploy et views dans sites/all/modules.

cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -rDRUPAL-5 -d sites/all/modules/views contributions/modules/views
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -rDRUPAL-5 -d sites/all/modules/drush contributions/modules/update_status
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -rDRUPAL-5 -d sites/all/modules/update_status contributions/modules/drush
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -rDRUPAL-5 -d sites/all/modules/cvs_deploy contributions/modules/cvs_deploy

Apache configuration

Install an apache configuration, see also bug http://drupal.org/node/262005

NameVirtualHost *:80
<VirtualHost *:80>
RewriteEngine On
        ServerAdmin webmaster@localhost
        ServerName hostmaster.localhost

        DocumentRoot /var/hostmaster/drupal-5.x
</VirtualHost>
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/hostmaster/drupal-5.x>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

Include /var/hostmaster/config/vhost.d/

Note how we changed the ServerName for hostmaster.localhost (since we mostly have laptops and probably no domain name resolving to us...) and the webroot directory to drupal-5.x to make it clearer which platform is where.

Drupal install

We have a few hacks to go through before we install Drupal.

  • setup the hostname in /etc/hosts:
127.0.0.1       localhost hostmaster.localhost
  • create the sites directory:
mkdir -p /var/hostmaster/drupal-5.x/sites/hostmaster.localhost
cp /var/hostmaster/drupal-5.x/sites/hostmaster.localhost/settings.php /var/hostmaster/drupal-5.x/sites/default/settings.php
  • create the apache configuration directory:
mkdir -p /var/hostmaster/config/vhost.d/
  • activate mod_rewrite:
a2enmod rewrite

or add this line somewhere in your apache config:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
  • fix settings.php permissions
chmod a+w /var/hostmaster/drupal-5.x/sites/defaults/settings.php
  • Configuration of the database for the main Drupal website/frontend
CREATE DATABASE hostmaster;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON hostmaster.* TO 'hostmaster'@'localhost' IDENTIFIED BY 'XXXXXXXX';
  • Follow the hosting wizard, which gives us a few suggestions
    • fix permissions: chmod a-w sites/default/settings.php
    • create another MySQL, a real "root" this time: grant all privileges  on . to 'hostmaster_root'@'localhost' identified by 'XXXXXXXX' with grant option;
    • create another UNIX user for the drush tasks: adduser --system --home /var/hostmaster --no-create-home --disabled-login --disabled-password --shell /bin/sh hostmaster
    • add the user to www-data: adduser hostmaster www-data
    • fix permissions on the hostmaster directory: chown -R hostmaster /var/hostmaster
    • add hostmaster to sudo: hostmaster ALL=NOPASSWD: /usr/sbin/apache2ctl

Bugs found

user warning: Access denied for user 'hostmaster'@'localhost' to database 'provision_test' query: CREATE DATABASE provision_test in /var/hostmaster/drupal-5.x/includes/database.mysql.inc on line 172.

Install a site

Yay it works.

Adding a platform

Not yet. :) http://drupal.org/node/278674

Installing new modules

We also discussed how we would go around easily adding modules into subsites and attempted to do this with drush pm

# su hostmaster
$ /var/hostmaster/drupal-5.x/profiles/hostmaster/modules/drush/drush.php pm install views --root='/var/hostmaster/drupal-5.x' --uri='http://test.hostmaster.com' --web_host='hostmaster.localhost'  -v
Drush: You must enable the Drush module.

this doesn't work as the subsite doesn't have drush installed. this is an issue similar to the platform issue.