Changes between Initial Version and Version 1 of DaAtlases

05/08/06 13:34:25 (13 years ago)



  • DaAtlases

    v1 v1  
     1== Moving the Digital Anatomist Atlases == 
     3On sphenoid: 
     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 
     11make install 
     13Add this to Apache httpd config `/etc/httpd/conf.d/local-vhost.conf`: 
     15NameVirtualHost *:80 
     16<VirtualHost *:80> 
     17  ServerName 
     18  ServerAlias sphenoid sphenoid.biostr 
     19  ServerAlias www9 www9.biostr 
     21  DirectoryIndex index.html index.htm index.shtml 
     23  <Location "/"> 
     24  Options +Indexes 
     25  </Location> 
     27  # Digital Anatomist Atlases 
     28  #ServerName 
     29  #ServerAlias sphenoid sphenoid.biostr 
     30  ScriptAlias /cgi-bin/DA/ /usr/local/www/htdocs/DA/bin/ 
     31  DocumentRoot /usr/local/www/htdocs 
     34Add to `/etc/logrotate.d/httpd`: 
     36     weekly 
     37     rotate 40 
     38     compress 
     39     delaycompress 
     41Add to `/etc/webalizer.conf` 
     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/ 
     51HideReferrer    www9/ 
     53HideReferrer   Direct Request 
     55Create `/etc/logrotate.d/da-atlases` 
     57/usr/local/www/htdocs/DA/logs/*_log { 
     58    weekly 
     59    rotate 40 
     60    compress 
     61    missingok 
     62    notifempty 
     63    create 
     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`: 
     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 
     79== Debugging == 
     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. 
     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: 
     92export REQUEST_METHOD 
     93myecho << EOF 
     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: 
     105use CGI qw/:standard/; 
     106print "Content-type: text/plain\n\n"; 
     107foreach $var (sort keys %ENV) { 
     108  print "$var=\"$ENV{$var}\"\n"; 
     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): 
     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="" 
     127export HTTP_KEEP_ALIVE="300" 
     128export HTTP_REFERER="^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="" 
     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="" 
     139export SERVER_ADMIN="" 
     140export SERVER_NAME="" 
     141export SERVER_PORT="80" 
     142export SERVER_PROTOCOL="HTTP/1.1" 
     143export SERVER_SIGNATURE="<ADDRESS>Apache/1.3.26 Server at 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" 
     148gdb ../../bin/imageform 
     149#../../bin/imageform < input 
     150#../../bin/imageform << EOF 
     151#ffpath="Index/Splash Page"&atlas:="Neuroanatomy"&strID:="-1" 
     154For the gdb run, I put the POST input line in a file. The session: 
     156(gdb) run < input 
     157Starting program: /usr/local/www/htdocs/DA-5.2/bin/imageform < input 
     159Program received signal SIGXFSZ, File size limit exceeded. 
     1600x400e6404 in write () from /lib/ 
     161(gdb) backtrace 
     162#0  0x400e6404 in write () from /lib/ 
     163#1  0x4013ae48 in __check_rhosts_file () from /lib/ 
     164#2  0x4008ce88 in _IO_do_write () from /lib/ 
     165#3  0x4008cde6 in _IO_do_write () from /lib/ 
     166#4  0x4008c781 in _IO_file_close_it () from /lib/ 
     167#5  0x4008412d in fclose () from /lib/ 
     168#6  0x080494e9 in main (argc=1, argv=0xbffffd44, envp=0xbffffd4c) at imageform.c:348 
     171Line 348 is the logfile write. It was a short step from there to find 
     172the 2GB file.