Comments interspersed...

Oleg wrote:
--- Kym Farnik <[EMAIL PROTECTED]> wrote:

> Oleg wrote:
> > > Anyone got Oleg Kobchenko's JHP working on Windows using Apache rather 
than IIS?
> > >
> > > Please post a how-to!
> >
> > There are a few possibilities:
> >  - url rewrite to IIS serving from a different port
> >  - use pattern for UNIX with a cmd script instead of bash
> >  - use cygwin for bash script
> >
> > Are there any particular problems or questions?
>
> All working now, using Apache 2.2.4.
> My J601 installed to C:\Jsoftware
> JHP examples moved to C:\Jsoftware\jhp
> I've made the Jsoftware directory browsable by Apache for now.
>
>
> FYI Configs:
> **************
> 1. Cygwin installed.
>
> 2. Apache:
> Alias /Jsoftware "C:/Jsoftware"
> <Directory "C:/Jsoftware">
>   Options Includes Indexes FollowSymLinks MultiViews
>   AllowOverride All
>   Order allow,deny
>   Allow from all
> </Directory>
>
> 3. and in  C:\Jsoftware\jhp\.htaccess :
> RewriteEngine on
> RewriteBase   /jhp/
> RewriteRule   .*\.jhp  /cgi-bin/jhp.sh
>
> 4. jhp.sh in apache cgi-bin directory: (saved in Unix file format not DOS!!)
> #!C:/cygwin/bin/sh
> export PATH_TRANSLATED=`echo $SCRIPT_URL | sed -e 's|^/|C:/|'`
> export J_PATH=C:/Jsoftware
> $J_PATH/jconsole.exe C:/Jsoftware/addons/web/jhp/run.ijs $*
>
> 5. Browse to http://localhost/Jsoftware/jhp for testing
>
> The main issue I had to debug was making the jhp.sh file Unix format
> as in DOS format Cygwin adds a <CR> to the exports.
>
> This is easy if you create the file from cygwin or use Notepad++ as an
> editor and save in Unix format.
>
> Oleg: Feel free to add the above to your doco for JHP.

Congratulations. This is really an achivement!

Seeing  #!C:/cygwin/bin/sh  made me pause.

There are a few details to clarify. But first I would like to
point out how the configuration pattern chosen for JHP
works out on various systems, in a way that the separation
layer ensures that neither the library code nor,
more importantly, user code (JHP pages) require any changes
when installed on various systems.

Now a few comments.

Is Apache a Windows application or a part of cygwin?
   http://httpd.apache.org/docs/1.3/cygwin.html
And if the latter would provide more UNIX-like configuration.

Using Apache 2.2.4 Windows native installation - much faster due to threading.

If the former, would a jhp.cmd script work instead of bash,
which would exclude cygwin altogether. Something like

@echo off
set PATH_TRANSLATED=C:%SCRIPT_URL%
C:\Jsoftware\jconsole.exe web/jhp/run %*

Yes, but for some reason I had trouble getting this to work.
I have cygwin installed anyway it was not an issue to me.


<Directory "C:/Jsoftware">
should probably be <Directory "/Jsoftware">

The "<Directory" directive references the file system not the Apache
URI path so I have always put the windows device, which is very
important when serving off another drive (-. C:).
Ref: http://httpd.apache.org/docs/2.2/mod/core.html#directory

It's not a good idea to expose all J installation to the web,
but rather create more granular virtual folders.

Agreed, but here I am just playing on a local machine and it lets me
browse J source as well.

I have the J help browsable (and indexed by Swish-e) as well.

So, production for sure, but as it is only for me... Well I'm lazy
like most good developers :-)

> export J_PATH=C:/Jsoftware
should be JPATHj601

Fixed - thanks.

You need to reinstall cygwin and specify to use \n instead of \r\n.
Otherwise there will be many more such inconsistencies.

A style thing - I keep cygwin in Unix mode as I share files with a
Linux box as well.  I don't have to think about file formats as I try
and keep all in Unix style by default.

Thank you for offering your configuration experience.

No problems! Apache/Windows is fast and secure and lets me run similar
environments on varying platforms, at this stage JHP is an experiment
(which is working nicely!).

--
Regards, Kym Farnik
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
http://www.farnik.com Trivia: My 1st Computer
http://en.wikipedia.org/wiki/IBM_1130
Phone:  +61 8 8265 5324
Mobile: 0438 014 007
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to