ATX and lighttpd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thagreek
    Confirmed User
    • Dec 2006
    • 463

    #1

    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?
    ICQ: 335034

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

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

  • hjnet
    Confirmed User
    • May 2002
    • 3815

    #2
    A plain SSI Include doesn't work either?

    Comment

    • ProG
      Confirmed User
      • Apr 2009
      • 1319

      #3
      Maybe this will help

      http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModCGI
      History will be kind to me for I intend to write it.

      Comment

      • thagreek
        Confirmed User
        • Dec 2006
        • 463

        #4
        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.
        ICQ: 335034

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

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

        Comment

        • ProG
          Confirmed User
          • Apr 2009
          • 1319

          #5
          You could try this..

          http://www.modwest.com/help/kb5-212.html
          History will be kind to me for I intend to write it.

          Comment

          • Klen
            • Aug 2006
            • 32235

            #6
            You can always proxy lighthttpd to apache.

            Comment

            • thagreek
              Confirmed User
              • Dec 2006
              • 463

              #7
              Originally posted by ProG
              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.
              ICQ: 335034

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

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

              Comment

              • thagreek
                Confirmed User
                • Dec 2006
                • 463

                #8
                <?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!
                ICQ: 335034

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

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

                Comment

                • thagreek
                  Confirmed User
                  • Dec 2006
                  • 463

                  #9
                  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)

                  Comment

                  Working...