Wednesday Apr 29, 2009

SMF manifest for Nginx

Here's an SMF manifest for Nginx.  You'll need to tweak it for your location of Nginx.  You can create an nginx user and group to run the web server as(highly recommended), or tweak my script to run as root(please don't do this).

The steps?

  1. Download the SMF from here
  2. groupadd nginx
  3. useradd -d /export/home/nginx -g nginx nginx
  4. change all occurrances of "/usr/nginx/sbin/nginx" to point to where ever your nginx is installed.
  5. You may remove the -c option in the nginx invocation if you do not want to place your nginx config file in that directory(or just want to use the default one).
  6. next, import the SMF script.  svccfg import nginx.smf
  7. run svcs -vx to make sure everything went well. It should have, if you followed all the steps above.( else you'll be pointed to a log file for further debugging )
  8. You are set.
  9. Optional:  add service dependendies on the mysql and thin/mongrel services on your system since nginx probably won't be of much use if you don't have those running.

Monday Apr 27, 2009

Git is in OpenSolaris-dev.

I just noticed that git is available in the OpenSolaris dev repository.  No more compiling from source.  Very cool.  All the volunteer work done to spruce up FOSS support in the OSOL community is paying off. 

You can either get it by running "pkg image-update" on your OpenSolaris instance, or wait for the Ruby on Rails EC2 image which I'm creating right now, to get a preconfigured set of tools, gems, web servers etc.,


Friday Apr 17, 2009

To update Ruby, or any other application on OpenSolaris . . .

My recent post about updating Ruby on OpenSolaris can be summed up with the following steps:

(1) set the OpenSolaris developer repository as the package authority(pkg set-authority -O http://pkg.opensolaris.org/dev opensolaris.org)

(2) run "pkg image-update".

This raised questions about whether an image update was necessary just to update Ruby, which is a well behaved application with no direct ties to operating system internals.

The answer, quite simply, is a YES.  This applies to any application that is provided by  the main OpenSolaris (or dev) repositories, not just Ruby.  One can only update the application to a level of the package that is delivered on the build of the OS that one is running. 

Does that sound confusing?

 Lets say your OS level is 101 ( use "uname -a" to find that out).

root@domU-12-31-39-02-F5-56:/var/ruby/1.8/gem_home/bin# uname -a
SunOS domU-12-31-39-02-F5-56 5.11 snv_101b i86pc i386 i86xpv Solaris

Now lets look at an application installed on this machine (gmake, for example).  Use "pkg info" to get information about an installed package.

root@domU-12-31-39-02-F5-56:/var/ruby/1.8/gem_home/bin# pkg info SUNWgmake
          Name: SUNWgmake
       Summary: gmake - GNU make
      Category: Development/GNU
         State: Installed
     Authority: opensolaris.org
       Version: 3.81
 Build Release: 5.11
        Branch: 0.101
Packaging Date: Wed Nov 19 22:11:01 2008
          Size: 696.26 kB
          FMRI: pkg:/SUNWgmake@3.81,5.11-0.101:20081119T221101Z

gmake 3.81 is installed, and this was built on build 101 of Solaris Nevada (build 101 is the value that corresponds to the "Branch" tag).

Now, what this means is that one will not be able to update gmake to a version higher than the one bundled with build 101 without running "pkg image-update".  In this case, that is gmake version 3.81.

Updating individual packages is possible with the IPS framework, and that means that non Sun packages can be updated.  The packages that are delivered by Sun, however, cannot be updated thus.  These packages are listed as dependencies for the meta-package called "entire". "entire" imposes the restriction on what build number a package could be updated to. 

The IPS team is working on loosening this (reboot required) restriction.   But until then, please point your pkg command to http://pkg.opensolaris.org/dev  (by uttering pkg set-authority -O http://pkg.opensolaris.org/dev opensolaris.org ) and then say " pkg image-update ".

This will bring up Ruby 1.8.7p72 and Rubygems 1.3.1.  There is work happening to make Rails available too. stay tuned.






About

prashant

Search

Archives
« April 2009 »
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18
19
20
21
22
23
24
25
26
28
30
  
       
Today