What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

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

What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

Helene Bilbo
As long i was working without the possibility to upload files in my seaside application i just worked with the seaside one-click image. Now i wonder what is the best way to develop on a local machine when working with static files - when on the server where the application will run later it will run with apache like described in the book in chapter 22.3.

1) I read on the newsgroups that it is not recommended to work via RFB directly on the real server (where the application will run later).
2) Is the best option a local installation of apache? How do I configure it (on Mac OSX Lion)? Is it easy to migrate the application to the real server (where the application will run later) this way?
3) Is it a good option to let the Pharo/Comanche Server do the serving of static files while developing on the local machine? How do I configure it? What do I have to change when i start uploading the application to the real (where the application will run later) server?

I know this has been asked on the newsgroups many times and there were many answers - but for a beginner like me with no prior experience in (web)developing thats the biggest obstacle up to now.. A small tutorial for this task would be very welcome on the seaside homepage or in the book.

Best regards, Helene.
Reply | Threaded
Open this post in threaded view
|

Re: What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

Johan Brichau-2
Hi Helene,

If you do not want to setup a front-end webserver on your development machine (like me), you can easily serve static files via Comanche/Seaside.

The Seaside-FileSystem package from the http://www.squeaksource.com/Seaside30LGPL repository contains the necessary functionality to easily do this.

From the Seaside configuration webpage, you can then add a 'File directory' (as an application). This allows you to serve files from a directory on disk via the built-in webserver of the Smalltalk image.

Hope that sets you on your way!

cheers
Johan

On 08 Jan 2012, at 20:06, Helene Bilbo wrote:

> As long i was working without the possibility to upload files in my seaside
> application i just worked with the seaside one-click image. Now i wonder
> what is the best way to develop on a local machine when working with static
> files - when on the server where the application will run later it will run
> with apache like described in the book in chapter 22.3.
>
> 1) I read on the newsgroups that it is not recommended to work via RFB
> directly on the real server (where the application will run later).
> 2) Is the best option a local installation of apache? How do I configure it
> (on Mac OSX Lion)? Is it easy to migrate the application to the real server
> (where the application will run later) this way?
> 3) Is it a good option to let the Pharo/Comanche Server do the serving of
> static files while developing on the local machine? How do I configure it?
> What do I have to change when i start uploading the application to the real
> (where the application will run later) server?
>
> I know this has been asked on the newsgroups many times and there were many
> answers - but for a beginner like me with no prior experience in
> (web)developing thats the biggest obstacle up to now.. A small tutorial for
> this task would be very welcome on the seaside homepage or in the book.
>
> Best regards, Helene.
>
> --
> View this message in context: http://forum.world.st/What-is-the-recommended-setup-to-develop-locally-on-Mac-OSX-Lion-with-Pharo-and-Seaside-tp4276453p4276453.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

Paul DeBruicker
You can also set up Comanche to serve static files by subclassing
WAComancheAdaptor and adding a method like:

createService
        | contentPath dirPath svc ma |
        contentPath := 'htdocs'.
        dirPath := FileDirectory default fullNameFor: contentPath.
        svc := (HttpService on: self port) name: 'seaside-' , self port
greaseString.
        ma := ModuleAssembly core.
        ma
                alias: '/js'
                to: [
                        ma serverRoot: dirPath.
                        ma documentRoot: dirPath , '/js'.
                        ma directoryIndex: 'index.html index.htm'.
                        ma serveFiles ].
        ma
                alias: '/css'
                to: [
                        ma serverRoot: dirPath.
                        ma documentRoot: dirPath , '/css'.
                        ma directoryIndex: 'index.html index.htm'.
                        ma serveFiles ].
        ma
                alias: '/images'
                to: [
                        ma serverRoot: dirPath.
                        ma documentRoot: dirPath , '/images'.
                        ma directoryIndex: 'index.html index.htm'.
                        ma serveFiles ].
        ma
                alias: '/fonts'
                to: [
                        ma serverRoot: dirPath.
                        ma documentRoot: dirPath , '/fonts'.
                        ma directoryIndex: 'index.html index.htm'.
                        ma serveFiles ].
        ma addPlug: self.
        svc plug: ma rootModule.
        ^ svc



