| 1 | Hotstuff installation instructions |
|---|
| 2 | ================================== |
|---|
| 3 | |
|---|
| 4 | This guide contains complete installation instructions for the Hotstuff |
|---|
| 5 | sources. It is highly recommended to install Hotstuff from binary packages |
|---|
| 6 | (e.g. on Debian) since installation from source is not trivial and requires |
|---|
| 7 | some care. |
|---|
| 8 | In this guide, the installation instructions of dependencies and additional |
|---|
| 9 | servers are also given for installing from source, since this might be |
|---|
| 10 | requires whenever a piece of software is not available. |
|---|
| 11 | |
|---|
| 12 | Step 0: install Hotstuff |
|---|
| 13 | ------------------------ |
|---|
| 14 | |
|---|
| 15 | If not yet done, all Hotstuff scripts and manual pages should |
|---|
| 16 | be installed. A simple Makefile is included so calling 'make install' |
|---|
| 17 | should be sufficient. This will put all of Hotstuff into directories |
|---|
| 18 | under the /usr/local hierarchy. If this is not wanted, modify the Makefile |
|---|
| 19 | first. |
|---|
| 20 | |
|---|
| 21 | If the system is new, do not forget to install tools such as less, vim, |
|---|
| 22 | make, subversion and the like. |
|---|
| 23 | |
|---|
| 24 | Step 1: install PostgreSQL |
|---|
| 25 | -------------------------- |
|---|
| 26 | |
|---|
| 27 | Currently, only PostgreSQL is supported as the database server. On most |
|---|
| 28 | distributions, it is available as a pre-configured package. In case it isn't, |
|---|
| 29 | it can be installed from scratch: |
|---|
| 30 | |
|---|
| 31 | % wget ftp://ftp5.es.postgresql.org/mirror/postgresql/source/ \ |
|---|
| 32 | v8.0.3/postgresql-base-8.0.3.tar.bz2 |
|---|
| 33 | % tar xvjf postgresql-base-8.0.3.tar.bz2 |
|---|
| 34 | % ./configure --prefix=~/postgresql |
|---|
| 35 | % make && make install |
|---|
| 36 | |
|---|
| 37 | A database can then be initialised with the following commands: |
|---|
| 38 | |
|---|
| 39 | % export PATH=~/postgresql/bin:$PATH |
|---|
| 40 | % export PGDATA=~/postgresql/var |
|---|
| 41 | % initdb |
|---|
| 42 | % postmaster |
|---|
| 43 | |
|---|
| 44 | Hotstuff needs a dedicated database. Its setup will be described in |
|---|
| 45 | the next step. |
|---|
| 46 | |
|---|
| 47 | Step 2: configure PostgreSQL |
|---|
| 48 | ---------------------------- |
|---|
| 49 | |
|---|
| 50 | The database must be created first. This used to require the setup of a |
|---|
| 51 | database and a user for it, and its initialisation with SQL schema files. |
|---|
| 52 | |
|---|
| 53 | Nowadays, the 'hotstuff-siteadmin' tool will handle this task. Call it |
|---|
| 54 | once for a test repository, in the form: |
|---|
| 55 | |
|---|
| 56 | % hotstuff-siteadmin add test |
|---|
| 57 | |
|---|
| 58 | Step 3: install Perl modules |
|---|
| 59 | ---------------------------- |
|---|
| 60 | |
|---|
| 61 | All the needed Perl modules can be installed from CPAN, in case the |
|---|
| 62 | distribution doesn't provide them. |
|---|
| 63 | Needed are: |
|---|
| 64 | * DXS common: MIME::Base64, SOAP::Lite, Data::Dumper |
|---|
| 65 | * DXS server: DBI (plus DBD::Pg module) |
|---|
| 66 | * DXS client: DateTime, XML::DOM, Getopt::Long, Term::Shell, LWP::Simple |
|---|
| 67 | * DXS client, optionally: Crypt::SSLeay, Term::Readline |
|---|
| 68 | * GHNS scripts: a few of those of DXS, plus: XML::Writer, CGI |
|---|
| 69 | |
|---|
| 70 | * extra since 0.9.2: Date::Parse, DateTime |
|---|
| 71 | |
|---|
| 72 | % cpan |
|---|
| 73 | ... |
|---|
| 74 | % export PERL5LIB=~/perl/lib/perl5/site_perl/5.8.6 |
|---|
| 75 | % perl -MCPAN -e "install XML::DOM" |
|---|
| 76 | % perl -MCPAN -e "install DBD::Pg" |
|---|
| 77 | % perl ... |
|---|
| 78 | |
|---|
| 79 | Step 4: configure Apache |
|---|
| 80 | ------------------------ |
|---|
| 81 | |
|---|
| 82 | Apache, or equivalent web servers, should provide Hotstuff as a virtual |
|---|
| 83 | host. However, this is not strictly necessary. There will be five different |
|---|
| 84 | areas where web access to Hotstuff is needed or wanted: |
|---|
| 85 | - the CGI scripts, which means hotstuff-dxs for DXS access and hotstuff-stuff |
|---|
| 86 | for providing the GHNS feeds |
|---|
| 87 | - the admin interface (which ships with Hotstuff) |
|---|
| 88 | - the user interface, called Cocodrilo, which can be installed anywhere since |
|---|
| 89 | it will interface with Hotstuff via HTTP |
|---|
| 90 | - a WebDAV folder for uploads, when no FTP is used |
|---|
| 91 | - the download area for the data and preview files and the provider file |
|---|
| 92 | |
|---|
| 93 | An example for an alternative web server would be: |
|---|
| 94 | |
|---|
| 95 | % thttpd -p 8080 -l ...../LOG -c "/cgi-bin/*" |
|---|
| 96 | |
|---|
| 97 | The web pages are stored in /usr/local/share/hotstuff-admin by default. |
|---|
| 98 | See below for notes on the admin interface. |
|---|
| 99 | |
|---|
| 100 | Step 5: configure Hotstuff |
|---|
| 101 | -------------------------- |
|---|
| 102 | |
|---|
| 103 | The Hotstuff configuration template file must be copied to /etc |
|---|
| 104 | and edited to fit the system configuration. |
|---|
| 105 | |
|---|
| 106 | % cp hotstuff/src/hotstuff.conf-dist /etc/hotstuff.d/foo.conf |
|---|
| 107 | % vim /etc/hotstuff.d/foo.conf |
|---|
| 108 | ... |
|---|
| 109 | |
|---|
| 110 | When hotstuff-siteadmin is used, the most important values are already |
|---|
| 111 | filled out. |
|---|
| 112 | |
|---|
| 113 | Step 6: import of test data |
|---|
| 114 | --------------------------- |
|---|
| 115 | |
|---|
| 116 | A Hotstuff database is useless without actual data. The hotstuff-scan tool |
|---|
| 117 | usually looks for uploads and imports them into a database. It can however |
|---|
| 118 | also process download feeds from other GHNS providers and fetch the referenced |
|---|
| 119 | files for import. This is usually the easiest way to get some initial data. |
|---|
| 120 | |
|---|
| 121 | % wget http://download.kde.org/khotnewstuff/wallpaper/wallpaper.xml |
|---|
| 122 | % hotstuff-scan -s wallpaper.xml -f |
|---|
| 123 | |
|---|
| 124 | Depending on the configuration, the second step may need to be performed as |
|---|
| 125 | root. |
|---|
| 126 | |
|---|
| 127 | Step 7: Versioning |
|---|
| 128 | ------------------ |
|---|
| 129 | |
|---|
| 130 | If the test data worked sufficiently, e.g. by pointing a GHNS implementation |
|---|
| 131 | such as KNewStuff to it or by using the Cocodrilo web frontend, some advanced |
|---|
| 132 | topics can be tackled. The first of them is versioning. Versioning is enabled |
|---|
| 133 | in this step, afterwards the procedure of step 6 (the import of test data) |
|---|
| 134 | should be repeated. The download directory as specified in hotstuff.conf will |
|---|
| 135 | be used as the checkout directory. |
|---|
| 136 | |
|---|
| 137 | There are two ways of using hotstuff-versioning: As a transparent backend for |
|---|
| 138 | conventional uploads (such as FTP, HTTP or WebDAV), and as a gateway to the |
|---|
| 139 | Hotstuff database for when all data is already maintained in a version control |
|---|
| 140 | system such as SVN. |
|---|
| 141 | |
|---|
| 142 | The first way works as follows: |
|---|
| 143 | |
|---|
| 144 | % hotstuff-versioning --setup /repository |
|---|
| 145 | |
|---|
| 146 | % (cd directory && svn status) |
|---|
| 147 | % hotstuff-versioning -c hotstuff.conf |
|---|
| 148 | |
|---|
| 149 | What hotstuff-versioning does is that it looks for newly added files for the |
|---|
| 150 | repository and adds versioning meta data to them. Files are placed into the |
|---|
| 151 | checkout directory (equal to download directory) by hotstuff-scan which finds |
|---|
| 152 | the files in the upload directory. |
|---|
| 153 | |
|---|
| 154 | The second way works as follows: |
|---|
| 155 | |
|---|
| 156 | No local repository is assumed, since the second way should work transparently |
|---|
| 157 | with remote repositories. Similarly to the first way, the download directory |
|---|
| 158 | equals the checkout directory. However, hotstuff-versioning doesn't look for |
|---|
| 159 | locally added files to the checkout directory which are placed there by |
|---|
| 160 | hotstuff-scan. Instead, it runs "svn update" or an equivalent command, and for |
|---|
| 161 | each changed meta file invokes hotstuff-scan on its own, with the option to |
|---|
| 162 | not remove any meta files and not move any preview or payload files. |
|---|
| 163 | |
|---|
| 164 | A cron job running every 10 minutes or so would execute the following command |
|---|
| 165 | for each Hotstuff site: |
|---|
| 166 | |
|---|
| 167 | % hotstuff-versioning -c hotstuff.conf --repo |
|---|
| 168 | |
|---|
| 169 | One must ensure that the repository URL leads to an anonymous checkout. Also, |
|---|
| 170 | the upload URL must be equal to the download URL so that hotstuff-scan can find |
|---|
| 171 | the checked-out files. Finally, the actual repository URL must be given in the |
|---|
| 172 | configuration file. |
|---|
| 173 | |
|---|
| 174 | Step 8: Desktop eXchange Service (DXS) |
|---|
| 175 | -------------------------------------- |
|---|
| 176 | |
|---|
| 177 | Running 'dxsclient' should be sufficient to test the DXS capabilities on the |
|---|
| 178 | command line. The web service URL can be given as a parameter, and should |
|---|
| 179 | point to the location of the hotstuff-dxs script. |
|---|
| 180 | |
|---|
| 181 | Step 9: Administration frontend |
|---|
| 182 | ------------------------------- |
|---|
| 183 | |
|---|
| 184 | The hotstuff-admin frontend is currently not well developed. In order to make |
|---|
| 185 | use of it, copy htconf-dist to .htconf and fill out its values for one |
|---|
| 186 | particular repository. (Only one can be administered at a time right now.) |
|---|
| 187 | |
|---|
| 188 | Step 10: Test |
|---|
| 189 | ------------- |
|---|
| 190 | |
|---|
| 191 | Under KDE 3, run 'khotnewstuff <providerurl>'. |
|---|
| 192 | |
|---|
| 193 | Under KDE 4, run 'khotnewstuff4 <file.knsrc>. This file must at least contain the |
|---|
| 194 | following information: |
|---|
| 195 | [KNewStuff2] |
|---|
| 196 | ProvidersUrl=<providerurl> |
|---|
| 197 | and must be placed in KDE's configuration directory, e.g. $KDEHOME/share/config. |
|---|