Configuring where ZnServer serves files from

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuring where ZnServer serves files from

Andy Burnett
I needed to serve some (amber) files from a local host - it was just a quick hack. I fired up the 2.0 one click image on my mac, and looked at the instructions for running the server. I can see how it would work if I installed it on Ubuntu, but I can't work out where my website's root folder would be on the mac.  i tried the various folders inside the package, but none worked.

Which brings me to the basic question, how do I configure the path for a ZnServer - i am sure it is very simple, but I couldn't work it out.

Cheers
Andy
Reply | Threaded
Open this post in threaded view
|

Re: Configuring where ZnServer serves files from

Sven Van Caekenberghe-2
Hi Andy,

On 13 Jun 2013, at 17:10, Andy Burnett <[hidden email]> wrote:

> I needed to serve some (amber) files from a local host - it was just a quick hack. I fired up the 2.0 one click image on my mac, and looked at the instructions for running the server. I can see how it would work if I installed it on Ubuntu, but I can't work out where my website's root folder would be on the mac.  i tried the various folders inside the package, but none worked.
>
> Which brings me to the basic question, how do I configure the path for a ZnServer - i am sure it is very simple, but I couldn't work it out.
>
> Cheers
> Andy

This should work:

(ZnServer defaultOn: 1701)
        logToTranscript;
        delegate: ((ZnStaticFileServerDelegate new)
                                                prefixFromString: 'apple/macosx';
                                                directory: '/Library/WebServer/Documents' asFileReference;
                                                yourself);
        start.

ZnClient new get: 'http://localhost:1701/apple/macosx/'.

If there is no index.html in the directory, you'll need to refer to an actual file.

HTH,

Sven

--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org





Reply | Threaded
Open this post in threaded view
|

Re: Configuring where ZnServer serves files from

Andy Burnett
In reply to this post by Andy Burnett
<<<
This should work:

(ZnServer defaultOn: 1701)
        logToTranscript;
        delegate: ((ZnStaticFileServerDelegate new)
                                                prefixFromString: 'apple/macosx';
                                                directory: '/Library/WebServer/Documents' asFileReference;
                                                yourself);
        start.

ZnClient new get: 'http://localhost:1701/apple/macosx/'.

If there is no index.html in the directory, you'll need to refer to an actual file.

>>>

Thanks Sven, that's great!  And, I am glad I asked, because I wouldn't have worked that out.

It seems to me that Zinc is becoming sufficiently powerful that it could do with a section in the  collaboractive cookbook.  Could someone on this list give me an account? I could start to capture bits and pieces.

cheers
Andy
Reply | Threaded
Open this post in threaded view
|

Re: Configuring where ZnServer serves files from

Stéphane Ducasse

On Jun 14, 2013, at 11:33 PM, Andy Burnett <[hidden email]> wrote:

<<<
This should work:

(ZnServer defaultOn: 1701)
        logToTranscript;
        delegate: ((ZnStaticFileServerDelegate new)
                                                prefixFromString: 'apple/macosx';
                                                directory: '/Library/WebServer/Documents' asFileReference;
                                                yourself);
        start.

ZnClient new get: 'http://localhost:1701/apple/macosx/'.

If there is no index.html in the directory, you'll need to refer to an actual file.

>>>

Thanks Sven, that's great!  And, I am glad I asked, because I wouldn't have worked that out.

It seems to me that Zinc is becoming sufficiently powerful that it could do with a section in the  collaboractive cookbook.  Could someone on this list give me an account? I could start to capture bits and pieces.

Andy 

I started to convert all the zinc documentation that sven wrote.

We can add a new chapter on Zinc Usage.

We are working on a format that generates autoamtically PDF and html for the next books.

Stef


cheers
Andy

Reply | Threaded
Open this post in threaded view
|

Re: Configuring where ZnServer serves files from

Stéphane Ducasse
In reply to this post by Andy Burnett
mariano?

Stef

 Could someone on this list give me an account? I could start to capture bits and pieces.