Then starting your new adaptor from the Seaside Control Panel or
programmatically.  Then set your resourceBaseUrl to '' when you
initialize your app e.g.:

app preferenceAt: #resourceBaseUrl put: '';

Any reference like

anHtmlRoot stylesheet resourceUrl:'css/style.css'

will point to the file in

<Pharo Image Directory>/htdocs/css/style.css



On 12-01-08 11:26 AM, Johan Brichau wrote:

> Hi Helene,
>
> If you do not want to setup a front-end webserver on your development machine (like me), you can easily serve static files via Comanche/Seaside.
>
> The Seaside-FileSystem package from the http://www.squeaksource.com/Seaside30LGPL repository contains the necessary functionality to easily do this.
>
>  From the Seaside configuration webpage, you can then add a 'File directory' (as an application). This allows you to serve files from a directory on disk via the built-in webserver of the Smalltalk image.
>
> Hope that sets you on your way!
>
> cheers
> Johan
>
> On 08 Jan 2012, at 20:06, Helene Bilbo wrote:
>
>> As long i was working without the possibility to upload files in my seaside
>> application i just worked with the seaside one-click image. Now i wonder
>> what is the best way to develop on a local machine when working with static
>> files - when on the server where the application will run later it will run
>> with apache like described in the book in chapter 22.3.
>>
>> 1) I read on the newsgroups that it is not recommended to work via RFB
>> directly on the real server (where the application will run later).
>> 2) Is the best option a local installation of apache? How do I configure it
>> (on Mac OSX Lion)? Is it easy to migrate the application to the real server
>> (where the application will run later) this way?
>> 3) Is it a good option to let the Pharo/Comanche Server do the serving of
>> static files while developing on the local machine? How do I configure it?
>> What do I have to change when i start uploading the application to the real
>> (where the application will run later) server?
>>
>> I know this has been asked on the newsgroups many times and there were many
>> answers - but for a beginner like me with no prior experience in
>> (web)developing thats the biggest obstacle up to now.. A small tutorial for
>> this task would be very welcome on the seaside homepage or in the book.
>>
>> Best regards, Helene.
>>
>> --
>> View this message in context: http://forum.world.st/What-is-the-recommended-setup-to-develop-locally-on-Mac-OSX-Lion-with-Pharo-and-Seaside-tp4276453p4276453.html
>> Sent from the Seaside General mailing list archive at Nabble.com.
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

Philippe Marschall
In reply to this post by Helene Bilbo
2012/1/8 Helene Bilbo <[hidden email]>:
> As long i was working without the possibility to upload files in my seaside
> application i just worked with the seaside one-click image. Now i wonder
> what is the best way to develop on a local machine when working with static
> files - when on the server where the application will run later it will run
> with apache like described in the book in chapter 22.3.
>
> 1) I read on the newsgroups that it is not recommended to work via RFB
> directly on the real server (where the application will run later).

That's true.

> 2) Is the best option a local installation of apache?

Yes

> How do I configure it (on Mac OSX Lion)?

See the following chapters [1] [2] in the book.

I use the following in /etc/apache2/other/seaside.conf but this
doesn't deal with files.

<Location />
        Order allow,deny
        Allow from all
        ProxyPass ajp://localhost:8003/
        ProxyPassReverse ajp://localhost:8003/
</Location>

> Is it easy to migrate the application to the real server
> (where the application will run later) this way?

Yes.

> 3) Is it a good option to let the Pharo/Comanche Server do the serving of
> static files while developing on the local machine?

It's generally best to have your development setup match your
production setup. Less surprises in production this way.

