[Prev][Next][Index][Thread]

Re: (still) can't start CL-HTTP



greetings,

this is a re-post of a message which i first posted at the beginning of
december. i'm posting the question again since i've yet to see a reply...

the problem is (still) how to get the CL-HTTP server up either stand-alone
or on an apple-talk network. the described methods (at least as best as i
can carry them out) do not succeed (on a mac).

in the meantime, i've settled on a method which avoids the problem by using
a name-server ... since that has its own problems, it would still be nice
to know how to really get the stand-alone server to work...

to start off on a positive note, a method which does work is to run MacDNS.
i simply installed the version freely available from apple and defined each
of the hosts on the net.
then i modified #'initialize-apple-talk-configuration (from mcl.lisp) and
its invocation (from configuration-apple-talk.lisp) as below to enable host
name resolution and specify the server host name. note that the name i used
is NOT "Local-Host": in my tests that worked from the actual local host
only, and not from another host on the apple-talk net. the name was
resolved sufficiently to find the server, but all responses were
interpreted as connection refusals.

i haven't tried to use the general "init-server-internet" start-up under
these conditions, but at least this method does work.

--------------------------------------------------------------------------------
;from "mcl.lisp"

(define initialize-apple-talk-configuration (&optional (host-name
"Local-Host.Apple-Talk.Net"))
  "Initializes the server to operate over AppleTalk,
either in standalone mode or on an AppleTalk network without DNS service.
HOST-NAME must be an IP address (e.g., 127.0.0.1) unless the host file
in the system directory is edited to inform the TCP implementation of
the mappings between host names and IP addresses."
  (when (setq *host-name-for-apple-talk-operation* host-name)
    (check-type host-name string)

    ;; MAC-DNS: an alternative version which runs apple-talk, but with MAC-DNS
    (setq ccl::*use-resolver* t)
    ;; MAC-DNS: set to :PREFERRED
    (setq url:*url-host-name-resolution* :PREFERRED)

    ;; Controls whether IP addresses are resolved when writing log entries.
    ;; Production servers should turn this off to avoid the overhead of DNS
lookup during logging.
    (setq http:*log-resolve-ip-addresses* nil)
    ;; Controls whether IP addresses are resolved in all contexts other
than logging.
    ;; MAC-DNS: set to t
    (setq http:*resolve-ip-addresses* t)
    ;; Tell the MAC its domain name for local talk operation.
    (setq http:*local-host-domain-name* host-name)
    ;; force the logical name of the local host for local talk operation.
    (setq http:*http-host-name* http:*local-host-domain-name*)
    ;; Tell the MAC its IP Address for local talk operation.
    (local-host-ip-address t)
    (when (and (zerop (local-host t))
               (not (ccl::%tcp-ip-string-p host-name)))
      (error "host-name is ~A, which is not an IP address.~&~
                        You need to either specify an IP address such as
127.0.0.1 as the domain name or
create a hosts file in the system directory that maps ~A to the correct IP
address."
             host-name host-name))
    host-name))

;from "configuration-apple-talk.lisp"
(initialize-apple-talk-configuration "MY-840av.Apple-Talk.Net")

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

as to the original problem, i've tried the suggestions below, without success.
as i said above, it would be nice to find out how to actually get this to
work...

>This is very simple. Do you have Ethernet? If yes, that's
>fine. Configure your TCP/IP to use manual addressing.
>Then load CL-HTTP. Change the configuration.lisp
>file in the examples directory:
>
>
>;; Controls whether IP addresses are resolved in all contexts other than
>;; logging.
>(setq *resolve-ip-addresses* nil)  ;; turn it off (rj)
>
>;; Controls whether host names are DNS resolved and connonicalized on
>;; the primary DNS name for the host when the URL is interned. Choices
>;; are :always, :preferred, :never. Relevant when *resolve-ip-addresses*
>;; is non-null.
>(setq url:*url-host-name-resolution* :never)  ;; turn it off (rj)
>
>
>Then make sure mactcp does not try to resolve names:
>
>(setq ccl::*use-resolver* nil)
>

there must be something else missing...
the "host" in question is an 840av. which means it has ethernet. i would like,
however, to use it to serve other macs which do not.
therefore i'm trying to find a configuration with MacIP.

if i just apply the suggestions (most of which were already in
configuration-apple-talk.lisp in #'initialize-apple-talk-configuration),
the error in CCL::%TCP-CONTROL-ASYNC-WAIT
still occurs.

if i extend #' %local-host-parsed-ip-number to force an ip address,

(defun %local-host-parsed-ip-number ()
  (handler-case
    (ccl::%tcp-getaddr)
    #-with-net
    (error () (ccl::tcp-ip-str-to-addr "127.0.0.1"))
    (ccl:domain-error () 0)))

that call succeeds but somethis else later fails.
then the error is:

> Error: MACTCP: Unknown Error Code 1 -- No entry in
>ccl::*TCP-Error-Class-Alist*..
> While executing: CCL::%OPEN-RESOLVER
> Type Command-. to abort.
See the RestartsŠ menu item for further choices.
1 >

this happens both with the TCP/IP control panel set for MacIP and with it
set for Ethernet...
the error seems to occur while resolving names for external url's. if i
just ignore it an go ahead and start the server, it starts its processes,
each of which then yields the following (or similar) error message:

> Error in process HTTP Process 2: MACTCP: Insufficient resources to
>perform TCP request.
> While executing: CCL::MAKE-CONNECTION
> Type Command-. to abort.
See the RestartsŠ menu item for further choices.
1 >

suggestions?

-------------------------------------------------------------------------------
Welcome to Macintosh Common Lisp Version 3.0p2!
?
;Loading #P"Macintosh HD:Desktop
Folder:cl-http-60-57:mac-start-local-talk.lisp"...
;Loading #P"Macintosh HD:Desktop Folder:cl-http-60-57:mac-sysdcl.lisp"...
;Loading #P"Macintosh HD:Desktop Folder:cl-http-60-57:mac-translations.lisp"...
;Loading #4P"http:mac;server;timers.fasl"...
;Loading #4P"http:mac;server;resources.fasl"...
;Loading #4P"http:server;package.fasl"...
;Loading #4P"http:mac;server;tcp-stream.fasl"...
;Loading #4P"http:server;preliminary.fasl"...
;Loading #4P"http:server;variables.fasl"...
;Loading #4P"http:mac;server;www-utils.fasl"...


Follow-Ups: