Ok, I finally got everything working.  In addition to the changes
posted above, you'll need to do the following to get the SVN version of
TG to work:

tg_fastcgi.fcgi:

The VirtualPathFilter class can be completely removed.  This line
(towards the bottom) also needs to be removed:

Root._cpFilterList = [VirtualPathFilter()]

Next, change:

    cherrypy.config.update({
        'global': {'server.environment': 'production'},
        '/': {'virtualPathFilter.on': True,
              'virtualPathFilter.prefix': "/tg_fastcgi.fcgi"
        }})

To:

    cherrypy.config.update({
        'global': {'server.environment': 'production'}})

Finally, add the following to your dev/prod config file:

server.webpath="/tg_fastcgi.fcgi"

You will have to kill all of the tg_fastcgi.fcgi processes that are
running before the changes will work.  Take a look at the Dreamhost
instructions if you need info on how to do this.  The fcgi processes
tend to respawn after being killed, so you'll have to double-check the
active processes to make sure that they are really gone.

Also, it seems to take about 5 min on average for the DH servers to
reload the new configuration after the fcgi processes have been killed,
so be patient.

Thanks,

Sean

Sean De La Torre wrote:
> You have to modify the tg_fastcgi.fcgi script for this to work
> correctly.  Add this to the top of the script:
>
> import turbogears
>
> And replace this:
>
>     if exists(join(code_dir, "setup.py")):
>         cherrypy.config.update(file=join(code_dir, "dev.cfg"))
>     else:
>         cherrypy.config.update(file=join(code_dir, "prod.cfg"))
>
> With this:
>
>     if exists(join(dirname(__file__), "setup.py")):
>         turbogears.update_config(configfile=join(code_dir,
> "devcfg.py"),
>             modulename="<project_name>.config")
>     else:
>         turbogears.update_config(configfile=join(code_dir,
> "prodcfg.py"),
>             modulename="<project_name>.config")
>
> NOTE: Make sure to replace <project_name> with your project name.
>
> I've just upgraded my TG Dreamhost install from 0.88 to the latest SVN
> version, but am in the process of debugging another issue with the new
> install.  I'll send another note when I've figured out my other issue
> since it seems like it's related to the tg_fastcgi script.
>
> Since I wrote the original instructions, I guess I should  also update
> TRAC when everything is working correctly.
>
> Thanks,
>
> Sean
>
> Mike Sarahan wrote:
> > Hi guys,
> >
> > I'm trying to move my site over to dreamhost, and I've followed the
> > directions on the trac, with the deviation being that I went with SVN
> > for identity's sake.  I'm working with 518 on dreamhost.  It's getting
> > confused about the new style of config files.  Here's the error:
> >
> > file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> > 'def configure():\n'
> > Traceback (most recent call last):
> >   File "tg_fastcgi.fcgi", line 21, in ?
> >     class VirtualPathFilter(object):
> >   File "tg_fastcgi.fcgi", line 74, in VirtualPathFilter
> >     tg_init()
> >   File "tg_fastcgi.fcgi", line 58, in tg_init
> >     cherrypy.config.update(file=join(code_dir,"devcfg.py"))
> >   File
> > "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> > -py2.4.egg/cherrypy/config.py", line 71, in update
> >     updateMap.update(dict_from_config_file(file))
> >   File
> > "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> > -py2.4.egg/cherrypy/config.py", line 221, in dict_from_config_file
> >     configParser.read(configFile)
> >   File
> > "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> > -py2.4.egg/cherrypy/config.py", line 209, in read
> >     self._read(fp, filename)
> >   File "/home/mikez0r/lib/lib/python2.4/ConfigParser.py", line 462, in
> > _read
> >     raise MissingSectionHeaderError(fpname, lineno, line)
> > ConfigParser.MissingSectionHeaderError: File contains no section
> > headers.
> > file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> > 'def configure():\n'
> > (END)
> >
> > Any ideas on what to change where to resolve this?
> > 
> > Thanks,
> > Mike

Reply via email to