spyce
home
license
community
download
examples
resources
wishlist
contrib (@sf)
documentation
intro
lang
runtime
modules
tags
install
exits
sourceforge
statistics
freshmeat

Documentation - Install
[[ Spyce ]]
Python Server Pages
by Rimon Barr

Prev: 6.3.2 - Automated installation - Windows executable Up: 6.3 - Installation Methods Next: 6.4 - Configuration Specifics

6.3.3. Manual installation

One could also install Spyce manually from the source tarball (using FastCGI), as follows:

  • Ensure that you have Apache and FastCGI installed and functioning.
  • Extract the source tarball into some directory.
  • Execute make in this directory to compile the python modules and build the documentation.
  • (Optional) As root user, execute "make install", to install spyce into /usr/share/spyce.
  • Create a link to the command-line executable:
    "ln -sf /usr/share/spyce/run_spyceCmd.py /usr/bin/spyce"
    or wherever you have chosen to install it.
  • Create a link to the documentation in /usr/share/doc:
    "ln -sf /usr/share/spyce/docs/ /usr/share/doc/spyce"
    or wherever you have chosen to install it.
  • Add the following lines to your /etc/httpd/conf/httpd.conf file, and replace the XXX with the appropriate path.
    # XXX = Spyce program directory
    
    # This section asks your web server to serve the 
    # Spyce documentation from http://localhost/spyce/.
    
    Alias /spyce/ "XXX/docs/"
    <Directory "XXX/docs">
        Options Indexes
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
    ###################
    # Spyce via cgi or fcgi
    
    # This section is the default. It provides a default
    # mechanism to process .spy files. On a vanilla Apache
    # installation this will be done via CGI, which is 
    # quite slow. If the FastCGI module is properly 
    # installed, should automatically be used instead.
    
    AddHandler spyce-cgi-handler spy
    Action spyce-cgi-handler "/spyce-cgi/run_spyceCGI.py"
    ScriptAlias /spyce-cgi/ "XXX/"
    <Location /spyce-cgi/>
      <IfModule mod_fastcgi.c>
        # If mod_fastcgi not installed, we get plain cgi
        SetHandler fastcgi-script
      </IfModule>
    </Location>
    # If FastCGI is installed, it will be picked up 
    # automatically. On Linux, you can also omit this section 
    # and use a dynamic fcgi server instead.
    <IfModule mod_fastcgi.c>
      FastCgiServer "XXX/run_spyceCGI.py" -port 7654 -initial-env FCGI_PORT=7654
    </IfModule>
    # On Windows ONLY, please uncomment the following line.
    # ScriptInterpreterSource registry
    
    ###################
    # Spyce via mod_python
    
    # This section allows Spyce to be invoked via the mod_python,
    # yet another alternative with decent performance. Comment
    # the CGI/FastCGI section above entirely, and uncomment the
    # following lines, if you choose to use this instead.
    # (Note that the doubly commented lines, can remain commented
    # depending on your configuration).
    
    #<IfModule mod_python.c>
    #  AddHandler python-program .spy
    #  PythonHandler run_spyceModpy::spyceMain
    #  PythonPath "sys.path+[r'XXX']"
    #  #PythonOption SPYCE_CONFIG "/mydir/spyce.conf"
    #  #PythonOptimize On
    #</IfModule>
    
    ###################
    # Spyce via proxy (on port 8000)
    
    # This section direct Apache to process Spyce requests via
    # a Spyce proxy server. Comment the CGI/FastCGI section above,
    # and uncomment the following lines.
    # NB: Remember to start the Spyce proxy server...
    #   spyce -l -p 8000 /document_root
    # If you would like to run your server on another port,
    # start the proxy on that port (using the -p switch)
    # and change the RewriteRule below accordingly.
    
    #<IfModule mod_rewrite.c>
    #  RewriteEngine On
    #  RewriteRule ^(.*\.spy) http://localhost:8000$1 [p]
    #</IfModule>
    
    
  • If you are installing on Windows, please also read follow the following instructions.
  • Restart Apache, and you should be set.
Test the installation by browsing:
  http://localhost/spyce/examples/hello.spy

Alternative CGI configuration: The alternative CGI configuration directs the webserver to execute the Spyce file itself, not the Spyce engine. The Spyce file should have execute permissions for the web server, and the first line should be:

  #! /usr/bin/python /home/username/spyce/run_spyceCGI.py
Then add the following line to the httpd.conf, or to the .htaccess file in the same directory.
  AddHandler cgi-script spy
And ensure that the directory itself has the ExecCGI option enabled.

Please refer to the Apache documentation, specifically ExecCGI option, Directory, Location, AllowOverride and Apache CGI documentation, for more information on how to get a standard CGI setup working.


Prev: 6.3.2 - Automated installation - Windows executable Up: 6.3 - Installation Methods Next: 6.4 - Configuration Specifics


© 2002-08 Rimon Barr
email: rimon@acm.org
Spyce Powered SourceForge Logo [[ Spyce ]]
Python Server Pages
version 1.3.13