> How do I configure it?
> What do I have to change when i start uploading the application to the real
> (where the application will run later) server?

It's generally best if you have some sort of automated build process
that builds your production image. Then upload the image instead of
manually loading the code in the production image.

> I know this has been asked on the newsgroups many times and there were many
> answers - but for a beginner like me with no prior experience in
> (web)developing thats the biggest obstacle up to now.. A small tutorial for
> this task would be very welcome on the seaside homepage or in the book.

Our deployment story sucks (everybody has to invent his own) we're
aware of this.

 [1] http://book.seaside.st/book/advanced/deployment/deployment-apache/configure-apache
 [2] http://book.seaside.st/book/advanced/deployment/deployment-apache/serving-files

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

John Toohey
In reply to this post by Helene Bilbo
As Philippe mentioned, its very important that your production system
matches your development one. My current project involves Java
Servers, MQ Servers, Cache  Servers and Console Servers written in
Pharo/SeaSide. I develop mostly on OSX and deploy to Linux. Learning
the hard way, I finally came up with a system that allows me to
develop and deploy on *exactly* the same system, and allows me to
manage multiple projects, some dating back years.

I use Vagrant and VirtualBox to create Ubunti images on my laptop that
I use for development and then using the same scripts to deploy and
build production servers that match my local ones.

I wrote a short post about it here,
http://blog.meta-spaces.com/blog/2011/09/05/Vagrant/, but if you are
willing to spend a week building your own scripts, this approach will
pay itself back many times over. The script are all stored in a git
repo, so I can re-create any system whenever I need to.

I always server static files from nginx, and normally use Postgres as
my DB. Each of these servers runs in a VM, and are easily accessed
from Pharo. When I am working on something else, I simply spin them
down. For staging deployment, I use knife-solo on the same scripts,
and my servers are configured and deployed remotely (Normally EC2).

On Sun, Jan 8, 2012 at 14:06, Helene Bilbo
<[hidden email]> wrote:

> As long i was working without the possibility to upload files in my seaside
> application i just worked with the seaside one-click image. Now i wonder
> what is the best way to develop on a local machine when working with static
> files - when on the server where the application will run later it will run
> with apache like described in the book in chapter 22.3.
>
> 1) I read on the newsgroups that it is not recommended to work via RFB
> directly on the real server (where the application will run later).
> 2) Is the best option a local installation of apache? How do I configure it
> (on Mac OSX Lion)? Is it easy to migrate the application to the real server
> (where the application will run later) this way?
> 3) Is it a good option to let the Pharo/Comanche Server do the serving of
> static files while developing on the local machine? How do I configure it?
> What do I have to change when i start uploading the application to the real
> (where the application will run later) server?
>
> I know this has been asked on the newsgroups many times and there were many
> answers - but for a beginner like me with no prior experience in
> (web)developing thats the biggest obstacle up to now.. A small tutorial for
> this task would be very welcome on the seaside homepage or in the book.
>
> Best regards, Helene.
>
> --
> View this message in context: http://forum.world.st/What-is-the-recommended-setup-to-develop-locally-on-Mac-OSX-Lion-with-Pharo-and-Seaside-tp4276453p4276453.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



--
~JT
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: What is the recommended setup to develop locally (on Mac OSX Lion) with Pharo and Seaside?

Helene Bilbo
In reply to this post by Helene Bilbo
Thank you for your suggestions. I tried out the first three (the Vagrant and VirtualBox approach sounds good but is at the moment far too complicated for me considering my actual skills).

It took me a long time to figure out how to configure apache locally to serve files and forward everything else to seaside. And also it seems to work many things remain unclear to me for the moment. I guess I have to learn about it anyhow in the future..

What I would have liked to have was something like MASS (Macintosh, Apache, Seaside, Smalltalk) as there is MAMP (Macintosh, Apache, Mysql and PHP): http://www.mamp.info/ A preconfigured one-click thing :)

Thank you again,
Helene.