9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] httpd and magic
@ 2002-11-14 15:11 Eric Grosse
  2002-11-14 15:55 ` Gabriel Diaz Lopez de la Llave
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Grosse @ 2002-11-14 15:11 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Correct, it sounds like you do need a modified httpd.  After recognizing
"/magic" and before doing the execl(), it would use the supplied Host:
header line to select a new namespace.

[-- Attachment #2: Type: message/rfc822, Size: 2244 bytes --]

From: Moroo Jun <jun@moroo.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] httpd and magic
Date: Thu, 14 Nov 2002 22:50:14 +0900
Message-ID: <00BAE13C-F7D8-11D6-86F1-0050E4504768@moroo.com>

On 2002.11.14, at 01:12, Eric Grosse wrote:
> Did you get a satisfactory solution to having /magic/somecgi
> behavior depend on the domain name?

Not yet.
Maybe I should modify httpd for this purpose.

I tried to use plan9 for hosting service OS. I should treat hosting
service user as a computer beginner.
I afraid the following situation.
User A(his domain is domain1.org) creates cgi "somecgi" and user B(his
domain is domain2.org) create same name "somecgi" cgi but different
program.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
  2002-11-14 15:11 [9fans] httpd and magic Eric Grosse
@ 2002-11-14 15:55 ` Gabriel Diaz Lopez de la Llave
  0 siblings, 0 replies; 9+ messages in thread
From: Gabriel Diaz Lopez de la Llave @ 2002-11-14 15:55 UTC (permalink / raw)
  To: 9fans

Try pegasus, from http://plan9.aichi-u.ac.jp/pegasus/eman-1.2a/
I use it and runs fine.


Eric Grosse wrote:

>Correct, it sounds like you do need a modified httpd.  After recognizing
>"/magic" and before doing the execl(), it would use the supplied Host:
>header line to select a new namespace.
>
>
> /
> ------------------------------------------------------------------------
>
> Subject:
> Re: [9fans] httpd and magic
> From:
> Moroo Jun <jun@moroo.com>
> Date:
> Thu, 14 Nov 2002 22:50:14 +0900
> To:
> 9fans@cse.psu.edu
>
>
> On 2002.11.14, at 01:12, Eric Grosse wrote:
>
>> Did you get a satisfactory solution to having /magic/somecgi
>> behavior depend on the domain name?
>
>
> Not yet.
> Maybe I should modify httpd for this purpose.
>
> I tried to use plan9 for hosting service OS. I should treat hosting
> service user as a computer beginner.
> I afraid the following situation.
> User A(his domain is domain1.org) creates cgi "somecgi" and user B(his
> domain is domain2.org) create same name "somecgi" cgi but different
> program.







^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
  2002-11-13 16:12 Eric Grosse
@ 2002-11-14 13:50 ` Moroo Jun
  0 siblings, 0 replies; 9+ messages in thread
From: Moroo Jun @ 2002-11-14 13:50 UTC (permalink / raw)
  To: 9fans

On 2002.11.14, at 01:12, Eric Grosse wrote:
> Did you get a satisfactory solution to having /magic/somecgi
> behavior depend on the domain name?

Not yet.
Maybe I should modify httpd for this purpose.

I tried to use plan9 for hosting service OS. I should treat hosting
service user as a computer beginner.
I afraid the following situation.
User A(his domain is domain1.org) creates cgi "somecgi" and user B(his
domain is domain2.org) create same name "somecgi" cgi but different
program.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
@ 2002-11-13 16:12 Eric Grosse
  2002-11-14 13:50 ` Moroo Jun
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Grosse @ 2002-11-13 16:12 UTC (permalink / raw)
  To: 9fans

Moroo,

Did you get a satisfactory solution to having /magic/somecgi
behavior depend on the domain name?

The solution is not to use /sys/lib/httpd.rewrite, because httpd applies
that only for normal file delivery.  Magic is considered as a mechanism
for the developer to have total control, so we jump to that with very
little processing.  However, your somecgi command linked against libhttpd
does have convenient access to hc->head.host extracted from the HTTP
headers, so you can readily personalize the behavior by domain name.

I'm wary of turning this over to shell scripts.  One needs to be
very careful about processing strings coming from the bad guys.  Doing
it in C where you know precisely what is interpreted seems safest.

