Feature #176
Updated by Daniel Curtis almost 10 years ago
* Get the latest version of Puppet Dashboard from the "puppetlabs":https://puppetlabs.com/ site, install dependecies and install the Puppet Dashboard package: <pre> wget http://apt.puppetlabs.com/pool/wheezy/main/p/puppet-dashboard/puppet-dashboard_1.2.23-1puppetlabs1_all.deb sudo apt-get install rake dbconfig-common libdbd-mysql-ruby libhttpclient-ruby1.8 mysql-server sudo dpkg -i puppet-dashboard_1.2.23-1puppetlabs1_all.deb </pre> h2. Configuration * Create the databases and user for puppet dashboard: <pre> sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_production CHARACTER SET utf8;' sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_development CHARACTER SET utf8;' sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_test CHARACTER SET utf8;' sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'verysecretpassword';" sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_production.* TO 'dashboard'@'localhost';" sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_test.* TO 'dashboard'@'localhost';" sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_development.* TO 'dashboard'@'localhost';" </pre> Next, edit @/etc/puppet-dashboard/databse.yml@ to make sure it contains the password we just set. In this example *verysecretpassword*. Edit the mysql configuration file @/etc/mysql/my.conf@ to make sure the setting @max_allowed_packet@ is +32M or more+. * Change directory to the location where Puppet Dashboard is installed and run the rake test to fill the database we just created: <pre> cd /usr/share/puppet-dashboard/ sudo rake RAILS_ENV=production db:migrate </pre> * Make sure the webserver can write to the log files <pre> sudo chown www-data.www-data /usr/share/puppet-dashboard/log/* </pre> * Start the Puppet Dashboard WEBrick server <pre> sudo -u www-data ./script/server -e production </pre> You should now be able to access the Puppet Dashboard webinterface on port 3000 of your server. http://puppet.example.com:3000/ h2. Passenger The WEBrick server is fine for testing, but not for production. Hence we run Puppet Dashboard with the Apache webserver. * Stop the running WEBrick server with @crtl+c@ and copy the example config file to the apache vHosts directory and enable the vHost. <pre> sudo cp /usr/share/puppet-dashboard/ext/passenger/dashboard-vhost.conf /etc/apache2/sites-available/puppet-dashboard sudo a2ensite puppet-dashboard </pre> * Edit @/etc/apache2/sites-enabled/puppet-dashboard@ to match following. +Don't forget to change ServerName.+ <pre> Listen 3000 PassengerRuby /usr/bin/ruby PassengerHighPerformance on PassengerMaxPoolSize 12 PassengerPoolIdleTime 1500 PassengerStatThrottleRate 120 <VirtualHost *:3000> SetEnv RAILS_ENV production RailsBaseURI / ServerName puppet.example.com DocumentRoot /usr/share/puppet-dashboard/public/ <Directory /usr/share/puppet-dashboard/public/> Options None AllowOverride AuthConfig Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/puppet-dashboard_error.log LogLevel warn CustomLog /var/log/apache2/puppet-dashboard_access.log combined ServerSignature On </VirtualHost> </pre> * Restart Apache to load our configuration: <pre> sudo service apache2 restart </pre> Open a webbrowser and go to the url you chose with the ServerName directive. Goto http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html#configuring-puppet and configure PuppetMaster to communicate with Puppet Dashboard. *Note*: I had to add a Listen directive to the vHost configuration, as the server would not automatically listen on the configured port and I did not set the Puppet Dashboard on the default port 80. h2. Resources * http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html * https://wiki.debian.org/PuppetDashboard