Re: [Myghty-users] apache cgi attempt
Brought to you by:
zzzeek
From: Michael B. <mi...@zz...> - 2006-07-31 21:07:27
|
with this component root: > 'C:\\pysrc\\pczendb\\cgi-bin\\hw\\myproject\\myproject\\components' and this file: >> C:\pysrc\pczendb\cgi-bin\hw\myproject\myproject\htdocs\index.myt well, first of all, youre making it look for files under "components" but the file is physically under "htdocs". so the component root should be: >> C:\pysrc\pczendb\cgi-bin\hw\myproject\myproject\htdocs\ and the url is relative to the component root: http://localhost/cgi-bin/myghty.cgi/index.myt On Jul 31, 2006, at 12:01 AM, Mike Dewhirst wrote: > Mike Dewhirst wrote: >> I'm at a brick wall having tried (I think) all combinations of >> /path/to/index.myt having just installed myghty for testing. >> >> I installed the Demo Server and it worked OK. I have Apache serving >> python scripts on this machine and unsuccessfully tried to use that >> instead of server.py. >> >> I think the problem is my understanding of the docs in relation to >> specifying paths. >> >> Thanks for any hints, pointers to docs etc >> >> Mike >> >> - - - - - - details - - - - - - >> >> This is where index.myt was put by the demo ... >> >> C:\pysrc\pczendb\cgi-bin\hw\myproject\myproject\htdocs\index.myt >> >> - - - - - - - - - - - - - - - - - - - - - >> >> This is where I pointed my browser ... >> >> http://127.0.0.1/cgi-bin/hw/myghty.cgi/myproject/myproject/htdocs/ >> index.myt >> >> - - - - - - - - - - - - - - - - - - - - - >> >> which responded with ... >> >> Response code 404 (no message) >> Page: "/myproject/myproject/htdocs/index.myt" >> >> and Apache error log entry ... >> >> [Mon Jul 31 12:55:41 2006] [error] [client 127.0.0.1] >> TopLevelNotFound: >> ComponentNotFound: Cant locate component >> /myproject/myproject/htdocs/index.myt at >> c:\\usr\\bin\\lib\\site-packages\\Myghty-1.0.2-py2.4.egg\\myghty\ >> \request.py >> line 448 >> >> ... which seems totally reasonable because request.py line 448 raises >> the ComponentNotFound exception ... >> >> 445 try: >> 446 resolution = self.interpreter.resolve_component(path, >> resolver_context = self.resolver_context, enable_dhandler = >> self.use_dhandlers, declined_components = self.declined_components) >> 447 except exception.ComponentNotFound, cfound: >> 448 raise cfound.create_toplevel() >> >> - - - - - - - - - - - - - - - - - - - - - >> >> Here is my much edited myghty.cgi which I am sure is the source of my >> trouble ... >> >> #!/usr/bin/python2.4 >> # myghty cgi runner. place in cgi-bin directory and address Myghty >> templates >> # with URLs in the form: >> # http://mysite.com/cgi-bin/myghty.cgi/path/to/template.myt >> # component root. this is where the Myghty templates are. >> component_root = '/pysrc/pczendb/cgi-bin/hw/myproject/myproject/ >> components' >> # data directory. this is where Myghty puts its object files. >> data_dir = '/pysrc/pczendb/cgi-bin/hw/myproject/myproject/cache' > > Also tried this but no luck ... > component_root = > 'C:\\pysrc\\pczendb\\cgi-bin\\hw\\myproject\\myproject\\components' > # data directory. this is where Myghty puts its object files. > data_dir = 'C:\\pysrc\\pczendb\\cgi-bin\\hw\\myproject\\myproject\ > \cache' > >> >> # module components. >> module_components = [] >> >> # libraries. Put paths to additional custom Python libraries here. >> # lib = ['/path/to/custom/libraries'] >> # import sys >> # [sys.path.append(path) for path in lib] >> >> import myghty.CGIHandler as handler >> >> handler.handle( component_root=component_root, module_components = >> module_components, data_dir=data_dir) >> >> >> - - - - - - - - - - - - - - - - - - - - - >> >> Here is an excerpt from httpd.conf for my Apache 2.0.54 ... >> >> # >> ScriptAlias /cgi-bin/ "C:/pysrc/pczendb/cgi-bin/" >> # >> <Directory "C:/pysrc/pczendb/cgi-bin"> >> Options Indexes ExecCGI >> AllowOverride None >> Order allow,deny >> Allow from all >> </Directory> >> >> >> --------------------------------------------------------------------- >> ---- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys -- and earn >> cash >> http://www.techsay.com/default.php? >> page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Myghty-users mailing list >> Myg...@li... >> https://lists.sourceforge.net/lists/listinfo/myghty-users >> >> > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn > cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Myghty-users mailing list > Myg...@li... > https://lists.sourceforge.net/lists/listinfo/myghty-users |