Welcome! Log In Create A New Profile

Advanced

Re: Awstats and NGinX

December 28, 2011 09:11PM
Finally!!!!!!! I have Awstats working!!!!!!!

The undefined fastcgi parameter is a result of using ENV in the cgi-bin.php So I replaced ENV with SERVER and it works!!!!! So with Ubuntu 11.10 (64-bit), Awstats, and Nginx 1.05 the cgi-bin.php looks like this (where it now reads $_SERVER....it used to read $ENV):

<?php
$descriptorspec = array(
0 => array("pipe", "r"), //stdin is a pipe that the child will read from
1 => array("pipe", "w"), //stdout is a pipe that the child will write to
2 => array("pipe", "w"), //stderr is a file to write to
);

$newenv = $_SERVER;
$newenv["SCRIPT_FILENAME"] = $_SERVER["X_SCRIPT_FILENAME"];
$newenv["SCRIPT_NAME"] = $_SERVER["X_SCRIPT_NAME"];

if (is_executable ($_SERVER["X_SCRIPT_FILENAME"])) {
$process = proc_open($_SERVER["X_SCRIPT_FILENAME"], $descriptorspec, $pipes, NULL, $newenv);
if (is_resource($process)) {
fclose($pipes[0]);
$head = fgets($pipes[1]);
while (strcmp($head, "\n")) {
header($head);
$head = fgets($pipes[1]); }
fpassthru($pipes[1]);
fclose($pipes[1]);
fclose($pipes[2]);
$return_value = proc_close($process); }
else {
header("Status: 500 Internal Server Error");
echo ("Internal Server Error"); }}
else {
header("Status: 404 Page Not Found");
echo("Page Not Found"); }
?>
Subject Author Posted

Awstats and NGinX

DeneB December 28, 2011 02:58PM

Re: Awstats and NGinX

Aleksandar Lazic December 28, 2011 04:18PM

Re: Awstats and NGinX

DeneB December 28, 2011 08:04PM

Re: Awstats and NGinX

DeneB December 28, 2011 08:27PM

Re: Awstats and NGinX

António P. P. Almeida December 28, 2011 08:40PM

Re: Awstats and NGinX

DeneB December 28, 2011 08:48PM

Re: Awstats and NGinX

DeneB December 28, 2011 09:11PM

Re: Awstats and NGinX

DeneB December 28, 2011 09:21PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready