[root@puppet ~]# service mysqld start
[root@puppet ~]# chkconfig mysqld on
[root@puppet ~]# mysqladmin -uroot password 123456
[root@puppet ~]# mysql -p123456
mysql> create database dashboard character set utf8;
mysql> grant all on dashboard.* to 'dashboard'@'localhost' identified by "123456";
mysql> flush privileges;
mysql> quit
[root@puppet ~]# vi /etc/my.cnf
[mysqld]
max_allowed_packet=32M
[root@puppet ~]# service mysqld restart
4、配置dashboard
[root@puppet ~]# cd /usr/share/puppet-dashboard/
[root@puppet puppet-dashboard]# vi config/database.yml
production:
database: dashboard
username: dashboard
password: 123456
encoding: utf8
adapter: mysql
[root@puppet puppet-dashboard]# vi config/settings.yml
time_zone: 'Asia/Shanghai'
[root@puppet puppet-dashboard]# rake gems:refresh_specs
[root@puppet puppet-dashboard]# rake RAILS_ENV=production db:migrate
使用合适的表填充数据库,环境变量RAILS_ENV=production告诉Ruby on Rails我们工作在生产环境。
[root@puppet puppet-dashboard]# service puppet-dashboard start
[root@puppet ~]# cd /usr/share/puppet-dashboard/
[root@puppet puppet-dashboard]# ./script/server -e production
=> Booting WEBrick
=> Rails 2.3.17 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2014-11-14 15:36:28] INFO WEBrick 1.3.1
[2014-11-14 15:36:28] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux]
[2014-11-14 15:36:28] INFO WEBrick::HTTPServer#start: pid=36461 port=3000
^C[2014-11-14 15:37:36] INFO going to shutdown ...
[2014-11-14 15:37:36] INFO WEBrick::HTTPServer#start done.
Exiting