The line beginning with '#' requires the root priviledge. Use 'sudo' or 'su -'.
If Apache Httpd 2.2.x is not installed yet. Please install it by
# yum install httpd
From system administration menu, open "Security Level Configuration" panel. Then, enable "WWW(HTTP)" and "Secure WWW (HTTPS)" by marking check boxes in the "Trusted services" area.
You also need to allow httpd to work as an reverse proxy by
# /usr/sbin/setsebool -P httpd_can_network_connect=1
Install ruby, rubygems, and other required applications.
# yum install ruby # yum install ruby-devel # yum install ruby-rdoc
Install gems (You can ignore "rdoc" related errors.)
# wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz # tar -zxf rubygems-1.3.4.tgz # cd rubygems-1.3.4 # ruby setup.rb
Install Ruby on Rails and plugins (You can ignore "rdoc" related errors.)
# gem install rails -v="2.0.2" # gem install mongrel -v=”1.1.5” # gem install mongrel_cluster -v=”1.0.5” # gem install will_paginate -v="2.2.2"
(If gem install does not work well, try to add "--source http://rubygems.org/" to the commands.)
We will introduce instructions for 2 types of DB (DB2 and MySQL).
Please select one of them.
Coming soon.
# yum install mysql # yum install mysql-server # /sbin/chkconfig mysqld on # /etc/rc.d/init.d/mysqld start # /usr/bin/mysqladmin -u root password 'new-mysql-password'
(Alternatively you can run: # /usr/bin/mysql_secure_installation)
Create social accessibility database.
$ mysql -u root -p (enter root password of mysql) mysql> create database sa_production default character set utf8; Query OK, 1 row affected (0.00 sec) mysql> quit Bye
Here, we assume a user 'social' is used, and SocialAccessibilityServer_(version).tgz is copied into /home/social/
(You can download Social Accessibility Server image from MCOF project page )
To create a user 'social', use the following
# /usr/sbin/adduser social
(please configure password, etc. for the user 'social' appropriately.)
And add the following line into .bashrc
export RAILS_ENV='production'
When you want to use https for login, add the following line into .bashrc
export RAILS_FORCE_HTTPS=true
To activate the lines to .bashrc, use the following command.
$ source ~/.bashrc
Extract the SA server, add third party materials, etc.
$ cd ~ $ tar zxvf SocialAccessibilityServer_(version).tgz $ cd SocialAccessibilityServer $ mkdir log tmp vendor $ mkdir tmp/pids vendor/plugins $ wget http://script.aculo.us/dist/scriptaculous-js-1.8.1.tar.gz $ tar -zxvf scriptaculous-js-1.8.1.tar.gz $ cd scriptaculous-js-1.8.1 $ cp lib/*.js src/*.js ~/SocialAccessibilityServer/public/javascripts/ $ wget --no-check-certificate https://github.com/heythisisnate/globalize/tarball/for-1.2 -O globalize-1.2.tgz $ tar -zxvf globalize-1.2.tgz $ cp -r heythisisnate-globalize-c07d588 ~/SocialAccessibilityServer/vendor/plugins/
Set database user and password if necessary.
$ cd ~/SocialAccessibilityServer
$ vi config/database.yml
(then, find a line beginning with "production:".Then change 'username' and 'password' to the appropriate values.)
$ rake db:migrate $ rake globalize:setup $ mongrel_rails cluster::configure -e production -p 3000 -N 5 $ mongrel_rails cluster::start
Then, try to access http://\<your server>:3000/
You can see Social Accessibility Server works.
The instances of mongrel_rails uses different port (3000-3004), so it is not practical to use them as is. We use mod_proxy to cope with them.
# cd /etc/httpd/conf # cp httpd.conf httpd.conf.org # vi httpd.conf
(Remove '#' from the line '# NameVirtualHost *:80' under Section 3 and enable it. Then, insert settings below at the bottom of httpd.conf )
<VirtualHost *:80> ServerAdmin root@localhost ProxyRequests Off ProxyPass / balancer://lbalancer/ lbmethod=byrequests timeout=1 ProxyPassReverse / http://localhost:3000 ProxyPassReverse / http://localhost:3001 ProxyPassReverse / http://localhost:3002 ProxyPassReverse / http://localhost:3003 ProxyPassReverse / http://localhost:3004 <Proxy *> Order deny,allow Allow from all </Proxy> <Proxy balancer://lbalancer/> BalancerMember http://localhost:3000 loadfactor=1 BalancerMember http://localhost:3001 loadfactor=1 BalancerMember http://localhost:3002 loadfactor=1 BalancerMember http://localhost:3003 loadfactor=1 BalancerMember http://localhost:3004 loadfactor=1 </Proxy> ErrorLog /var/log/httpd/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/httpd/access.log combined # ServerSignature On </VirtualHost>
Then, activate the site.
# /etc/init.d/httpd restart
access http://\<your server>/ and check it works!
Create a Social Accessibility user, and make him/her an admin.
To sign up, enter any user name and password in the top page of Social Accessibility server. Then, make the user an admin by modifying DB.
$ mysql socialaccessibility_production -u root -p mysql> update users set administrator = 1 where nickname = '<your nickname>' limit 1; > bye
The admin can use administrator menu by accessing "Admin menu" at the left-side navigation bar in the Social Accessibility portal.
When rebooting the SA server, stop apache beforehand.
# /etc/init.d/httpd stop $ cd ~/SocialAccessibility $ mongrel_rails cluster::stop (do something) $ mongrel_rails cluster::start # /etc/init.d/httpd start
When mongrel_rails does not start by complaining 'pid files exist', remove pid files after confirming mongrel servers are really stopped.
(Check by 'ps aux | grep mongrel').
\<dump>
$ mysqldump socialaccessibility -u root -p > dumpfile
\<restore>
$ mysql socialaccessibility -u root -p < dumpfile
You may need to setup logrotation to archive logs of Social Accessibility server. The logs are stored at /home/social/SocialAccessibilityServer/log
Anonymous