GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   ATX and lighttpd (https://gfy.com/showthread.php?t=930025)

thagreek 09-25-2009 11:45 AM

ATX and lighttpd
 
Does anyone use ATX with lighttpd?
I cannot make the in.cgi work on the index page because lighttpd does not have virtual() in php.
Has anyone found a way around this?

hjnet 09-25-2009 11:53 AM

A plain SSI Include doesn't work either?

ProG 09-25-2009 11:59 AM

Maybe this will help

http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModCGI

thagreek 09-25-2009 12:13 PM

cgi itself works, it's just the virtual function is missing from php and does not work in ssi.
I really wanted to run lighttpd and I think it's stupid to run apache just for something like this. Either I will have to figure out a work around or move to apache. :(

ProG 09-25-2009 12:38 PM

You could try this..

http://www.modwest.com/help/kb5-212.html

Klen 09-25-2009 12:39 PM

You can always proxy lighthttpd to apache.

thagreek 09-25-2009 02:38 PM

Quote:

Originally Posted by ProG (Post 16362202)

Yeah I have found everything like that and tried them all.

Nothing works. It is hard searching for this issue because the only thing that really comes up is lighttpd virtual host issues.

If it's even possible, I will figure it out and when I do I will post for others.

Thanks for the replies.

thagreek 09-25-2009 06:40 PM

<?php
# Change this to the full path of in.cgi
$CGISCRIPT="/full/path/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");
?>

Works like a charm now! :)

thagreek 09-26-2009 11:35 AM

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.


All times are GMT -7. The time now is 03:56 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123