Wednesday May 27, 2009

My manager...

drives me absolutely up the wall!!!

Basically, all I do all day is review slide decks.  Day after day after day.  (The paperclip icon in Thunderbird makes my heart race.)  Anyway, today I'm walking through yet another slide deck when I get to a slide that starts out like this:

Apache Specific Tuning
 ListenBacklog 16384
 ServerLimit 8192
 MaxClients 8192
 MaxRequestsPerChild 0
 StartServers 128
 MinSpareServers 20
 MaxSpareServers 128

There's no further information!  That's the end!  Really!

/dev/tcp is ROTFL thinking about that ListenBacklog directive.  The swapper is looking for some extra volumes.  fork() and kill() and exit() are trying to get a room at the beach for the weekend.

It started to feel like I had held a match in my hand way too long as I started typing a furious response (which I had to delete).  I tried a slightly more tactful approach and had to delete that too.  After walking around the house five or ten times, I came back in and responded with a suggestion that I could cover that material properly at the Web Stack Deep Dive session at CommunityOne West in San Francisco next Wednesday.  He agreed.  Wish me luck!

2010 Update: I looked for the presentation recently and couldn't find it, so I uploaded it to this blog here.

Sunday Apr 05, 2009

Installing python-ldap in OpenSolaris 2009.06

build Python's LDAP extension on 2009.06

[Read More]

Tuesday Mar 17, 2009

Coppermine Photo Gallery install hint on OpenSolaris

If the install forms work but you get the error "PHP does not have MySQL support enabled.", install SUNWphp52-mysql and restart Apache.

$ pfexec pkg install SUNWphp52-mysql
$ svcadm restart apache22


mod_perl, CGI.pm, OpenSolaris

hello, world using CGI.pm, run by mod_perl

[Read More]

Friday Mar 06, 2009

Caching Dynamic Content with Apache HTTP Server on OpenSolaris 2008.11

Apache HTTP Server and mod_disk_cache can be used to cache dynamic content, and reduce load on web applications to improve server performance and user response time.




[Read More]

Friday Jan 23, 2009

[D]Tracing Apache request processing with pid-based tools

mod_backdoor and DTrace 

[Read More]

Tuesday Aug 19, 2008

Running a simple Ruby FastCGI application with Apache on OpenSolaris 2008.05

This is not as straightforward as one would hope for, so I put together a quick and dirty guide to get running.

 Prereqs: Ruby, Sun Studio Express, and AMP are installed.

  1. See if Ruby gem compile settings for native code need to be corrected.  This works around an OpenSolaris 2008.05 defect.

    If /usr/ruby/1.8/lib/ruby/1.8/i386-solaris2.11/rbconfig.rb refers to /opt/SUNWspro, rename the file and replace it with http://blogs.sun.com/prashant/resource/sun_studio/rbconfig.rb.   With that change, native code for gems will be successfully compiled with Sun Studio Express.

    (In OpenSolaris 2008.11 b95, a workable rbconfig.rb is present which will use gcc to compile native code for gems.)
  2. Build the FastCGI programming library using Sun Studio Express.

    $ wget http://fastcgi.com/dist/fcgi.tar.gz
    $ gtar -xzf fcgi-2.4.0.tar.gz
    $ cd fcgi-2.4.0
    $ CC=cc CXX=CC ./configure --prefix=/usr/local/fcgi-2.4.0
    $ make
    $ pfexec make install
  3. Install the Ruby fcgi gem.

    $ pfexec gem install fcgi -- --with-fcgi-lib=/usr/local/fcgi-2.4.0/lib \\
     --with-fcgi-include=/usr/local/fcgi-2.4.0/include 
  4. Create a FastCGI application.

    Put these two files in $HOME/fastcgi:
    • the app itself, myfcgi.rb
      require "fcgi"
      
      FCGI.each { |request|
          request.out.print "Content-Type: text/plain\\n\\nHello from #{__FILE__}"
          request.finish
      }
      
    • a wrapper, myfcgi
      
      #!/bin/sh
      ROOT=`dirname $0`
      exec ruby -I /var/ruby/1.8/gem_home/gems/fcgi-0.8.7/lib/ $ROOT/myfcgi.rb
      
      

      Make the wrapper executable:

      $ chmod 0755 myfcgi

  5. Enable FastCGI in Apache

    • Add this file to the directory /etc/apache2/2.2/conf.d; call it mod_fcgid.conf.  Be sure to substitute the proper directory on the Alias directive.

      LoadModule fcgid_module libexec/mod_fcgid.so
      SharememPath /var/run/fcgid_shm
      SocketPath /tmp/fcgid_sock/
      # !!!Replace /export/home/trawick/fastcgi with the location
      # where you placed the sample app.!!!
      Alias /fastcgi /export/home/trawick/fastcgi
      <Location /fastcgi>
          SetHandler fcgid-script
          Options ExecCGI
          allow from all
      </Location>
    • Restart Apache to pick up the new config.

      $ pfexec svcadm restart apache22
  6. Run the app

    $ firefox http://127.0.0.1/fastcgi/myfcgi
     
        


Hints for one issue or another were gathered from these and other places:

  1. http://www.hardhathosting.com/community/forums/archive/index.php/t-201.html
  2. http://blogs.sun.com/prashant/entry/where_s_my_ruby
  3. http://wiki.rubyonrails.org/rails/pages/Rails+on+CentOS+4.3+with+Apache+and+FastCGI+Simply

Todo:

  1. Understand why fcgi isn't in the default Ruby search path.
  2. Try with current 2008.11 development drivers and see if it is simpler.

Saturday Aug 09, 2008

Playing with Eventum on OpenSolaris, part 1

Eventum is a nice issue tracker from the folks at MySQL which you can set up on OpenSolaris in a matter of minutes.

I attended some classes for Sun SEs last week which covered dtrace, web stack, and other fun stuff.  I thought at the time how useful these tricks would have been at a former job where our team was using Eventum.  I wanted to automate the creation of issues for some recurring work, but didn't want to spend the time to wade through the Eventum source code to see what needed to be added to the database.  I'll try again with some new dtrace skills, but first I need a working Eventum testbed.

(Preamble: I started with a fresh install of the OpenSolaris 2008.05 iso image on my iMac using VirtualBox.)

Eventum needs an AMP stack for its run-time environment. These six commands will add AMP to a shiny new OpenSolaris 2008.05 installation:

  
  pfexec pkg refresh 
  pfexec pkg install amp 
  pfexec svccfg import /var/svc/manifest/network/http-apache22.xml 
  pfexec svcadm enable network/http:apache22 
  pfexec svccfg import /var/svc/manifest/application/database/mysql.xml
  pfexec svcadm enable application/database/mysql 
  

Next, add a new MySQL user for Eventum to use:

    
  pfexec /usr/mysql/bin/mysql –u root 
  mysql> GRANT ALL PRIVILEGES ON \*.\* TO 'eventum'@'localhost' 
       IDENTIFIED BY 'your-eventum-db-password' WITH GRANT OPTION; 
  mysql><CTRL>-d 
  

Next, download and install Eventum. Point your browser to http://dev.mysql.com/downloads/other/eventum/ and download the latest level (currently eventum-2.1.1) to your Desktop. Unpack it under the directory tree served by Apache:

    
  cd /var/apache2/2.2/htdocs/ 
  pfexec gtar -xzf ~/Desktop/eventum-2.1.1.tar.gz 
  pfexec mv eventum-2.2.1 eventum
  

Point your browser to http://127.0.0.1/eventum/ and fill out a form to finish the Eventum installation. Here are the changes you need to make on the installation form:

Field Value
MySQL Server Hostname localhost
MySQL Database eventum
Create Database checkbox checked
MySQL Username eventum
MySQL Password your-eventum-db-password
Sender your-user-id@localhost
Hostname localhost
Port 25

Press the Start Installation button.

On the success page, note the initial administrator Email address and Password to use to log in.

Now hide Eventum's setup directory to finish installation:

 pfexec chmod 0700 /var/apache2/2.2/htdocs/eventum/setup/
 

Next we'll disable the initial administrator user id and add a new one.  Point your browser to http://127.0.0.1/eventum/ again, log in with the initial administrator user/pass, follow the Administration link at the top, then follow the Manage Users link and add yourself as an administrator. Next, disable the special default admin user/pass by checking the box next to “Admin User” , setting the status drop-down to Inactive, and pressing the “Update Status” button. Logout, then confirm you can log in with your new id but not with the default admin id. Add user ids for the other folks on your team and you're ready to go.

References:

  1. http://dlc.sun.com/osol/docs/content/OSDEV/gentextid-207.html
  2. http://eventum.mysql.org/

Friday Jul 25, 2008

<strike>set up printing from OpenSolaris</strike>

Samsung ML-1710 laser autodetected and configured under native OpenSolaris

[Read More]
About

Jeff Trawick

Search

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