Eric


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
  2002-10-30  9:14 ` matt
@ 2002-10-30 14:41   ` Moroo Jun
  0 siblings, 0 replies; 9+ messages in thread
From: Moroo Jun @ 2002-10-30 14:41 UTC (permalink / raw)
  To: 9fans

On 2002.10.30, at 18:14, matt wrote:
> You could write a script that mux's the requests and execs the correct
> script

Yes. but in this case I have to know cgi program name.

One solution is that I change httpd to Pegasus.
Or bind cgi directory (for example /usr/domain1/bin/ip) on /bin/ip/httpd
each access.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
  2002-10-30  2:04 YAMANASHI Takeshi
@ 2002-10-30 14:11 ` Moroo Jun
  0 siblings, 0 replies; 9+ messages in thread
From: Moroo Jun @ 2002-10-30 14:11 UTC (permalink / raw)
  To: 9fans


On 2002.10.30, at 11:04, YAMANASHI Takeshi wrote:
> As a workaround, how is to place script in
> 	/bin/ip/httpd/domain1/somecgi
> and access it with
> 	http://www.domain1.org/magic/domain1/somecgi

Sure. it works maybe. But I don't want to display domain1 two times.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
  2002-10-29 15:48 Moroo Jun
@ 2002-10-30  9:14 ` matt
  2002-10-30 14:41   ` Moroo Jun
  0 siblings, 1 reply; 9+ messages in thread
From: matt @ 2002-10-30  9:14 UTC (permalink / raw)
  To: 9fans



> In this case, can I use *different* cgi program which having same name?
>
> for example,
> http://www. domain1.org/magic/somecgi
> and
> http://www. domain2.org/magic/somecgi
>

You could write a script that mux's the requests and execs the correct
script

The domain requested from is in the headers.

I did a script you might find useful. In the archives it's at :

https://lists.cse.psu.edu/archives/9fans/2002-July/019130.html

The URL I posted in there is not live atm.
M

---Outgoing mail is certified as idiotic.Checked by AVG anti-virus system
(http://www.grisoft.com).Version: 6.0.404 / Virus Database: 228 - Release
Date: 16/10/2002




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] httpd and magic
@ 2002-10-30  2:04 YAMANASHI Takeshi
  2002-10-30 14:11 ` Moroo Jun
  0 siblings, 1 reply; 9+ messages in thread
From: YAMANASHI Takeshi @ 2002-10-30  2:04 UTC (permalink / raw)
  To: 9fans

> In this case, can I use *different* cgi program which having same name?
> http://www. domain1.org/magic/somecgi
> and
> http://www. domain2.org/magic/somecgi

I think the above example executes the same script
`/bin/ip/httpd/somecgi'.

As a workaround, how is to place script in
	/bin/ip/httpd/domain1/somecgi
and access it with
	http://www.domain1.org/magic/domain1/somecgi

I'm sorry I haven't tried.
--
YAMANASHI Takeshi



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] httpd and magic
@ 2002-10-29 15:48 Moroo Jun
  2002-10-30  9:14 ` matt
  0 siblings, 1 reply; 9+ messages in thread
From: Moroo Jun @ 2002-10-29 15:48 UTC (permalink / raw)
  To: 9fans

On httpd with virtual host, I have a problem.

www.domain1.org and www.domain2.org hosting with virtual host on same
plan9 box.
cpu% cat namespace.httpd
bind /usr/domain1/doc /usr/web/virtual/domain1
bind /usr/domain2/doc /usr/web/virtual/domain2

cpu% cat httpd.rewrite
http://www. domain1.org    /virtual/domain1
http://www. domain2.org    /virtual/domain2

In this case, can I use *different* cgi program which having same name?

for example,
http://www. domain1.org/magic/somecgi
and
http://www. domain2.org/magic/somecgi





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-11-14 15:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-14 15:11 [9fans] httpd and magic Eric Grosse
2002-11-14 15:55 ` Gabriel Diaz Lopez de la Llave
  -- strict thread matches above, loose matches on Subject: below --
2002-11-13 16:12 Eric Grosse
2002-11-14 13:50 ` Moroo Jun
2002-10-30  2:04 YAMANASHI Takeshi
2002-10-30 14:11 ` Moroo Jun
2002-10-29 15:48 Moroo Jun
2002-10-30  9:14 ` matt
2002-10-30 14:41   ` Moroo Jun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).