Programmatically configuring a Web Server


How do I build custom installations for my vertical Web applications?

Customizing an installation of Web Connection is fairly straight forward. You can either customize the wwAppWizard and associated Setup UI classes to fit your needs for a generic installation or you can create a totally custom interface that simply performs the steps via code.

The following code uses the wwWebServer class which can be used to configure several Web servers (IIS, PWS, Apache and WebSite - See WC docs for server codes):

DO WCONNECT
SET CLASSLIB TO WEBSERVER ADDITIVE

oConfig = CREATE('wwWebserver','IIS4')  && IIS4 = IIS5 too
lcWebRoot = oConfig.GetWebRootPath()

lcWebRoot = InputForm(PADR(lcWebRoot,80),
                                       'Please enter the Web Root Path:',
                                       'West Wind Web Configuration')
IF EMPTY(lcWebRoot)
   RETURN .F.
ENDIF
lcWebRoot = lower(ADDBS(lcWebRoot))

oConfig.CreateVirtual('wconnect',lcWebRoot + 'wconnect')
oConfig.CreateVirtual('wwstore',lcWebRoot + 'wwstore')
oConfig.CreateVirtual('wwThreads',lcWebRoot + 'wwthreads')

lcDLL = lcWebRoot + 'wconnect\wc.dll'

*** Create script maps
oConfig.CreateScriptMap('wc',lcDLL)
oConfig.CreateScriptMap('wcs',lcDLL)
oConfig.CreateScriptMap('fxp',lcDLL)
oConfig.CreateScriptMap('wwt',lcDLL)  && wwThreads
oConfig.CreateScriptMap('pho',lcDLL)  && PhotoAlbum
oConfig.CreateScriptMap('wwd',lcDLL)  && wwdemo

oConfig.CreateScriptMap('wws',lcDLL)   && Web Store
oConfig.CreateScriptMap('wst',lcDLL)   && West Wind

*** Register COM objects
RegisterOleServer(lcWebRoot + 'wwwebtools.dll')

*** Register Active Bar for offline reader
IF FILE('wwreader\actbar.ocx')
   loAPI = CREATE('wwapi')   
   COPY FILE ('wwreader\actbar.ocx') to (loAPI.GetSystemDir() + 'actbar.ocx')
   RegisterOleServer( loAPI.GetSystemDir() + 'actbar.ocx')
ENDIF   

IF FILE('wcComDemoConfig.dll')
   RegisterServer(SYS(5) + CURDIR() + 'wcComDemoConfig.dll')
ENDIF   

#IF .F.
  *** ADDITIONAL NOTES
  MSXML.dll Update
#ENDIF

To uninstall virtuals and scriptmaps you can pass blank second parameters and to unregister COM objects use the llUnregister flag on RegisterOleServer().


Last Updated: 05/04/00