THE SPEW - Land where drunk cows swim and home to my daily hand...
streaming media & music | Home | Archives | Albums | Pics

ditched apache, moved to lighttpd with fastcgi-php and my lifetype, gallery, and other configuration parameters for the move

14 July, 2007 18:42

The default installation of my dedicated server OS was not serving my specific needs and was rather bloated in the sense of default available services and mechanisms used to configure them.  I have slowly been tightening things down a bit, and today I completed the transition from Apache to lighttpd and fastcgi with PHP as my web services provider.

With this move, I can focus more on necessity rather than shuffle through the extremities of a more complicated system, thus personalizing the web service.

For virtual hosts, lighttpd provides two modules to choose from: mod_evhost and mod_simple_vhost.  I chose mod_evhost as it allowed me to use regular expressions when defining virtual host paths.  So in my case I defined the paths with $server_root/domainname.com/subdomain with the root domain and subdomain web files located in public_html.

evhost.path-pattern        = "/server_root/%0/%3/public_html/"

My next step was to insure LifeType and Gallery 2 would run properly.  To do this, I would need the mod_rewrite and mod_redirect modules.

With my LifeType installation I needed a way to redirect my custome URL's which was accomplished with Apache's redirection to blog.php.  I also needed bind http error handling to error.php.  These are the two decelerations I used to accomplish this:

url.rewrite-once = ("^/blog/.*" => "/blog.php")
server.error-handler-404   = "/error.php"

 Also make sure to define your document root that is relative to your LifeType installation.

server.document-root        = "/server_root/public_html/"

I then copied my LifeType installation over to my lighttpd document directory.  That was all there was to it.

For Gallery 2 I needed to edit config.php and change the data.gallery.base variable to the appropriate new root of the copied installation.

I also changed the mod_rewrite SQL variable to 0 for inactive.  I am not sure if this was necessary to keep my search engine friendly URLS, but I did not test if it was.  In any case, I used the following lighttpd rewrite declerations to keep these good looking resource locations:

  url.rewrite = (
      "^/pics/v/(\?.+|\ .)?$" => "/pics/main.php?g2_view=core.ShowItem",
      "^/pics/admin/.(.*)" => "/pics/main.php?g2_view=core.SiteAdmin&$1",
      "^/pics/d/([0-9]+)-([0-9]+)/([^\/]+)(\?|\ )?(.*)$" => "/pics/main.php?g2_view=core.DownloadItem&g2_itemId=$1&g2_ser$
      "^/pics/v/([^?]+)(\?|\ )?(.*)$" => "/pics/main.php?g2_view=core.ShowItem&g2_path=$1&$3",
      "^/pics/c/add/(.*).html" => "/pics/main.php?g2_view=comment.AddComment&g2_itemId=$1",
      "^/pics/c/view/(.*).html" => "/pics/main.php?g2_view=comment.ShowAllComments&g2_itemId=$1"
   )

Make sure to replace /pics/ with the directory of your copied Gallery 2 installation.

This was the basics of the transfer.  Feel free to leave a comment if you have any questions or want to discuss the procedure I used. 

[Software]
[Comments(0)] [Trackbacks(0)] [Permalink]

Add comment

Add comment
 authimage
Your E-Mail Address will NOT be Shared

Main Entry: spew
Function: verb
Etymology: Middle English, from Old English spIwan; akin to Old High German spIwan to spit, Latin spuere, Greek ptyein intransitive verb
1 : VOMIT
2 : to come forth in a flood or gush
3 : to ooze out as if under pressure : EXUDE transitive verb
1 : VOMIT
2 : to send or cast forth with vigor or violence or in great quantity -- often used with out - spew-er noun
--
Merriam-Webster

Land where drunk cows swim and home to my daily hand