First install dependencies:
1. yum install gcc
2. Installing Ruby interpreter:
For GX X Ev1 upgrade 5 or prior you need Ruby interpreter 1.9.1.
For GX X Ev2 you need Ruby interpreter 1.9.3.
Check the Ruby version afterwards:
# ruby -v
ruby 1.9.1p431 (2011-02-18 revision 30908) x86_64-linux
3. Installing Apache web server:
-
yum install httpd
-
The following packages were also installed in my case:
(1/4): apr-util-1.2.7-11.el5_5.2.x86_64.rpm | 79 kB
(2/4): apr-1.2.7-11.el5_5.3.x86_64.rpm | 118 kB
(3/4): postgresql-libs-8.1.23-1.el5_6.1.x86_64.rpm | 196 kB
(4/4): httpd-2.2.3-45.el5.centos.x86_64.rpm | 1.2 MB
-
Configure startup on reboot and start up server now:
chkconfig --levels 235 httpd on
/etc/init.d/httpd start
4. Check RubyGems version:
# gem --version
1.3.1
In my case, it throws the following error:
`require': no such file to load -- zlib (LoadError)
so I did the following:
-
yum install zlib zlib-devel
cd /opt/ruby-1.9.1-p431/ext/zlib
# ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
make
make install
Afterwards everything goes ok:
# gem update RubyGems
Updating installed gems
See also:
http://docs.rubygems.org/read/chapter/3
http://rubyforge.org/frs/?group_id=126
Recommended RubyGems version: 1.8.19
5. Installing Passenger:
-
gem install passenger
passenger-install-apache2-module
-
Many other dependencies have to be installed, but the passenger setup guides perfectly through the installation:
* To install GNU C++ compiler:
yum install gcc-c++ as root.
* To install Curl development headers with SSL support:
yum install curl-devel as root.
* To install OpenSSL development headers:
yum install openssl-devel as root.
* To install Zlib development headers:
yum install zlib-devel as root.
* To install OpenSSL support for Ruby:
install Ruby with OpenSSL support by downloading it from http://www.ruby-lang.org/.
* To install Apache 2 development headers:
yum install httpd-devel as root.
* To install Apache Portable Runtime (APR) development headers:
yum install apr-devel as root.
* To install Apache Portable Runtime Utility (APU) development headers:
yum install apr-util-devel as root.
-
In particular, in order to install Open SSL:
cd /opt/ruby-1.9.1-p431/ext/openssl
ruby extconf.rb
make
make install
Then do again:
passenger-install-apache2-module until you get the following message:
"The Apache 2 module was successfully installed."
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby
6. Install Mysql dependencies (and server in my case)
As I hadn´t installed Mysql I did the following:
7. Installing GX required gems
Gems required by GX are distributed by GX in fact.
-
Create any directory on linux file system, and transfer "linux" and "generic" directories from any PC where GX is installed (transfer <GX_DIRECTORY>\gxruby\generic and <GX_DIRECTORY>\gxruby\linux)
-
chmod +x installgems.bash
Before running installgems script, which installs are the gems required by GX applications, do the following, which is particular to CentOS 64 bits distributions:
-
ln -s /usr/lib64/mysql/libmysqlclient.so.15.0.0 /usr/local/lib/libmysqlclient.so
-
edit build_make.sh under gx_clucene
change
gem install CLucene_gx-0.1.1-x86-linux
by
gem install CLucene_gx-0.1.1-x86_64-linux
-
Then run the script:
./installgems.bash
At this point we have the environment ready to install the GX Ruby application.
Then deploy and install the Ruby application:
8. Application Deployment
Create any directory which will be an Apache virtual directory, in my case:
/var/webapps/test1
Create directories "public" and "tmp" under test1.
Copy all <KbnowledgeBase_directory>\rubymodel (.rb, .html, configuration files, and subdirectories) content under test1.
9. Creating a virtual directory:
Create the virtual directory, by editing the httpd.conf file under /etc/httpd/conf
<VirtualHost *:80>
ServerAdmin webmaster
ServerName 172.16.2.20
DocumentRoot /var/webapps/test1/public
</VirtualHost>
-
It may be necessary to edit gxconfig.yaml (in my case under /var/webapps/test1 )and change webroot as follows:
webroot: 'http://172.16.2.20:80/test1/
That´s it, now you are ready to run the application!!, for instance:
http://172.16.2.20:80/test1/home.html
NOTE :
See also: How to deploy a Ruby application: Linux setup for running Ruby applications