rdg,
Just guessing here ... don't REALLY know a lot about mod_python, but
here goes ( open mouth insert foot ... ).
On Mon, 2002-08-19 at 20:27, rdg wrote:
> Ray --
>
> OK, I seem to have most of what you told me working, after a long
> night's work.
> Here is some of the config stuff you asked to see. Remember, I am using
> modPythonAdapter.
> My directories are /pub/httpd/tj-test <=== this is were
> Webware puts it app sub-dirs
> /pub/httpd/tj-test/TJweb <=== my web app
> context directory
>
>
> /etc/apache/httpd.conf
> ---------------------------
> LoadModule python_module /usr/lib/apache/1.3/mod_python.so ## for
> python support
>
> AddHandler python-program
> .psp ## for psp support
> PythonPath "sys.path+['/usr/local/Webware/WebKit']"
> PythonHandler modpHandler::pspHandler
> PythonOption AppWorkDir /pub/httpd/tj-test
>
> <VirtualHost *>
> DocumentRoot /pub/httpd/tj-test
> (other stuff here...)
> #
> # Added For WebWare / WebKit Support - rdg 7/16/02
> #
> RewriteEngine On ##
> solves the "/wk" problem
> RewriteRule ^(.*) /wk/$1 [L,PT]
> <Location /wk> ##
> location to server from
> SetHandler python-program
> # add the directory that contains ModPythonAdapter.py
> PythonPath "sys.path+['/usr/local/Webware/WebKit']"
> PythonOption AppWorkDir /pub/httpd/tj-test
> PythonHandler ModPythonAdapter
> PythonDebug On
> </Location>
> </VirtualHost>
>
>
> Application.config
> --------------------
> 'Contexts': {
> # 'Admin': '%(WebKitPath)s/Admin',
> # 'Examples': '%(WebKitPath)s/Examples',
> # 'Docs': '%(WebKitPath)s/Docs',
> # 'Testing': '%(WebKitPath)s/Testing',
> 'TJweb': '/pub/httpd/tj-test/TJweb',
> 'default': 'TJweb',
> },
>
>
> My last questions (ha ha ha) ;-))
>
> (1) Why would I have other contexts? How would they be used/referenced
> in my apps?
To run TJweb2. You can also accomplish it by putting everything under
tjweb, and having a TJweb1 & TJweb2 subdir's, and using mod-rewrite to
take care of them being different subdir's. In case you do want to run
multiple contexts from the same server you can:
add a new context:
'TJweb2': '/pub/httpd/tj-test/TJweb2',
restart the AppServer.
and from the looks of the above httpd.conf file you should now be able
to do : http://localhost/TJweb2 or http://localhost/wk/TJweb2 and it
will bring up that second context.
Now having typed all of this I have to say that Ian's response was much
clearer than mine, and I would highly recommend going with whatever he
or Geoff or Chuck or Mike or Matt advises.
> (2) Currently all of my web app is in the context directory. This
> includes html, psp, py, etc.
> This is not what I want in the end, of course. I probably want to put
> the .py (and the resulting .pyc)
> code into a different directory. I am not sure how to implement this.
If the .py doesn't subclass any of the WebWare code then it's just a
good utility code, so you can drop it somewhere in your python
site-packages and just load it up as needed. My .02.
Hope this helps.
Ray
> -rdg
>
>
> On Mon, 2002-08-19 at 14:46, Ray Leyva wrote:
>
> On Mon, 2002-08-19 at 10:47, r g wrote:
> > I hope that someone has the time to help me with some details about
> Webware Contexts. I am sure
> > that this is just a case of my dense brain. I have read and reread
> the docs. Also read most of the
> > context related materials on the Twiki site. OK, here goes.
> >
> > First, I have Webware installed and running using OneShot.cgi,
> WebKit.cgi, as well as mod_Python
> > adapters. So, nothing is broken. I just do not have my head around
> contexts and the default context.
> >
> > My Webware application resides in its own application directory
> created by the Webware setup utility.
> > Apache is serving up 2 web sites, they are both virtual. At this time
> I am only concerned about the
> > first web site. One issue at a time.
> >
> > www.website1.com -- doc root is -- /pub/httpd/website1
> > website1 -- default context --
> /pub/httpd/website1/MyContext
> >
> > Apache location /WK is defined for website1 and points to the default
> context of MyContext. This is
> > also defined in the Application.conf (?) for this website.
> >
> > http://www.website1.com/wk properly accesses my website using the
> mod_Python adapter.
> >
> > On to the questions now...
> >
> > What is the purpose of the "context"? They are not used with the cgi
> adapters, right?
> > Why would I have other contexts defined in the config? How would they
> be used or referenced?
> > Does any of the context functionality address the needs of serving 2
> web sites? Or does
> > each web site run off of its own instance of the AppServer?
> >
> > Thanks.rdg,
>
> Yes context allows one server to service multiple websites. If you copy
> the "lines" in your httpd / apache.conf, and Application.conf line that
> you have questions about. I can give you a better answer in relation to
> specific items.
>
> As to how to use them ( with mod_webkit, sorry don't know about
> mod_python ) ... here's a sample:
>
> [Application.conf]
> 'Contexts': {
> #'Admin': '%(WebKitPath)s/Admin',
> #'Examples': '%(WebKitPath)s/Examples',
> #'Docs': '%(WebKitPath)s/Docs',
> #'Testing': '%(WebKitPath)s/Testing',
> #'MyContext': 'MyContext',
> 'rdg': '/home/rdg/WebWareWork/rdg',
> 'rdg2': '/home/rdg/WebWareWork/rdg2',
> 'default': 'rdg'
> },
>
> [apache/http.conf]
> RewriteEngine On
> RewriteRule ^/wk/(.*) /$1 [R]
> RewriteRule ^/rdg(.*) /wk/rdg/$1 [L,PT]
> RewriteRule ^/rdg2(.*) /wk/rdg2/$1 [L,PT]
> <Location /wk>
> WKServer localhost 8086
> SetHandler webkit-handler
> order deny,allow
> deny from all
> allow from localhost .localdomain
> allow from 192.168.10.
> allow from 10.0.0.
> Options Indexes FollowSymLinks
> </Location>
>
> Ok, If you have any other questions just let us know. Hope this helps!
>
> Ray
>
> PS : I "got" most of this from using the RewriteRule's wiki page, and a
> heck of a lot of experimenting. I only say it as a warning ... your
> results may vary, and this is meant for a Linux / *nix machine running
> mod_webkit.
> ..
> > rdg
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
>
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
>
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss