Re: post 8000
Rainer Joswig <[email protected]> Tue, 24 Feb 2009 23:09:46 +0100
| Newsgroups | gmane.lisp.cl-http |
|---|---|
| Message-ID | <[email protected]> |
The sudo stuff has to be done carefully, since you don't want to run
an application as root. That would be a potential security problem. A
usual way would be start the server with higher privileges to
open the port 80 and then switch to another user during start up time.
I haven't tried that.
Maybe somebody has used that with CL-HTTP?
Other solutions would be to still run the web server on port 8000 (or
something similar) and
a) use a local port redirect on the same machine (firewall or similar)
to redirect traffic from port 80 to port 8000
b) use an external port redirect tool (like a router, load
balancer, ...) to redirect the traffic from port 80 to port 8000 on
the web server. That's for example what I do for my home computer. The
router to the Internet is an Apple Airport WLAN router and it
redirects traffic to my Mac.
CL-HTTP can listen on more than one port, btw. It also allows virtual
hosts.
For my solution (where the router redirects the traffic from 80 to
8000), my CL-HTTP listens
on port 8000 and I use a virtual host like this:
(http:add-virtual-host "foo.bar.com" 80 :http nil)
This allows me to serve the domain foo.bar.com as if it were on port 80.
I then need to export URLs similar to this:
(defun make-foo-url (url-string &key (host "foo.bar.com") (port 80))
"Create an URL for this site."
(url:intern-url (http:merge-url (list url-string :host host :port
port :protocol :http)
(http:local-context))
:if-does-not-exist :create))
There is also an extended #u syntax which allow to control host and
port.
Using something like above starts to get useful if CL-HTTP listens on
more than one
port and when you use virtual hosts. A basic scenario is also when CL-
HTTP listens
to HTTP on port 8000 and to HTTPS on port 8443.
Regards,
Rainer Joswig
Am 24.02.2009 um 22:07 schrieb Chun Tian (binghe):
> Hi, Mark
>
> In theory, try to enable following one line in
> #p"http:examples;configuration.lisp" should work:
>
> (set-standard-http-port 80 :http)
>
> But the problem is that you may not have access to bind on port 80, as
> a normal user on Mac OS X. Only port > 1024 is permitted. I suggest
> three ways:
>
> 1) Run an Apache which ships with MacOS and bind on port 80, then use
> Apache proxy module and rewrite module to rewrite the Apache URL (on
> port 80) to CL-HTTP (on port 8000). (Most safe way I think)
>
> 2) Try to deliver your CL-HTTP applications into a standalone console
> application, set CL-HTTP listen on port 80, then run it with "sudo".
>
> 3) Just save-image your lispworks with (:environment nil), as a
> console application, start LW from "sudo", then run a CL-HTTP in it.
> (not safe if your CL-HTTP also open the Web Listener)
>
> On 2009-2-25, at 03:15, Mark Klein wrote:
>
>>
>> I'm on Mac OS 10.5.6, running cl-http 70.216 on Lispworks 5.0.2 on an
>> Intel duo-core.
>>
>> Mark
>>
>>> Mark,
>>> What OS are you serving from?
>>> --
>>> chr
>>>
>>> On Feb 24, 2009, at 7:51 PM, Mark Klein wrote:
>>>
>>>>
>>>> Is there a way to re-configure cl-http so it serves on the standard
>>>> port (i.e. so you don't have to specify the port in the domain
>>>> name)
>>>> rather than port 8000? If so, how? I have some users who's firewall
>>>> blocks port 8000, so they can't use my system.
>>>>
>>>> Thanks,
>>>>
>>>> Mark
>>>>
>>>> -----------------
>>>> Mark Klein
>>>> Principal Research Scientist
>>>> MIT Center for Collective Intelligence
>>>> http://cci.mit.edu/klein/
>
> --
> Chun Tian (binghe)
> NetEase.com, Inc.
> P. R. China
>
>
> _______________________________________________
> WWW-CL mailing list
> [email protected]
> https://lists.csail.mit.edu/mailman/listinfo/www-cl
Rainer Joswig, Hamburg, Germany
http://lispm.dyndns.org/
mailto:[email protected]
_______________________________________________
WWW-CL mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/www-cl