Sysphonic
User's Manual
Ubuntu 7.10 Server
Windows Vista / XP
Menus can be displayed anywhere by clicking outside on the left.
Open-Source Groupware
Thetis Installation Procedure
« Examples »
Version: Thetis ver.0.9.6
∧Download

» Ubuntu 7.10 Server
1. Installation of Ruby and Rails
$ sudo apt-get install ruby
When dependency-libraries are displayed, input "Y" to continue. Furthermore, if installation CD is required, put CD in and input "ENTER". Then install RubyGems, too.
$ sudo apt-get install rubygems
Installation of Rails
$ sudo gem install rails -v 2.1.2
When you use old environment with updating, the following command might also be necessary.
$ sudo gem update --system
Installation of GetText
$ sudo apt-get install build-essential
$ sudo apt-get install ruby1.8-dev
$ sudo gem install gettext -v 1.93.0
Installation of FasterCSV
$ sudo gem install fastercsv -v 1.2.3
Installation of WillPaginate
$ sudo gem install will_paginate -v 2.2.2
2. Installation of FastCGI
$ sudo apt-get install libfcgi-dev
$ sudo gem install fcgi
3. Installation of MySQL
$ sudo apt-get install mysql-server mysql-client
Since the password of "root" will be asked, input it.
Check and backup the configuration file (my.cnf)
$ cd /etc/mysql
$ ls
conf.d  debian-start  debian.cnf  my.cnf
$ sudo cp my.cnf my_bak.cnf
Once stop MySQL server.
$ sudo mysqladmin -u root -p shutdown
Edit my.cnf as follows.
   ...
[mysqld]
#>> Thetis add default-character-set = utf8 #<< Thetis add ... [mysql] #>> Thetis add default-character-set = utf8 #<< Thetis add
Then start MySQL server.
$ sudo mysqld_safe &
4. Installation of Lighttpd
$ sudo apt-get install lighttpd
Check and backup the configuration file (lighttpd.conf).
$ cd /etc/lighttpd
$ ls
conf-available  conf-enabled  lighttpd.conf
$ sudo cp lighttpd.conf lighttpd_bak.conf
Edit lighttpd.conf as follows.
server.modules = (
   ...
#>> Thetis add 
            "mod_fastcgi",
            "mod_alias",
#<< Thetis add 
   ...
 )
   ...
#>> Thetis comment-out 
# dir-listing.activate        = "enable"
#<< Thetis comment-out 
   ...
#>> Thetis add 
$HTTP["url"] =~ "^/thetis($|[/])" {
  server.document-root = "/var/www/thetis/public"
  alias.url = ( "/thetis/" => "/var/www/thetis/public/" )
  server.indexfiles = ( "dispatch.fcgi" )
  server.error-handler-404 = "/thetis/dispatch.fcgi" 
  fastcgi.server = ( ".fcgi" =>
    ( "app-1" => ( "host" => "127.0.0.1", "port" => 7000 ),
      "app-2" => ( "host" => "127.0.0.1", "port" => 7001 ),
      "app-3" => ( "host" => "127.0.0.1", "port" => 7002 ) )
  )
}
#<< Thetis add 
Example of lighttpd.conf (Opens in the new window)
5. Deploy of Thetis project
Put thetis folder included in the release file (compressed file) of Thetis in /var/www.
  • Correct three "password:" (actually required is only for "production:") in config/database.yml to the password of "root" specified at MySQL installation.
  • When using except Rails 2.1.2, change the following line in the config/environment.rb. (To find the version of Rails, execute "rails -v" or "gem list" and find the line of "rails".)
    RAILS_GEM_VERSION = '2.1.2'
