# Squid statistics via browser - connection aborted



## noigan (Dec 21, 2010)

Greetengs!

For some days I cannot access the Squid statistics page from a remote computer: the browser gives the "Connection aborted" error message. The proxy itself is working though. As I understand, the problem is in apache. Some information and command calls results:


```
#/user/local/sbin/apachectl status

Alert! Unable to connect to remote host
lynx: can't access startfile http://localhost/server_status

#/user/local/sbin/apachectl status

Alert! Unable to connect to remote host
lynx: can't access startfile http://localhost/server_status

#/user/local/sbin/apachectl configtest
Syntax OK

#httpd -S
Virtual host configuration:
172.16.0.1:80 rtmc.dom (/usr/local/etc/apache21/httpd.conf:1051)
172.16.0.1:81 squid.dom (/usr/local/etc/apache21/httpd.conf:1072)
-my_dns_ip_:80 rtmc.dom (/usr/local/etc/apache21/httpd.conf:1051)
Syntax OK.
```
error_log:

```
...
[warn] pid file /usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
...
[notice] Apache/2.0.59 (FreeBSD) PHP/5.2.5 configured -- resuming normal operations
...
```
FreeBSD 6.2 i386
Apache 2.1.9
php 5.3.3
squid 2.5.stable.14

Could anyone please help me in solving this?

Best regards,
Aleksey.


----------



## JohnR (Dec 22, 2010)

Is the apache configured to listen on localhost? what does the command 

```
sockstat -4 | grep httpd
```
show?


----------



## noigan (Dec 24, 2010)

*JohnR*, from httpd.conf:

```
Listen 172.16.0.1:80
Listen 172.16.0.1:81
```


```
# sockstat -4 | grep httpd

nobody httpd 1161 3 172.16.0.1:80 *:*
nobody httpd 1161 4 172.16.0.1:81 *:*
nobody httpd 1130 3 172.16.0.1:80 *:*
nobody httpd 1130 4 172.16.0.1:81 *:*
nobody httpd 1102 3 172.16.0.1:80 *:*
nobody httpd 1102 4 172.16.0.1:81 *:*
nobody httpd 1101 3 172.16.0.1:80 *:*
nobody httpd 1101 4 172.16.0.1:81 *:*
nobody httpd 1024 3 172.16.0.1:80 *:*
nobody httpd 1024 4 172.16.0.1:81 *:*
nobody httpd 1023 3 172.16.0.1:80 *:*
nobody httpd 1023 4 172.16.0.1:81 *:*
nobody httpd 1022 3 172.16.0.1:80 *:*
nobody httpd 1022 4 172.16.0.1:81 *:*
nobody httpd 1021 3 172.16.0.1:80 *:*
nobody httpd 1021 4 172.16.0.1:81 *:*
nobody httpd 1020 3 172.16.0.1:80 *:*
nobody httpd 1020 4 172.16.0.1:81 *:*
root httpd 1008 3 172.16.0.1:80 *:*
root httpd 1008 4 172.16.0.1:81 *:*
```
I found out that when I was out our ISP support service have made some changes to the router, to which the server with FreeBSD is connected. They did it twice, after the first time Squid became inaccessible, after the second time it got accessible, but the statistics page doesn't load beyond the header logo:


----------



## JohnR (Dec 25, 2010)

It seems apache doesn't listen on localhost. That might be the reason why

```
Alert! Unable to connect to remote host
lynx: can't access startfile http://localhost/server_status
```
won't work. It doesn't listen on localhost but only on 172.16.0.1

What exactly do you use to gather the statistics? Is this the cachemgr.cgi or some external php scripts?


----------



## noigan (Dec 27, 2010)

*JohnR*, 172.16.0.1 is the IP for the computer with Apache in our LAN. Is listening on this IP different from listening on 127.0.0.1?

The statistics page has is created by the statistic.cgi file.


----------



## JohnR (Dec 27, 2010)

Yes it is, if you configure apache to listen on a specific IP-address, it will listen on that specific address only. This means if you specify 

```
Listen 172.16.0.1:80
Listen 172.16.0.1:81
```
A connect to localhost won't work since it doesn't listen on that address. I doubt it's all of the problem but if you want to test of the server works using 

```
# /usr/local/sbin/apachectl status
```
you should make something listen on 127.0.0.1:80


----------



## noigan (Dec 28, 2010)

Well, now squid gives the "connection aborted" message again, so it might have nothing to do with the ISP work.

*JohnR*, I made Apache listen on 127.0.0.1. Now ...apachectl status gives the following:


```
Not found

"The requested URL /server-status was not found on this server"
---------------------------------------------------------------
Apache/2.1.9 (FreeBSD) php/5.3.3 with Suhoshin-Patch Server at localhost port 80
```


----------



## noigan (Dec 28, 2010)

*upd*

STC to my embarassment is accessible again, but when trying to log in I get the "Internal server message".


----------

