Serving static files

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

Serving static files

David Farber-3
OK, I know that this question (in various forms) has been asked many times and I've seen all the discussions that google would show me but I still don't know how to get what I want.

What I want is to be able to serve static files from seaside (or pier or Comanche or whatever) when I am *developing*.  When I push the site to production, I will be using Apache to serve the static files.  But while I am developing, it would be nice not to have to run Apace and just run Squeak.

I have seen the instructions to make Comanche serve static files (e.g. in Brian Chapados' Pier Design Tutorial) and that does work.  My problem is that I have set setName, defaultName and ServerPath so that seaside/pier is *not* in the url.  But I don't know how to get Comanche to serve static files with those changes.

Can anyone help?

Thanks,
David


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

David Zmick
if you run apache on your own local computer it really isnt much of a hassle, then, once you get it running, you don't have to mess with it later, and you wont have any trouble switching from your dev. environment to your deployment environment.  I would use apache :)

On Tue, Nov 11, 2008 at 8:26 PM, David <rdrvr.biz@gmail.com> wrote:
OK, I know that this question (in various forms) has been asked many times and I've seen all the discussions that google would show me but I still don't know how to get what I want.

What I want is to be able to serve static files from seaside (or pier or Comanche or whatever) when I am *developing*.  When I push the site to production, I will be using Apache to serve the static files.  But while I am developing, it would be nice not to have to run Apace and just run Squeak.

I have seen the instructions to make Comanche serve static files (e.g. in Brian Chapados' Pier Design Tutorial) and that does work.  My problem is that I have set setName, defaultName and ServerPath so that seaside/pier is *not* in the url.  But I don't know how to get Comanche to serve static files with those changes.

Can anyone help?

Thanks,
David


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
David Zmick
/dz0004455\
http://dz0004455.googlepages.com
http://dz0004455.blogspot.com


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Jason Johnson-5
This site tells how to do it:
http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html


On Tue, Nov 11, 2008 at 5:16 AM, David Zmick <[hidden email]> wrote:

> if you run apache on your own local computer it really isnt much of a
> hassle, then, once you get it running, you don't have to mess with it later,
> and you wont have any trouble switching from your dev. environment to your
> deployment environment.  I would use apache :)
>
> On Tue, Nov 11, 2008 at 8:26 PM, David <[hidden email]> wrote:
>>
>> OK, I know that this question (in various forms) has been asked many times
>> and I've seen all the discussions that google would show me but I still
>> don't know how to get what I want.
>> What I want is to be able to serve static files from seaside (or pier or
>> Comanche or whatever) when I am *developing*.  When I push the site to
>> production, I will be using Apache to serve the static files.  But while I
>> am developing, it would be nice not to have to run Apace and just run
>> Squeak.
>> I have seen the instructions to make Comanche serve static files (e.g. in
>> Brian Chapados' Pier Design Tutorial) and that does work.  My problem is
>> that I have set setName, defaultName and ServerPath so that seaside/pier is
>> *not* in the url.  But I don't know how to get Comanche to serve static
>> files with those changes.
>> Can anyone help?
>> Thanks,
>> David
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>
>
> --
> David Zmick
> /dz0004455\
> http://dz0004455.googlepages.com
> http://dz0004455.blogspot.com
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Jason Johnson-5
Tells how to do what you want I mean, not how to set up apache.

On Wed, Nov 12, 2008 at 6:18 AM, Jason Johnson
<[hidden email]> wrote:

> This site tells how to do it:
> http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html
>
>
> On Tue, Nov 11, 2008 at 5:16 AM, David Zmick <[hidden email]> wrote:
>> if you run apache on your own local computer it really isnt much of a
>> hassle, then, once you get it running, you don't have to mess with it later,
>> and you wont have any trouble switching from your dev. environment to your
>> deployment environment.  I would use apache :)
>>
>> On Tue, Nov 11, 2008 at 8:26 PM, David <[hidden email]> wrote:
>>>
>>> OK, I know that this question (in various forms) has been asked many times
>>> and I've seen all the discussions that google would show me but I still
>>> don't know how to get what I want.
>>> What I want is to be able to serve static files from seaside (or pier or
>>> Comanche or whatever) when I am *developing*.  When I push the site to
>>> production, I will be using Apache to serve the static files.  But while I
>>> am developing, it would be nice not to have to run Apace and just run
>>> Squeak.
>>> I have seen the instructions to make Comanche serve static files (e.g. in
>>> Brian Chapados' Pier Design Tutorial) and that does work.  My problem is
>>> that I have set setName, defaultName and ServerPath so that seaside/pier is
>>> *not* in the url.  But I don't know how to get Comanche to serve static
>>> files with those changes.
>>> Can anyone help?
>>> Thanks,
>>> David
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>>
>>
>> --
>> David Zmick
>> /dz0004455\
>> http://dz0004455.googlepages.com
>> http://dz0004455.blogspot.com
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

David Farber-3
In reply to this post by Jason Johnson-5
Thanks Jason.  I've already seen these instructions.  The problem is  
that they don't work if you are running pier from / instead of /
seaside/pier.

David

On Nov 11, 2008, at 10:18 PM, Jason Johnson wrote:

> This site tells how to do it:
> http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html
>
>
> On Tue, Nov 11, 2008 at 5:16 AM, David Zmick <[hidden email]>  
> wrote:
>> if you run apache on your own local computer it really isnt much of a
>> hassle, then, once you get it running, you don't have to mess with  
>> it later,
>> and you wont have any trouble switching from your dev. environment  
>> to your
>> deployment environment.  I would use apache :)
>>
>> On Tue, Nov 11, 2008 at 8:26 PM, David <[hidden email]> wrote:
>>>
>>> OK, I know that this question (in various forms) has been asked  
>>> many times
>>> and I've seen all the discussions that google would show me but I  
>>> still
>>> don't know how to get what I want.
>>> What I want is to be able to serve static files from seaside (or  
>>> pier or
>>> Comanche or whatever) when I am *developing*.  When I push the  
>>> site to
>>> production, I will be using Apache to serve the static files.  But  
>>> while I
>>> am developing, it would be nice not to have to run Apace and just  
>>> run
>>> Squeak.
>>> I have seen the instructions to make Comanche serve static files  
>>> (e.g. in
>>> Brian Chapados' Pier Design Tutorial) and that does work.  My  
>>> problem is
>>> that I have set setName, defaultName and ServerPath so that  
>>> seaside/pier is
>>> *not* in the url.  But I don't know how to get Comanche to serve  
>>> static
>>> files with those changes.
>>> Can anyone help?
>>> Thanks,
>>> David
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>>
>>
>> --
>> David Zmick
>> /dz0004455\
>> http://dz0004455.googlepages.com
>> http://dz0004455.blogspot.com
>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Damien Pollet
On Wed, Nov 12, 2008 at 4:46 PM, David Farber <[hidden email]> wrote:
> Thanks Jason.  I've already seen these instructions.  The problem is
> that they don't work if you are running pier from / instead of /
> seaside/pier.

Did you try installing pier at the root of Kom ? (i.e. I guess
something like the ma alias: line, but with / instead of /seaside, and
pier selected as the default application in the seaside dispatcher ?

I don't know for sure that it should work, maybe having an application
at the root of Kom conflicts with serving files, but it's worth a try…

> On Nov 11, 2008, at 10:18 PM, Jason Johnson wrote:
>
>> This site tells how to do it:
>> http://www.shaffer-consulting.com/david/Seaside/GettingSoftware/index.html
>>
>>
>> On Tue, Nov 11, 2008 at 5:16 AM, David Zmick <[hidden email]>
>> wrote:
>>> if you run apache on your own local computer it really isnt much of a
>>> hassle, then, once you get it running, you don't have to mess with
>>> it later,
>>> and you wont have any trouble switching from your dev. environment
>>> to your
>>> deployment environment.  I would use apache :)
>>>
>>> On Tue, Nov 11, 2008 at 8:26 PM, David <[hidden email]> wrote:
>>>>
>>>> OK, I know that this question (in various forms) has been asked
>>>> many times
>>>> and I've seen all the discussions that google would show me but I
>>>> still
>>>> don't know how to get what I want.
>>>> What I want is to be able to serve static files from seaside (or
>>>> pier or
>>>> Comanche or whatever) when I am *developing*.  When I push the
>>>> site to
>>>> production, I will be using Apache to serve the static files.  But
>>>> while I
>>>> am developing, it would be nice not to have to run Apace and just
>>>> run
>>>> Squeak.
>>>> I have seen the instructions to make Comanche serve static files
>>>> (e.g. in
>>>> Brian Chapados' Pier Design Tutorial) and that does work.  My
>>>> problem is
>>>> that I have set setName, defaultName and ServerPath so that
>>>> seaside/pier is
>>>> *not* in the url.  But I don't know how to get Comanche to serve
>>>> static
>>>> files with those changes.
>>>> Can anyone help?
>>>> Thanks,
>>>> David
>>>>
>>>> _______________________________________________
>>>> SmallWiki, Magritte, Pier and Related Tools ...
>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>
>>>
>>>
>>> --
>>> David Zmick
>>> /dz0004455\
>>> http://dz0004455.googlepages.com
>>> http://dz0004455.blogspot.com
>>>
>>>
>>> _______________________________________________
>>> SmallWiki, Magritte, Pier and Related Tools ...
>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>>
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>



--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

David Farber-3

On Nov 12, 2008, at 9:01 AM, Damien Pollet wrote:

> On Wed, Nov 12, 2008 at 4:46 PM, David Farber <[hidden email]>  
> wrote:
>> Thanks Jason.  I've already seen these instructions.  The problem is
>> that they don't work if you are running pier from / instead of /
>> seaside/pier.
>
> Did you try installing pier at the root of Kom ? (i.e. I guess
> something like the ma alias: line, but with / instead of /seaside, and
> pier selected as the default application in the seaside dispatcher ?
>
> I don't know for sure that it should work, maybe having an application
> at the root of Kom conflicts with serving files, but it's worth a try…

Yes, I did try that but it didn't work.  I'm not going to spend  
anymore time on it right now.  If I come back to it later I'll post  
something to the list.

David



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Jason Johnson-5
In reply to this post by David Farber-3
On Wed, Nov 12, 2008 at 4:46 PM, David Farber <[hidden email]> wrote:
> Thanks Jason.  I've already seen these instructions.  The problem is
> that they don't work if you are running pier from / instead of /
> seaside/pier.
>
> David

Ok, so you set the first MA module (or whatever it's called) to / and
pier?  Then you set something like   /images to static service?  I
would expect that to work because I think I have the opposite (/ is
static, /pier is pier) and it works.  But I would have to check, maybe
if you set anything to / then nothing else works?  I think the author
of Komm is on the list.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

David Farber-3

On Nov 12, 2008, at 1:20 PM, Jason Johnson wrote:

> On Wed, Nov 12, 2008 at 4:46 PM, David Farber <[hidden email]>  
> wrote:
>> Thanks Jason.  I've already seen these instructions.  The problem is
>> that they don't work if you are running pier from / instead of /
>> seaside/pier.
>>
>> David
>
> Ok, so you set the first MA module (or whatever it's called) to / and
> pier?  Then you set something like   /images to static service?  I
> would expect that to work because I think I have the opposite (/ is
> static, /pier is pier) and it works.  But I would have to check, maybe
> if you set anything to / then nothing else works?  I think the author
> of Komm is on the list.

Here is what I did:

| ma seaside |
     seaside := WAKom default.
     ma := ModuleAssembly core.
     ma serverRoot: (FileDirectory default directoryNamed: 'static')  
fullName.
     ma alias: '/' to: [ma addPlug: [:request | seaside process:
   request]].
     ma documentRoot: (FileDirectory default directoryNamed: 'static')  
fullName.
     ma serveFiles.
     (HttpService startOn: 8080 named: 'httpd') plug: ma rootModule

This serves static files and serves the root pier page (i.e localhost:
8080/), but I get Not Found for any interior pier pages (i.e.  
localhost:8080/blog).

David


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Jason Johnson-5
On Wed, Nov 12, 2008 at 9:42 PM, David Farber <[hidden email]> wrote:

>
> Here is what I did:
>
> | ma seaside |
>     seaside := WAKom default.
>     ma := ModuleAssembly core.
>     ma serverRoot: (FileDirectory default directoryNamed: 'static')
> fullName.
>     ma alias: '/' to: [ma addPlug: [:request | seaside process:
>   request]].
>     ma documentRoot: (FileDirectory default directoryNamed: 'static')
> fullName.
>     ma serveFiles.
>     (HttpService startOn: 8080 named: 'httpd') plug: ma rootModule
>
> This serves static files and serves the root pier page (i.e localhost:
> 8080/), but I get Not Found for any interior pier pages (i.e.
> localhost:8080/blog).
>
> David

I'm not sure, but I think you would need another alias for the static
folder.  Because normally (at least in other servers, which Komm seems
to be based loosely on) DocumentRoot is what / will point to, but
since you have used an alias to point that somewhere else I think you
would need another alias (e.g. /images) to point to the file system.
Also, do you have an actual directory called "static" somewhere on the
filesystem?

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

keith1y
Jason Johnson wrote:

> On Wed, Nov 12, 2008 at 9:42 PM, David Farber <[hidden email]> wrote:
>  
>> Here is what I did:
>>
>> | ma seaside |
>>     seaside := WAKom default.
>>     ma := ModuleAssembly core.
>>     ma serverRoot: (FileDirectory default directoryNamed: 'static')
>> fullName.
>>     ma alias: '/' to: [ma addPlug: [:request | seaside process:
>>   request]].
>>     ma documentRoot: (FileDirectory default directoryNamed: 'static')
>> fullName.
>>     ma serveFiles.
>>     (HttpService startOn: 8080 named: 'httpd') plug: ma rootModule
>>
>> This serves static files and serves the root pier page (i.e localhost:
>> 8080/), but I get Not Found for any interior pier pages (i.e.
>> localhost:8080/blog).
>>
>> David
>>    
>
> I'm not sure, but I think you would need another alias for the static
> folder.  Because normally (at least in other servers, which Komm seems
> to be based loosely on) DocumentRoot is what / will point to, but
> since you have used an alias to point that somewhere else I think you
> would need another alias (e.g. /images) to point to the file system.
> Also, do you have an actual directory called "static" somewhere on the
> filesystem?
>
>  
Seaside28Jetsam from squeaksource project Jetsam, it has a version of
WAFileLibrary which serves files form disk

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

Jason Johnson-5
On Thu, Nov 13, 2008 at 11:43 AM, Keith Hodges <[hidden email]> wrote:
>>
> Seaside28Jetsam from squeaksource project Jetsam, it has a version of
> WAFileLibrary which serves files form disk
>
> Keith

Thanks Keith, but in this case it wont be needed because he just wants
Komms normal ability to serve static files.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Serving static files

David Farber-3
In reply to this post by Jason Johnson-5

On Nov 12, 2008, at 10:53 PM, Jason Johnson wrote:

> On Wed, Nov 12, 2008 at 9:42 PM, David Farber <[hidden email]>  
> wrote:
>>
>> Here is what I did:
>>
>> | ma seaside |
>>    seaside := WAKom default.
>>    ma := ModuleAssembly core.
>>    ma serverRoot: (FileDirectory default directoryNamed: 'static')
>> fullName.
>>    ma alias: '/' to: [ma addPlug: [:request | seaside process:
>>  request]].
>>    ma documentRoot: (FileDirectory default directoryNamed: 'static')
>> fullName.
>>    ma serveFiles.
>>    (HttpService startOn: 8080 named: 'httpd') plug: ma rootModule
>>
>> This serves static files and serves the root pier page (i.e  
>> localhost:
>> 8080/), but I get Not Found for any interior pier pages (i.e.
>> localhost:8080/blog).
>>
>> David
>
> I'm not sure, but I think you would need another alias for the static
> folder.  Because normally (at least in other servers, which Komm seems
> to be based loosely on) DocumentRoot is what / will point to, but
> since you have used an alias to point that somewhere else I think you
> would need another alias (e.g. /images) to point to the file system.
> Also, do you have an actual directory called "static" somewhere on the
> filesystem?

Yes, I didn't think the DocumentRoot/ServerRoot settings were really  
what I wanted to do, but I decided (for the time being) that it wasn't  
worth my time to pursue.  I will try to come back and take another  
crack at it later.

Note, though, that with the setup above, the problem is accessing Pier  
pages.  It serves static files just fine.

David


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki