Changes between Initial Version and Version 1 of DaAtlases


Ignore:
Timestamp:
05/08/06 13:34:25 (12 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DaAtlases

    v1 v1  
     1== Moving the Digital Anatomist Atlases == 
     2 
     3On sphenoid: 
     4{{{ 
     5rsync -Sa -v  --numeric-ids -e 'ssh -c blowfish' vertex:/usr/local/www /usr/local 
     6up2date ImageMagick-perl  
     7cd /usr/local/www/htdocs/DA-5.2/src/c 
     8vi ../../local/local.h 
     9make clean 
     10make 
     11make install 
     12}}} 
     13Add this to Apache httpd config `/etc/httpd/conf.d/local-vhost.conf`: 
     14{{{ 
     15NameVirtualHost *:80 
     16<VirtualHost *:80> 
     17  ServerName sphenoid.biostr.washington.edu 
     18  ServerAlias sphenoid sphenoid.biostr 
     19  ServerAlias www9 www9.biostr www9.biostr.washington.edu 
     20 
     21  DirectoryIndex index.html index.htm index.shtml 
     22 
     23  <Location "/"> 
     24  Options +Indexes 
     25  </Location> 
     26 
     27  # Digital Anatomist Atlases 
     28  #ServerName sphenoid.biostr.washington.edu 
     29  #ServerAlias sphenoid sphenoid.biostr 
     30  ScriptAlias /cgi-bin/DA/ /usr/local/www/htdocs/DA/bin/ 
     31  DocumentRoot /usr/local/www/htdocs 
     32</VirtualHost> 
     33}}} 
     34Add to `/etc/logrotate.d/httpd`: 
     35{{{ 
     36     weekly 
     37     rotate 40 
     38     compress 
     39     delaycompress 
     40}}} 
     41Add to `/etc/webalizer.conf` 
     42{{{ 
     43LogFile        /var/log/httpd/access.log.1 
     44OutputDir       /usr/local/www/htdocs/webalizer 
     45Incremental    yes 
     46ReportTitle    Usage Statistics for 
     47TopReferrers    40 
     48HideSite       *vertex 
     49HideReferrer   vertex/ 
     50HideReferrer    vertex.biostr.washington.edu 
     51HideReferrer    www9/ 
     52HideReferrer   www9.biostr.washington.edu 
     53HideReferrer   Direct Request 
     54}}} 
     55Create `/etc/logrotate.d/da-atlases` 
     56{{{ 
     57/usr/local/www/htdocs/DA/logs/*_log { 
     58    weekly 
     59    rotate 40 
     60    compress 
     61    missingok 
     62    notifempty 
     63    create 
     64} 
     65}}} 
     66 
     67Since logwatch doesn't recognize the entries, it will report all requests; to avoid 
     68the huge resulting emails, add these entries to `/etc/log.d/conf/services/http.conf`: 
     69{{{ 
     70*Remove = DA/atlasUpdater 
     71*Remove = DA/custPin 
     72*Remove = DA/drawStuff 
     73*Remove = DA/fupload 
     74*Remove = DA/imageform 
     75*Remove = DA/PageMaster 
     76*Remove = DA-ATLASES 
     77}}} 
     78 
     79== Debugging == 
     80 
     81 
     82The DA input log file `/usr/local/www/htdocs/DA/logs/if_log` got to 2GB  
     83and libc was failing on the log file write since that filesystem couldn't  
     84handle files any bigger. I moved the old logs to a old_logs directory. 
     85 
     86If anyone's interested read on for a few details (this mostly for my own 
     87records). Debugging a CGI program in C was a bugger; I got this helpful 
     88hint from O'Reilly _Apache: TDG_ (via Safari online) for a script: 
     89{{{ 
     90#!/bin/sh 
     91REQUEST_METHOD=POST 
     92export REQUEST_METHOD 
     93myecho << EOF 
     942315_order=20&2316_order=10&card_type=Amex 
     95EOF 
     96}}} 
     97 
     98I kept running into more env variables that imageform uses, so 
     99I temporarily replaced ../../bin/imageform with this perl CGI 
     100to dump the actual web request env: 
     101 
     102{{{ 
     103#!/usr/bin/perl 
     104 
     105use CGI qw/:standard/; 
     106print "Content-type: text/plain\n\n"; 
     107foreach $var (sort keys %ENV) { 
     108  print "$var=\"$ENV{$var}\"\n"; 
     109} 
     110}}} 
     111 
     112Finally, I combined the two and ran gdb on the result and got the actual 
     113failure (oh, and built with debug flags in ../../local/Makefile.local): 
     114 
     115{{{ 
     116#!/bin/bash 
     117export CONTENT_LENGTH="88" 
     118export CONTENT_TYPE="application/x-www-form-urlencoded" 
     119export DOCUMENT_ROOT="/usr/local/www/htdocs" 
     120export GATEWAY_INTERFACE="CGI/1.1" 
     121export HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" 
     122export HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7" 
     123export HTTP_ACCEPT_ENCODING="gzip,deflate" 
     124export HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5" 
     125export HTTP_CONNECTION="keep-alive" 
     126export HTTP_HOST="vertex.biostr.washington.edu" 
     127export HTTP_KEEP_ALIVE="300" 
     128export HTTP_REFERER="http://vertex.biostr.washington.edu/cgi-bin/DA/PageMaster?atlas:Neuroanatomy+ffpathIndex:Splash^Page+2" 
     129export HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2" 
     130export PATH="/bin:/usr/bin:/sbin:/usr/sbin" 
     131export QUERY_STRING="" 
     132export REMOTE_ADDR="128.95.228.11" 
     133export REMOTE_PORT="58785" 
     134export REQUEST_METHOD="POST" 
     135export REQUEST_URI="/cgi-bin/DA/imageform" 
     136export SCRIPT_FILENAME="/usr/lib/cgi-bin/DA/imageform" 
     137export SCRIPT_NAME="/cgi-bin/DA/imageform" 
     138export SERVER_ADDR="128.95.10.19" 
     139export SERVER_ADMIN="webmaster@sig.biostr.washington.edu" 
     140export SERVER_NAME="vertex.biostr.washington.edu" 
     141export SERVER_PORT="80" 
     142export SERVER_PROTOCOL="HTTP/1.1" 
     143export SERVER_SIGNATURE="<ADDRESS>Apache/1.3.26 Server at vertex.biostr.washington.edu Port 80</ADDRESS> 
     144export " 
     145export SERVER_SOFTWARE="Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6c mod_perl/1.26" 
     146export UNIQUE_ID="Ql63w4BfChMAAAJhohA" 
     147 
     148gdb ../../bin/imageform 
     149#../../bin/imageform < input 
     150#../../bin/imageform << EOF 
     151#ffpath="Index/Splash Page"&atlas:="Neuroanatomy"&strID:="-1" 
     152#EOF 
     153}}} 
     154For the gdb run, I put the POST input line in a file. The session: 
     155{{{ 
     156(gdb) run < input 
     157Starting program: /usr/local/www/htdocs/DA-5.2/bin/imageform < input 
     158 
     159Program received signal SIGXFSZ, File size limit exceeded. 
     1600x400e6404 in write () from /lib/libc.so.6 
     161(gdb) backtrace 
     162#0  0x400e6404 in write () from /lib/libc.so.6 
     163#1  0x4013ae48 in __check_rhosts_file () from /lib/libc.so.6 
     164#2  0x4008ce88 in _IO_do_write () from /lib/libc.so.6 
     165#3  0x4008cde6 in _IO_do_write () from /lib/libc.so.6 
     166#4  0x4008c781 in _IO_file_close_it () from /lib/libc.so.6 
     167#5  0x4008412d in fclose () from /lib/libc.so.6 
     168#6  0x080494e9 in main (argc=1, argv=0xbffffd44, envp=0xbffffd4c) at imageform.c:348 
     169}}} 
     170 
     171Line 348 is the logfile write. It was a short step from there to find 
     172the 2GB file.