Hi, Petr,

From: "Petr Krenzelok"
> so we've got 'build-markup function. It is said to work just
> like php does. In a few days, I am supposed to try the
> concept together with my  friend. We need following - he
> does graphics and html layout, I do script. Now how to
> combine our work?
>
> The work of designer and scripter is the same for PHP and
> Rebol now, but the difference comes in following areas:
>
>  - PHP is precompiled with Apache in most cases, so let's
> assume it is so. The only thing the team needs is to put
> resulting page wherever they want into their web-site structure

It depends on the platform as to how this is accomplished.  You may have to
do some poking around to find the best set-up for Windows-based Apache
servers.

That said, you will need to configure Apache to recognize PHP pages, and to
decide which extension represents the best default.  For eaxmple, in
httpd.conf:
    <IfModule mod_dir.c>
        DirectoryIndex index.html index.shtml index.php index.r
    </IfModule>
If a Url only specifies a path, and not page, the above entry tells Apache
in which order to search for the default.  You can decide on the name and
the extension and any order you wish.

If you decide to load the PHP module on a Windows platform, then you will
need something like the following in httpd.conf
    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddType application/x-httpd-php .php .php4 .php3 .phtml
    AddType application/x-httpd-php-source .phps

And finally you do have to configure PHP to work with Apache.  On Windows,
the php.ini file is stored under \windows directory.  The defaults
frequently work now.

Outside of these provisos, then yes, generally you can put .php pages in any
directory.

> - now REBOL - no Apache module, only X time slower
> CGI interface is left.

Many major web hosting services still choose to use php solely as a cgi,
because they do not want to risk bringing down a shared server.  In this
case, the two solutions may be very comparable.

> CGI scripts are supposed to be placed mostly into
> /cgi-bin or so subdirectory,

A script alias should be set up in the httpd.conf file for apache, and might
look something like this:
    ScriptAlias /cgi-bin/ "/path/to/safe-directory/cgi-bin/"
Ideally this directory should be *off* the path of the www pages.  It's a
security thing.

> but I want such page to be placed everywhere in
> web-site directory structure - simply an equivalent of
> PHP. How to set apache for that?

Early in the httpd.conf file, there is a place to set default permissions
for all directories.  It looks something like:
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

Later, following the setting of the document root, you set the permissions
on that directory.  That line will need to include ExecCGI, and may look
something like the following:
    Options Indexes FollowSymLinks Includes ExecCGI MultiViews

Next, you will need an AddHandler line to tell Apache which extensions are
executable. Normally, you might see
    AddHandler cgi-script .cgi
You can change this to any extension you wish, or add additional lines with
additional extensions:
    AddHandler cgi-script .r
You can choose any extension you want, as long as it doesn't conflict with
another type.

Alternatively, you can specify fully executable directory paths as seen
below.  I've only played with this just a bit, and don't recall much more
about it.

<Location /local>
    ForceType application/x-httpd-r
</Location>

> - so - next point - what form is my friend supposed to
> upload resulting page in?

ASCII format and with what ever extension you have chosen from above.

> Let's even assume he names his creation some-page.cgi
> and puts it into /cgi-bin directory. How am I supposed to
> start rebol now to let my RSPs to be translated (code evaluated)?

The pages that run on REBOL will still need the #! path.  Apache knows how
to find REBOL based on this, and it knows the file is "executable" based on
the extension.

By the way, it case it isn't obvious, all the executable pages will still
need a chmod to 755 on any *nix platform.

> #/usr/bin/rebol -cs build-tag what? How do I specify the input (self?)

It would be:
#!/usr/bin/rebol -cs

But I am not following the second half of this sentence.

Good luck.  Hopefully I didn't make any typos.

BTW, I would highly recommend setting up a local development platform before
uploading anything to a website.  It is just a lot easier to work with.
--Scott Jones

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to