- Ruby on Rails v2.3.5 stack
- Either MySQL version 5.0 (or higher) or PostgreSQL version 8.3 (or higher) as database engine
This section contains brief overview how to install Rails stack on Debian 4.0 (or later) Linux server. If you already have a working Rails environment, you can freely skip this section.
By using the instructions given here, most basic system is being set up containing:
- MySQL database server
- nginx web server with passenger module
This application will work on any decent Rails stack. Depending of the service provider, your mileage may vary.
apt-get update
apt-get install ssh gcc sudo make git-core build-essential zlib1g-dev libssl-dev libreadline5-dev libopenssl-ruby
apt-get install mysql-server libmysql-ruby libmysqlclient15-dev
# Ruby install
cd /usr/src
curl -O http://files.rubyforge.vm.bytemark.co.uk/emm-ruby/ruby-enterprise-1.8.7-2010.01.tar.gz
tar -xzvf ruby-enterprise-1.8.7-2010.01.tar.gz
./ruby-enterprise-1.8.7-2010.01/installer
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/gem /usr/local/bin/gem
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/rake /usr/local/bin/rake
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby /usr/local/bin/ruby
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/irb /usr/local/bin/irb
ln -s /opt/ruby-enterprise-1.8.7-2010.01/bin/erb /usr/local/bin/erb
gem install mysql
/opt/ruby-enterprise-1.8.7-2010.01/bin/passenger-install-nginx-module
Create application directory and get code from source repository
mkdir -p /var/rails
cd /var/rails
git clone https://github.com/emsl/Talgud.git talgud
Install application dependencies and create database
cd /var/rails/talgud
sudo rake gems:install
RAILS_ENV=production rake db:create db:migrate
Create configuration files from their respective templates
cp ./config/app_config.example.yml ./config/app_config.yml
cp ./config/database.example.yml ./config/database.yml
See Configuration section on how to configure application settings.
Next, generate initial records that are necessary for the system to start working:
rake talgud:account:create['My Account','mydomain.com','email@mydomain.com','my-password']
Here, account and initial administrator user will be created. Since the system supports multiple accounts, you need to provide it's name and an internet address this account will start serving. So if you're using mydomain.com as the address of your application, make sure it is pointed to the server where application is installed.
Application settings are being configured in ./config/app_config.yml file as YAML format.
flickr_api_keyif you enable linking Flickr photo galleries to events, get API key from Flickr and add it here
mailer.from_namename to be set infrom:message headermailer.from_addresse-mail address to be set infrom:message headermailer.manager_localelocale to be used to deliver messages for regional managers and administrators, set to 2-character locale code, such asen. Locale file must exist in./config/locales/directory.mailer.delivery_methodset tosmtpwhen you want to use SMTP protocol to deliver messages. In this case you need to set the followingmailer.smtp_settingsconfiguration values.mailer.smtp_settings.addresshostname of the SMTP server. For GMail, set it tosmtp.gmail.commailer.smtp_settings.domainrequired by Google Apps, set it to your domain name (i.e.example.com)mailer.smtp_settings.user_nameSMTP account username, in GMail, use your e-mail address (i.e.noreply@example.com)mailer.smtp_settings.passwordaccount passwordmailer.smtp_settings.portSMTP server port, use587for GMailmailer.smtp_settings.enable_starttls_autoset totruefor GMailmailer.smtp_settings.authenticationauthentication method, set to:plainfor GMail
There are maintenance tasks that should be run regularily, i.e. to close events that are filled with participants. You may want to create a hourly cron task to perform this action:
1 * * * * RAILS_ENV=production <YOUR_RAILS_PATH>/script/runner 'Account.all.each { |a| Account.current = a; Event.run_state_jobs}'