READ THIS FIRST
This is not a tutorial on how to setup gitorious on Solaris. For general installation instructions, follow the guide with the general tutorial for Ubuntu.
If you are planning to install gitorious on Solaris SPARC, make sure that you have really no other option. If you have somewhere an Ubuntu machine, run gitorious on Ubuntu or any other convenient Linux OS.
The chapter titles in this blog post are coded in the following way:
Chapter title — See “[See the section in the general tutorial]”
As example the chapter title Environment — See “Install packages” does mean that this chapter covers the Environment and is related to the chapter Install packages in the general tutorial.
Environment — See “Install packages”
Here are some information about the environment that was used:
- SPARC T3-1 Server with a fresh Oracle Solaris 11.1 installation
- latest SolarisStudio installed for C/C++ compiler
- No licences, the tarball provided by Oracle was used with the necessary smylink:
- full package list from default Oracle repository that was used – solaris_package_list
- full package list from openCSW repository that was used – opencsw_package_list
- hostname of the server is dornbirn.zhaw.ch
- htdocs for apache is located under
- the name of the gitorious user is gitor
- apache2, mysql and ruby was used from default Oracle repository
- sidenote: apache from openCSW was used in the beginning of the installation procedure, but the passenger module will not compile for this apache.
- UltraSphinx is replaced in gitorious by ThinkingSphinx
Ruby and Gems — See “Install Ruby Gems”
This chapter is divided in two sections: ruby in general and installing the gems.
Do not use the ruby environment from openCSW. Both, ruby19 and ruby18 from openCSW will not work. Use the ruby environment from the oracle repository instead.
Some gems have native extensions. Such a native extension will be compiled during installation of the related gem. Not every extension compiles with the native C/C++ compiler from SolarisStudio. If the compilation of the native extension fails because of unknown flags, change the compiler in the file /usr/ruby/1.8/lib/ruby/1.8/sparc-solaris2.11/rbconfig.rb
This is a list of C/C++ compilers that were used, just comment or uncomment the line in the file /usr/ruby/1.8/lib/ruby/1.8/sparc-solaris2.11/rbconfig.rb as needed.
The most native extensions will compile with /usr/gcc/4.5/bin/gcc. This is the GNU compiler from the oracle repository.
Installing initial gems
In this section you have to install rmagick with the native extension. For this, ImageMagick is needed but the version from Oracle is to old and the version from openCSW is compiled with HDR support. Both of them can not be used, you have to compile ImageMagick by yourself.
Link the installed package /bin /include … in /usr/local/packages/ImageMagic–6.8.0 versus your environment. Now install the gems.
Install Sphinx server — See “Installing the Sphinx Search Server”
The version 0.9.9 as describe in the tutorial was used. To configure sphinx server, the following command should work well.
start|stop|restart scripts — See “Configuring services”
There are no scripts for Solaris but the ones provided for ubuntu, are easy to rewrite. First drafts for the startupscripts can be found here:
Check the scripts before using them. Maybe you have to change some paths to the ruby environment or your gitorious installation. The scripts are in a very early stage, so don’t expect any debugging output. If the service does not start, copy the startup command from the script and run them individually in a terminal to debugg the output.
sidenote: gitorious will not use ultrasphinx anymore, thinking_sphinx instead. The file name was kept.
Apache — See “Creating the Apache2 sites” and “Passenger”
The passenger module is not only a gem with native extension, it has also an apache module. To compile successfully passenger for apache on Solaris, an ugly hack was made. The problem is, that any compiler throws errors because of wrong compiler flags. There was also no possibility to change any of the flags even with the parameters you can push to the all-in-one script $(gem contents passenger | grep passenger-install-apache2-module). Thus, remove the clean operation in /var/ruby/1.8/gem_home/gems/passenger-3.0.18/bin/passenger-install-apache2-module
Also comment out the Task for cleaning in /var/ruby/1.8/gem_home/gems/passenger-3.0.18/build/apache2.rb
After these changes, the module will still not compile. But you can copy and paste the commands from the output, remove the compiler flags and recompile the module step by step. It’s pragmatic and it works. Going deeper in the module and finding the place where the flags are set will take more time (At least for myself).
Sites for Apache
For this installation, apache from default Oracle repository was used. See the configuration files under /etc/apache2/2.2. A very simple configuration for testing your installation can look like the following:
Gitorious and bundle — See “Configuring Gitorious”
For configuring gitorious for your system, you have to run bundle which you installed previously. Make sure that you use the right binary of bundle from the correct ruby environment located under /var/ruby/1.8/gem_home/bin/bundle. During bundeling of the gem’s for gitorious, you will probably receive some errors. The reason for the error could be one of the following:
- Missing include-files or packages during compilation of the native extension
- Install the package that is needed
- Install the development package, normally something with prefix/suffix like dev or devel
- Unknown compiler flags during compilation of the native extension
- Change the compiler in /usr/ruby/1.8/lib/ruby/1.8/sparc-solaris2.11/rbconfig.rb as described before
Gemfile and the mysql gem
To run bundle and gitorious successfull, you have to make some changes to the Gemfile in your gitorious root /opt/csw/apache2/share/htdocs/gitorious
- The version of rdiscount did not work with rmagick
- Change the line of rdiscount in the Gemfile to 1.3.4
- The imageupload could not convert the image correctly
- Change the version of paperclip to 2.4.5 and do not install the newest version of cocaine, use version 0.3.2 instead.
- rots will always ask for a password during bundeling.
- Specify the version in the Gemfile and remove the URL
The mysql gem is special because it is the only gem with native extension that will only compile with the compiler from SolarisStudio12. All other compilers will not work. In that sense, this is the only gem with native extension that is made for the SolarisStudio12 compiler.
Gitorious configuration file gitorious.yml
The necessary changes for the file config/gitorious.yml are described in the usual installation instructions. This is the gitorious.yml as used for our instance.
As you can see, it is a lot of work but worth it. We at the ICCLab have now a fully operating gitorious instance on a Solaris SPARC machine where we can get all the benefits from the OS. Of course, on a x86 machine running Solaris there is no difference but we expect, that the performance of the gitorious instance will be very good.