Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
HOWTO_FTP.txt | 2012-09-07 | 2.4 kB | |
Changelog.txt | 2012-09-05 | 527 Bytes | |
README.txt | 2012-09-05 | 2.0 kB | |
mod_scgi.zip | 2012-09-05 | 42.8 kB | |
Totals: 4 Items | 47.9 kB | 0 |
It is possible to have the IBM HTTP Server on the iSeries serving up web pages dynamically generated by iSeriesPython apps like CherryPy or Django via the mod_scgi apache module and the flup.server.scgi scgi-wsgi gateway. To install mod_scgi on your system: - Download mod_scgi.zip - Create a save file MOD_SCGI in QGPL. - Decompress and ftp the mod_scgi.savf file to your "AS/400" (binary mode) - Run RSTOBJ OBJ(*ALL) SAVLIB(QGPL) DEV(*SAVF) SAVF(QGPL/MOD_SCGI) The following directives are added to the configuration file for the HTTP Server instance that will utilize mod_scgi: # Load the mod_scgi module LoadModule scgi_module /QSYS.LIB/QGPL.LIB/MOD_SCGI.SRVPGM # Set up location to be served by an SCGI server process SCGIMount /dynamic/ 127.0.0.1:4000 The path specified in the SCGIMount directive needs to be whatever path is appropriate. The scgi-wsgi gateway that is used is flup.server.scgi which is available for download from http://trac.saddi.com/flup. After downloading flup add it to /python27/site-packages. When using flup.server.scgi as a gateway do not specify ‘localhost’ in the bindAddress, but instead specify ‘127.0.0.1’. Here is an example of a simple CherryPy WSGI application: from flup.server.scgi import WSGIServer import cherrypy class HelloWorld: def index(self): """ This is where the html generation code goes. """ return "Hello world from CherryPy!" index.exposed = True my_app = cherrypy.Application(HelloWorld(), script_name="/dynamic", config=None) WSGIServer(my_app, bindAddress=('127.0.0.1', 4000)).run() Submit this app to batch (being sure to allow multithreading), then start the IBM HTTP Server instance that has been configured to load the mod_scgi module. Open a web browser with the appropriate URL and you should be greeted with: Hello World from CherryPy!