# Script timed out before returning headers: awstats.pl.



## sixtydoses (Jan 17, 2011)

Hello,

I have setup awstats on a FreeBSD box, and after sometime, the awstats page will display the following error:


```
HTTP gateway timed out
```

Excerpt from apache error log:


```
[Mon Jan 17 10:21:04 2011] [warn] [client 221.133.32.146] Timeout waiting for output from CGI script /usr/local/www/awstats/cgi-bin/awstats.pl, 
referer: http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:21:04 2011] [error] [client 221.133.32.146] Script timed out before returning headers: awstats.pl, referer: 
http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:21:06 2011] [warn] [client 221.133.32.146] Timeout waiting for output from CGI script /usr/local/www/awstats/cgi-bin/awstats.pl, 
referer: http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:23:15 2011] [error] [client 221.133.32.146] File does not exist: /usr/local/www/apache22/data/favicon.ico, referer: 
http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:23:18 2011] [warn] [client 221.133.32.146] Timeout waiting for output from CGI script /usr/local/www/awstats/cgi-bin/awstats.pl, 
referer: http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:23:18 2011] [error] [client 221.133.32.146] Script timed out before returning headers: awstats.pl, referer: 
http://*****.com/awstats/awstats.pl?config=www.*****.com
[Mon Jan 17 10:23:20 2011] [warn] [client 221.133.32.146] Timeout waiting for output from CGI script /usr/local/www/awstats/cgi-bin/awstats.pl, 
referer: http://*****.com/awstats/awstats.pl?config=www.*****.com
```


I had this similar error months ago on a different box, and I managed to make it go away temporarily (to be honest I don't remember exactly what I did, I think I just played around with the awstats.pl cron timing or I setup a whole new config), but not long after that the same error came back. And recently I setup awstats on this new box, and the same error appears, so guess I'm missing something somewhere.

Appreciate any help to fix this issue. System runs on FreeBSD 8.2-PRERELEASE #0.

Thanks.


----------



## Pushrod (Jan 17, 2011)

Are you doing an "update=1" when you try to visit the awstats.pl page? If so, your system is probably just too slow to process all of the data in time. You may need to call awstats from the command line and visit it without "update=1" instead.


----------



## sixtydoses (Jan 18, 2011)

Nope, not doing "update=1". Just awstat.pl update -config=www.*****.com. Did try without the update just now, still the same  .


----------



## sixtydoses (Jan 19, 2011)

Just increased the TimeOut directive value in apache and so far so good.


----------

