Tested with Netscape 4.x and MSIE 5.x. Javascript in MSIE 4 is broken and not supported.
Works best with recent Netscape 4.x browsers, because of their "server-push" and PNG support
 
In the following examples we assume a location of your http server as
/usr/local/etc/httpd/. We also assume that you have basic knowledge how to configure
your http server.
 
 
   
	 ln -s /whatever/w2h/htdocs /usr/local/etc/httpd/htdocs/w2h  
       Note: Instead of using symbolic links you can define
       aliases in the server configuration. But, the W2H distribution
       contains  a number of symbolic links itself. If you don't allow
       your http server to follow symbolic links for the W2H
       space, you must replace all symbolic links by real
       copies - not recommended. 
       Anyway, the result is that you have a directory w2h accessible for running CGI
       scripts, and the subdirectory w2h/htdocs accessible for serving HTML documents. 
   
          <Directory /usr/local/etc/httpd/cgi-bin/w2h> 
       And here an example what to put into an .htaccess file
       in the directory w2h
        
          AuthName "GCG WWW Interface" 
       More about access configuration can be found at
       http://hoohoo.ncsa.uiuc.edu/
       or in your server documentation. 
   
       
   
          cc -o setuser setuser.c
        
       Now you must become root because setuser must be a setuid program:
        
          su 
       Read carefully about
       security
       aspects and about the recommended location of this file. Be sure not
       to let it here, in the subdirectory w2h! 
   
       
       You can also investigate other options using:
        
   
       
       Read also comments in the file bin/w2h.com because of the
       security considerations.
        
   
        
        
        
        
        
        
       Now, open your editor and go through the file
       Cfg.pl and change there what is necessary. The file is full of
       comments and hints what to edit and why. It is written in perl but editing should be
       straightforward even for a non-perlist. 
       
       Details about the graphics conversion configuration
       (PSCONVERT and HP2XX) are
       explained below.
        
   
       W2H has special support to convert graphical outputs into
       common formats on the web: 
        
        
       There is an excellent publicly available software package
       hp2png to convert files
       from HPGL format into
       Portable Network Graphics format (PNG).
        
       For your convenience, the hp2xx-png package is
       included in the W2H distribution,
       together with two other necessary library packages (libpng and zlib).
       Their compilation is pretty straightforward (I have put down a
       few hints on it in a
       separate file).
       The packages are distributed in the subdirectory graphic-viewer. 
       To enable the PNG option you have to specify the name and the
       location of the compiled hp2xx
       executable in the $HP2XX variable in Cfg.pl. By the way, this graphical
       format is automatically disabled if you are using an older
       version of Netscape or IE.
        
	  
       For converting color postscript output files on the fly into GIF format, W2H needs
       the convert utility
       of the ImageMagick
       package.
        
       Further you need the postscript converter
        ghostscript (gs)
       with ppmraw as one of its output devices. This can be checked with:
        
       gs -help
        
       Now make sure that gs is in $PATH you have specified in Cfg.pl.
       Then you have to put the location of the convert utility in the $PSCONVERT
       variable of Cfg.pl.
        
       
      
            
	  
       Wrapper script: I have received a comment from Volker
       Winkelmann (Winkelmann@rrz.Uni-Koeln.DE)
       stating that both convert and hp2xx use shared libraries, which are not
       necessarily installed in any default library directory. For these situations Volker
       suggested to write a script-wrapper setting the library path. For example you can
       create the following script, name it convert and put it on the path:
        
       Also Aengus Stewart (aengus.stewart@icrf.icnet.uk) has suggested that
       compilation ImageMagick could be a tedious job (due to all the other libs
       that are required), so it may be better to install precompiled binaries.
       It worked fine for him, except that in the wrapper script (above) he also
       had to set DELEGATE_PATH to point to the location of delegates.mgk.
        
   
        
	      
	  
       It is also worth to check if your system understands the setsid() function.
       Mostly, it does, but to be sure run util.setpgrp and check the results
       according to the comments in the script itself. This function is used in W2H
       for killing running processes. If you meet any problems, please contact me
       (tell me your operating system - command uname -rs, version of your
       perl - command perl -v, and the results of the util.setpgrp script). 
   
       Remember that this utility uses 
       the file Cfg.pl mentioned above, so this file must be already properly configured. 
       Run this utility and see that all help files are created. It must be run within a GCG
       session because it uses GCG's logical naming services:
       
        
        
        
   
       For GCG: You can also consider to copy the CGI scripts creating application help documents somewhere
       else, where they are still accessible and runable as CGI scripts but without authentication.
       Then you can call the application help pages also from a starting page (or from somewhere else)
       without asking users to authenticate themselves only to see the
       help pages.
       These scripts are called w2h.helplist and nph-w2h.helpapp. 
   
   
   
 
That's it. I hope I did not forget anything important. Please,
send us
reports of any bugs, problems or inconveniences during installation.
 
 
 
The Installation Step By Step
  
	 ln -s /whatever/w2h /usr/local/etc/httpd/cgi-bin/w2h 
       
              Options Indexes FollowSymLinks
              AuthName "GCG WWW Interface"
              AuthUserFile /usr/local/etc/httpd/conf/.htpasswd 
              AuthType Basic
              <Limit GET POST>
              order deny,allow
              require valid-user
              </Limit>
              </Directory>
       
              Options Indexes FollowSymLinks
              AuthUserFile /usr/local/etc/httpd/conf/.htpasswd 
              AuthType Basic
              <Limit GET POST>
              order deny,allow
              require valid-user
              </Limit>
       
              chown root setuser
              chgrp root setuser
              chmod u+s setuser
              exit
       
           perl util.install
       
       
           perl util.install -h
       
       
       
	    % cp Cfg.pl.v10.dist Cfg.pl
	    % cp Cfg.pl.GCG+EGCG.dist Cfg.pl
	    % cp Cfg.pl.emboss.dist Cfg.pl
	    (Note: currently you can use 1 installation of W2H for both, but you need 2 URLs and
	      2 independent configurations)
	    % cp Cfg.pl.emboss+GCG.dist Cfg.pl
	    % cp Cfg.pl.emboss.dist Cfg.pl.emboss_only
	    % cp Cfg.pl.v10.dist Cfg.pl.gcg_only
	    % cp Cfg.pl.v8.dist Cfg.pl or 
	    % cp Cfg.pl.v9.dist Cfg.pl
       
       
       Note that this step can be done also later. So if it is now too
       confusing, skip this step and come here later.
       
	 
         
       
       Note: The PNG format is not supported by older browsers
	      (supported since Netscape 4.04 or IE 5.5)
       
       If you want to get graphical outputs in GIF format (which I recommend),
       you have to download and install some additional publicly available programs
       (which are not distributed together with W2H, but are easily available even
       in binary form for different platforms). Moreover, these programs are used
       so often that there is a big change that you have them already on your system.
       
	   
        #!/bin/csh
       
       where the libMagick.a resides in /my/graphics/lib.
        #
        #wrapper for ImageMagick Tool's convert,
        #because Shared Libs mut be defined
        #
        setenv LD_LIBRARY_PATH /my/graphics/lib:/usr/lib:/usr/lib/X11
        exec /my/graphics/bin/convert  $*
       
	 
	      (This program is a bit outdated and for GCG only.)
           ...start GCG session...
       
           ./nph-w2h.helpapp
           ./nph-w2h.helpdesc
       
	      
	 
Last modified: Mon Dec 16 13:29:14 2002