Create the database and exit as follows in the command line of MySQL.
$ mysql -u root -p
mysql> create database thetis_production;
mysql> exit
Move to the thetis folder and execute the rake command to create tables in the database.
$ cd /var/www/thetis
$ rake db:migrate RAILS_ENV=production
Give execution authority to the scripts to start and stop FastCGI.
$ sudo chmod 755 ./script/process/*
$ sudo chmod 755 ./public/dispatch.fcgi
6. Starting of FastCGI+Lighttpd
$ sudo ruby /var/www/thetis/script/process/spawner -p 7000
$ sudo lighttpd -f /etc/lighttpd/lighttpd.conf
7. The stop of FastCGI+Lighttpd
$ sudo ruby /var/www/thetis/script/process/reaper -a kill
$ sudo killall lighttpd

» Windows Vista / XP
1. Installation of One-Click Ruby Installer for Windows.
Download the package (ruby186-26.exe) from http://rubyforge.org/projects/rubyinstaller/ (Opens in the new window),
and execute it (Click "Next >" by each screen as default).
Then confirm the version number in the command line.
> ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Install Rails.
> gem install rails -v 2.1.2
When you use old environment with updating, the following command might also be necessary.
> gem update --system
Install GetText.
> gem install gettext -v 1.93.0
Install FasterCSV.
> gem install fastercsv -v 1.2.3
Install WillPaginate
> gem install will_paginate -v 2.2.2
Install MySQL library
> gem install mysql -v 2.7.3
When installing MySQL library, installing documents failed. However, library itself seems to be installed successfully and work without problem.
2. Installation of SCGI
Download "gem" (scgi_rails-0.4.3.gem) from http://www.zedshaw.com/projects/scgi_rails/ (Opens in the new window) and save it in the current directory of the command line.
Then execute as follows.
> gem install cmdparse -v 2.0.2
> gem install highline -v 1.4.0
> gem install scgi_rails-0.4.3.gem
As for scgi_rails-0.4.3, an error occurs when starting SCGI on Rails2.0.x or newer.
To work arround it, please edit line 36 of C:\ruby\lib\ruby\gems\1.8\gems\scgi_rails-0.4.3\bin\scgi_service
(This path depends on installation directory of your Ruby)
with your text editor
ActiveRecord::Base.threaded_connections = false
like following:
ActiveRecord::Base.allow_concurrency = false
3. Installation of MySQL.
Download "MySQL Community Server" (Windows ZIP/Setup.EXE(x86)) from http://dev.mysql.com/downloads/ (Opens in the new window) and start Setup.exe after extending it.
Proceed by "Next >" as default till entering "MySQL Server Instance Configuration" Wizard.
In "Instance Configuration", follow the list below.
  • "Detailed Configuration" (default)
  • "Server Machine"
  • "Multifunctional Database" (default)
  • Click "Next >" at InnoDB Tablespace Settings as default.
  • Choose according to the number of users, then "Next >".
  • Since 20 connections are usually enough, click "Next >" as default.
  • Click "Next >" as default at Network Option, too.
  • Certainly select "Best Support for Multilingualism" (UTF-8).
  • Put a check in "Include Bin Directory in Windows PATH" at Windows Option.
  • Specify the password of root.
If the error message "Connection Error" comes out while performing installation, there is a possibility that it may be flipped by setup of the firewall. With an error message displayed, start "Windows Firewall" from "Control Panel" and "Add" the port in the "Exception" tab of "Change". Find the words like "... TCP port 3306 ..." in the Error Message, and specify the number as "Exception".
(If your Antivirus software blocks, please follow its introduction.)
After that, click the "Retry" button in the Error Message.
4. Installation of Lighttpd
Download from
http://wlmp.dtech.hu/down_lighty.php?lang=en (Opens in the new window)
or the mirror-site
http://files.akl.lt/incoming/wlmp-mirror/ (Opens in the new window).
Execute installation, and finish by clicking "Next >" at each page as default.

Execute "bin\Service-Install.exe" in the installation folder ("C:\Program Files\LightTPD" as default), and register it as a Windows Service. When asked if the service should be started now, specify "Y".
Then access to "http://127.0.0.1/" with the browser. If you can see "LightTPD Test Page", you have done successfully.
Otherwise, there is a possibility that it may be flipped by the firewall. Add the port number 80 as "Exception" refering to the blue frame above.
Confirm the registration of "LightTPD" in the "Control Panel" - "Management Tools" - "Services" of Windows. Starting / Stopping / Rebooting it can be done here by clicking right button of the mouse.
"Control Panel" - "Management Tools" - "Services" can be shown with the following steps, too.
  • Push "Windows Mark" and "R" Key on the keyboard at the same time.
          -> "Execute by specifying file name" dialog will be shown.
  • Input "services.msc", and click "OK".
From next time, since "services.msc " can be chosen from a drop down list, "service" screen can be displayed quickly.
Next, edit conf\lighttpd-inc.conf in the installation folder of Lighttpd as follows after backup.
server.modules = ( 
   ...
#>> Thetis add 
            "mod_rewrite",
            "mod_redirect",
            "mod_scgi",
#<< Thetis add 
   ...
 )
   ...
#>> Thetis comment out 
  Comment out this line
# dir-listing.activate        = "enable"
#<< Thetis comment out 
   ...
#>> Thetis add 
$HTTP["url"] =~ "^/thetis($|[/])" {
  server.document-root = "C:/RailsApps/thetis/public" 
  server.indexfiles = ("frames/index")
  alias.url = ("/thetis" => "C:/RailsApps/thetis/public")
  server.error-handler-404   = "/thetis/dispatch.scgi" 
  scgi.server = ( "dispatch.scgi" => (( 
    "host" => "127.0.0.1",
    "port" => 9999,
    "check-local" => "disable" 
   )) )
  scgi.debug=3
}
#<< Thetis add 
Example of lighttpd-inc.conf (Opens in the new window)
5. SSL configuration
This chapter is necessary only for those who want to access Thetis with HTTPS (https://~/thetis)
Create a folder named ssl under installation folder of Lighttpd. Then execute the following line on the command line, both without carriage-returns.
(For example, installation folder of Lighttpd may be C:/Program Files/LightTPD)
> cd C:\Program Files\LightTPD\ssl
> openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes -config "C:\Program Files\LightTPD\OpenSSL.cnf"
Answer properly to questions.
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Tokyo
Locality Name (eg, city) []:Toshima-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]: ***
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:****
Email Address []:****@****
Edit conf/lighttpd-inc.conf in installation folder of Lighttpd like below.
   ...
#### SSL engine
#>> Thetis enable 
  ∨ Remove comment-characters and edit the following 2 lines. 
ssl.engine                 = "enable"
ssl.pemfile                = "C:/Program Files/LightTPD/ssl/server.pem"
#<< Thetis enable 
   ...
6. Deploy of the Thetis project
Create a folder named "RailsApps" in the root of C drive. Create "logs" folder in it, too.
Put thetis folder included in the release file (compressed file) of Thetis in C:\RailsApps.
  • Correct three "password:" (actually required is only for "production:") in config/database.yml to the password of "root" specified at MySQL installation.
  • When using except Rails 2.1.2, change the following line in the config/environment.rb. (To find the version of Rails, execute "rails -v" or "gem list" and find the line of "rails".)
    RAILS_GEM_VERSION = '2.1.2'
Open the command line of MySQL (MySQL Command Line Client), and create the database and exit as follows.
mysql> create database thetis_production;
mysql> exit
Move to the thetis folder in the command line of Windows, and create tables in the database by rake command.
> cd C:\RailsApps\thetis
> rake db:migrate RAILS_ENV=production
Then, execute the following command, and create thetis/config/scgi.yaml.
(When asked a password, specify arbitrary.)
This file will be refered to by SCGI when starting up.
> scgi_ctrl config -S
7. Start SCGI + Lighttpd
Make a batch-file to start (restart) SCGI as follows.
@echo off
C:
echo Stopping SCGI Service...
taskkill /F /IM ruby.exe > nul
cd C:\RailsApps\thetis
echo Starting SCGI Service...
scgi_service

exit
Execute this batch-file (ignore the massage "Error: Process "ruby.exe" cannot be found."), and restart the service of LightTPD in "Control Panel" - "Management Tools" - "Services". Access to http://127.0.0.1/thetis/ with the browser.
If the page is not displayed correctly, check if an error has been occured by retrying, after replacing "exit" at the end of the batch-file with "REM exit".
8. Stop SCGI / Lighttpd
To stop SCGI, create a batch-file with picking up the line for stopping ("taskkill /F /IM ruby.exe > nul") from the batch-file mentioned above, or kill the "ruby.exe" directly in the Task Manager.
To stop Lighttpd, as mentioned above, open "Control Panel" - "Management Tools" - "Services" of Windows.

©2007-2010 Sysphonic