Mephisto and PHP

Tags: Uncategorized mephisto textdrive php lighttpd

I am in the process of converting the content management of several of my domains to Mephisto. I discussed some of my reasons for this. I’m loving the switch so far, but I hit a hitch. The document roots (in Lighttpd) of my switched domains are pointing to the Mephisto public directory. This seems ok, but what about non-Mephisto resources? What about those useful PHP scripts that you’ve got lying around?

_Don’t have PHP enabled? Check-out this post on Lighttpd and PHP

Well, you can copy them into the mephisto/public folder, but that’s not very appetizing. I don’t want to pollute my Mephisto installation with non-Mephisto files. I really want to point my document root back at the default Textdrive directories:

server.document-root = /home/username/domains/domain.com/web/public

So, what’s a hack like me to do? Well, I created a symlink from the directory above to Mephisto’s dispatch.fcgi script:

$ ln -s /path/to/mephisto/public/dispatch.fcgi

I tried to define the absolute path to the script in my conf file for Lighttpd, but that didn’t work. I think server.error-handler-404 wants a relative path starting from the defined document root. Hence the symlink. This seems to be working like a charm!

One caveat: All requests to Mephisto are predicated on the 404 error handler. So, any requests that actually resolve (should you create a file or directory that maps to a Mephisto URI) won’t make it. So, be careful what you name your files and directories!

Update: Didn’t notice this until I tried to access the admin console. You’ll need to symlink the images, stylesheets, and javascripts directories.

About Me

Hey there. My name is Carter Rabasa and I am a husband and father of two beautiful daughters Catherine and Emily. I live in Seattle, WA.