Wikia:MachDBInstallOnFC6
From Mybrainhurts
Install Directions on FC6
The following are a rough outline of the steps I followed to install MachDB in a freshly installed FC6 box. Some of the dependencies may already be installed for you in which case great.
You can get the latest version of the Smarty Template engine from: Smarty.php.net. The default install location is used below and expected by the current (0.5) version of MachDB.
# Install smarty-2.6.7 wget "http://smarty.php.net/do_download.php?download_file=Smarty-2.6.17.tar.gz" tar -zxvf Smarty-2.6.17.tar.gz mkdir -p /usr/local/lib/php/Smarty cp -r Smarty-2.6.17/libs/* /usr/local/lib/php/Smarty
A few directories need to be created for the web pages of MachDB. The default Apache installation on Fedora is under /var/www/html.
# for collected data mkdir -p /var/machdb/ # for web root and collect.php scripts mkdir -p /var/www/html/machdb/
Then, we can copy all of the files included in the distribution into the web root.
# copy machdb scripts into machdb # NOTE: don't really need everything here... cp ~/machdb-0.5/* /var/www/html/machdb/
In order for the template engine of Smarty to make caches of the page views dynamically, some of the directories need to be writable and owned by the httpd user. Again for Fedora the default httpd user is 'apache'.
cd /var/www/html/machdb chown -R apache:apache smarty/cache/ chown -R apache:apache smarty/templates_c chmod -R 775 smarty/templates_c chmod -R 775 smarty/cache/
These dependencies may vary. For my fresh install, all I needed extra were the following packages:
# Package names for FC6 yum install -y dmidecode yum install -y perl-XML-Simple.noarch perl-libwww-perl perl-XML-SAX perl-XML-NamespaceSupport.noarch yum install -y mysql-server mysql mysql-client mysql-devel php-mysql
Because MachDB uses MySQL as the backing store, we need to create the user account and create a DB. If you already have a MySQL server setup, you won't need to do all of these steps. These are provided as a convenience for anyone bootstrapping from a fresh install.
service mysqld start
/usr/bin/mysqladmin -u root password 'rootpassword' /usr/bin/mysqladmin -u root -p create <your databasename>
I don't know if there isn't a better way to create a user account within MySQL, but this is all I could find, and it worked for me.
mysql -u root -p mysql> grant all privileges on <yourdbname>.* to 'machdbuser1'@'localhost' identified by 'yourpassword'; mysql> exit; or quit; or something.
mysql -u mysqluser -p mysqldatabse < database.sql
Once you've initialized the machdb database, you can setup your machdb installation config files under `/var/www/html/machdb/include/config.php`. Update the relevant fields with the MySQL accounts and passwords you've chosen above.
$mysqlserver = 'localhost'; $mysqluser = 'machdbuser1'; $mysqlpassword = 'yourpassword'; $mysqldatabase = 'yourdatabase';
Finally, visit the root directory on your local machine `http://yourhost.com/machdb/`. You should see MachDB with no hosts! Next, check out the machdb-gather-linux26 and machdb-send scripts.
