Forum OpenACS Development: Problems with connections

Hi All!

I am getting the following error message into my log:

---------------------------------- Error --------------------------------------------------------------------------------------

Error: ambiguous option "file": must be authpassword, authuser, channel, close, content, contentlength, contentsentlength, copy, driver, encoding, files, fileoffset, filelength, fileheaders, flags, form, headers, host, id, isconnected, location, method, outputheaders, peeraddr, peerport, port, protocol, query, request, server, sock, start, status, url, urlc, urlencoding, urlv, version, or write_encoded

ambiguous option "file": must be authpassword, authuser, channel, close, content, contentlength, contentsentlength, copy, driver, encoding, files, fileoffset, filelength, fileheaders, flags, form, headers, host, id, isconnected, location, method, outputheaders, peeraddr, peerport, port, protocol, query, request, server, sock, start, status, url, urlc, urlencoding, urlv, version, or write_encoded

while executing

"ns_conn $var"

("default" arm line 2)

invoked from within

"switch $var {

locale {

set ad_conn(locale) [parameter::get -parameter SiteWideLocale -package_id [apm_pa..."

("default" arm line 7)

invoked from within

"switch $var {

form {

return [ns_getform]

}

all {

return [array get ad_conn]

..."

("-get" arm line 10)

invoked from within

"switch -- $flag {

-connected_p {

return [info exists ad_conn(request)]

}

----------------------------------------------------------------------------------------------------

This error happens when I receive connections such as:

1. 213.171.255.4 - - [06/Oct/2008:06:37:03 -0600] "GET http://www.yahoo.com/ HTTP/1.1" 500 530 "" "Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)" –
2. 88.80.7.248 - - [05/Oct/2008:23:06:13 -0600] "GET http://88.80.7.248/pp/anp.php?a=VURHTUAYC%40JJAZ&b=1155&c=eb7f HTTP/1.1" 500 530 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" –
3. 65.54.241.68 - - [04/Oct/2008:02:16:34 -0600] "POST http://65.54.245.8:25/ HTTP/1.0" 500 530 "" "" –
4. 118.171.158.180 - - [04/Oct/2008:18:49:55 -0600] "GET http://www.zshare.net/ HTTP/1.1" 500 530 "" "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)" –

There are also many other connections giving me the same error.

How can I get rid of this?

Thanks for your help!!!

César Hernández

Collapse
Posted by Gustaf Neumann on
how comes, that your site receives GET requests with the host names included, such as in "GET http://www.yahoo.com/";. It looks to me as if somebody configured your server as Proxy. The requests should look like "GET /" or "GET /dotlrn".

It seems that OpenACS tries to give an error message, but fails, since ad_conn was not yet initialized (in particular "ad_conn -set file" was not yet executed).

Gustaf,

You are right, I try to configure my server as proxy using any web browser and I am getting the above error.

I guess that any server using aolserver gets this error.

Now, I have a question, how to avoid this kind of error from aolserver?

Thanks for your help!!!

Regards,

Cesar.

Collapse
Posted by Gustaf Neumann on
Strictly speaking the error does not come from aolserver, but from OpenACS. The OpenACS request processor does not support proxy requests. While there are some solutions for proxying with aolserver, it would require some programming work to integrate these with OpenACS. My recommendation is to use squid/nginx/apache or one of the various other proxy solutions a proxy server.
Gustaf,

In my case, i don't want to use my server as proxy.

I want to reject this kind of connection.

Any suggestion?

Regards

César.

I realized that it does not happen this error with aolserver 4.5, only with aolserver 4.0.10, I don't know exactly why.

To my installation with aolserver 4.0.10, I made the following patch, inside the proc “rp_handler” in the file “acs-tcl/tcl/request-processor-procs.tcl”.

The patch is:

800c800,808
< # information twice when for example we get a 404 internal redirect. We should probably
---

# information twice when for example we get a 404 internal
# redirect. We should probably

# Fix to when is trying to use my server like proxy

if {"http://[ns_set iget [ns_conn headers] Host]" ne [ns_conn location]} {
return [ns_conn close]
}

regards,

César Hernández