View Single Post
Old 09-26-2009, 11:35 AM  
thagreek
Confirmed User
 
Join Date: Dec 2006
Posts: 463

Here is the vhost part for lighttpd and a site running smart thumbs and atx

var.vhostdir = "/usr/local/www/vhosts"

$SERVER["socket"] == "x.x.x.x:80" {
$HTTP["host"] =~ "(^|\.)domain\.com$" {
alias.url += ( "/cgi-bin" => vhostdir + "/www.domaincom/cgi-bin" )
server.document-root = vhostdir + "/www.domain.com/htdocs"
accesslog.filename = vhostdir + "/www.domain.com/logs/access.log"
server.errorlog = vhostdir + "/www.domain.com/logs/error.log"
$HTTP["host"] =~ "^domain\.com$" {
url.redirect = ( "^/(.*)" => "http://www.domain.com/$1" )
}
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = vhostdir + "/www.domain.com/htdocs/st/admin/.htpasswd"
auth.require = ( "/st/admin/" =>
(
"method" => "basic",
"realm" => "SmartThumbs admin",
"require" => "valid-user"
)
)
}
}

Since .htaccess doesn't work with lighttpd you will also need to make a index.php in /st/admin/ with this:

<?php header('Location: rotator.php'); ?>

Then instead of putting:

<?php virtual ("/cgi-bin/a2/in.cgi"); ?>

Put this:

<?php
$CGISCRIPT="/usr/local/www/vhosts/www.domain.com/cgi-bin/a2/in.cgi";
putenv('REQUEST_METHOD=GET');
if(isset($_SERVER['QUERY_STRING'])) putenv('QUERY_STRING='.$_SERVER['QUERY_STRING']);
if(isset($_SERVER['HTTP_USER_AGENT'])) putenv('HTTP_USER_AGENT='.$_SERVER['HTTP_USER_AGENT']);
if(isset($_SERVER['HTTP_VIA'])) putenv('HTTP_VIA='.$_SERVER['HTTP_VIA']);
if(isset($_SERVER['HTTP_CACHE_CONTROL'])) putenv('HTTP_CACHE_CONTROL='.$_SERVER['HTTP_CACHE_CONTROL']);
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) putenv('HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR']);
if(isset($_SERVER['HTTP_REFERER'])) putenv('HTTP_REFERER='.$_SERVER['HTTP_REFERER']);
if(isset($_SERVER['HTTP_COOKIE'])) putenv('HTTP_COOKIE='.$_SERVER['HTTP_COOKIE']);
putenv('REMOTE_ADDR='.$_SERVER['REMOTE_ADDR']);
unset($return_array);
exec($CGISCRIPT, $return_array, $return_val);
$firstline=array_shift($return_array);
echo implode($return_array,"\r\n");
?>

Other then these couple of tweaks everything else is the same.

Frank is adding the above php code to the arrow scripts knowledge base.

If anyone wants to use lighttpd and can't get it working, just hit me up on icq and I will help you out.
__________________
ICQ: 335034

For sale: oojz.com / upbot.com / iMarijuana.com / toughmarketing.com / playfulencounter.com (website included)

Misc.: 2x ATX2 licenses ($50 each)

thagreek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote