mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-11 15:12:37 +01:00
initial version
parent
264009225e
commit
1bda6690ea
1 changed files with 88 additions and 0 deletions
88
Ubuntu-11.04-with-lighttpd.md
Normal file
88
Ubuntu-11.04-with-lighttpd.md
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
This is a guide to install tracks with lighttpd 1.4 on Ubuntu 11.04 (natty) with a sqlite database. Experienced people should find it easy to replace the sqlite adapter with a mysql adapter as you can see in this guide:
|
||||||
|
|
||||||
|
## Getting Tracks Up
|
||||||
|
|
||||||
|
Make some directory for tracks:
|
||||||
|
|
||||||
|
` sudo mkdir /opt/tracks`
|
||||||
|
|
||||||
|
Get the source code
|
||||||
|
|
||||||
|
sudo git clone git://github.com/TracksApp/tracks.git /opt/tracks/tracks
|
||||||
|
cd /opt/tracks/tracks
|
||||||
|
|
||||||
|
Install the necessary files for rails:
|
||||||
|
|
||||||
|
sudo apt-get install rails
|
||||||
|
sudo apt-get install rake
|
||||||
|
sudo apt-get install libfcgi-ruby1.8
|
||||||
|
|
||||||
|
Comment out zentest and hoe in the Gemfile and then get some additional ruby gems:
|
||||||
|
|
||||||
|
## edit the Gemfile first
|
||||||
|
sudo gem install bundler
|
||||||
|
sudo /var/lib/gems/1.8/bin/bundle install
|
||||||
|
|
||||||
|
Create your config/database.yml file. It should look similar to the following. **Note:** make sure that the www-data user can read the sqlite database file. You might want to choose better paths for your database.
|
||||||
|
|
||||||
|
test: &TEST
|
||||||
|
adapter: sqlite3
|
||||||
|
database: ":memory:"
|
||||||
|
|
||||||
|
production:
|
||||||
|
adapter: sqlite3
|
||||||
|
database: /tmp/tracks-production.sq3
|
||||||
|
|
||||||
|
development:
|
||||||
|
adapter: sqlite3
|
||||||
|
database: /tmp/tracks-development.sq3
|
||||||
|
|
||||||
|
cucumber:
|
||||||
|
<<: *TEST
|
||||||
|
|
||||||
|
selenium:
|
||||||
|
<<: *TEST
|
||||||
|
|
||||||
|
Create your config/site.yml file from the template `config/site.yml.tmpl`. Initialize the database:
|
||||||
|
|
||||||
|
rake db:migrate RAILS_ENV=production
|
||||||
|
rake db:migrate RAILS_ENV=development ## in case you want help out later
|
||||||
|
|
||||||
|
Check whether you can run the server locally:
|
||||||
|
|
||||||
|
sudo ./scripts/server -e production
|
||||||
|
|
||||||
|
Check whether the server is running by going to http://localhost:3000. Terminate the process once you know it's working.
|
||||||
|
|
||||||
|
## Getting lighttpd running
|
||||||
|
|
||||||
|
Install the necessary packages
|
||||||
|
|
||||||
|
apt-get install lighttpd spawn-fcgi lighttpd-mod-magnet
|
||||||
|
|
||||||
|
Enable the mods for lighted
|
||||||
|
|
||||||
|
lighttpd-enable-mod fastcgi
|
||||||
|
lighttpd-enable-mod magnet
|
||||||
|
lighttpd-enable-mod access
|
||||||
|
|
||||||
|
Follow the description of running Rails applications with lighttpd. You can easily use spawn-fcgi as it comes with a package in Ubuntu:
|
||||||
|
http://redmine.lighttpd.net/wiki/1/LighttpdOnRails
|
||||||
|
|
||||||
|
## Get the fcgi bridge working with rails
|
||||||
|
|
||||||
|
Create a startup file called *run-tracks.sh* for tracks based on this template:http://redmine.lighttpd.net/projects/spawn-fcgi/repository/entry/trunk/doc/run-rails. Use *www-data* for the user and the group.
|
||||||
|
|
||||||
|
Configure the system so the www-data user can access the system:
|
||||||
|
|
||||||
|
mkdir /opt/tracks/tracks/log
|
||||||
|
chown -R www-data:www-data /opt/tracks/tracks/public
|
||||||
|
|
||||||
|
Test whether the script is working by starting it:
|
||||||
|
|
||||||
|
chmod +x /opt/tracks/run-tracks.sh
|
||||||
|
sudo -u www-data /opt/tracks/run-tracks.sh
|
||||||
|
|
||||||
|
## Getting https running
|
||||||
|
|
||||||
|
Check whether you have ssl compiled into lighttpd with `lighttpd -v`. It should mention ssl. Then following this guide to enable ssl: http://redmine.lighttpd.net/wiki/1/HowToSimpleSSL
|
||||||
Loading…
Add table
Add a link
Reference in a new issue