ruby-web 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +474 -0
- data/INSTALL.txt +9 -0
- data/InstalledFiles +180 -0
- data/LICENSE.txt +74 -0
- data/Rakefile +529 -0
- data/TODO +65 -0
- data/doc/additional.xml +149 -0
- data/doc/core.xml +652 -0
- data/doc/credits/index.xml +52 -0
- data/doc/credits/php.contributors.xml +118 -0
- data/doc/credits/php.language-snippets.ent +622 -0
- data/doc/install/index.xml +136 -0
- data/doc/install/mac/index.xml +21 -0
- data/doc/install/ruby-web.install.rb.instructions.xml +7 -0
- data/doc/install/unix/index.xml +46 -0
- data/doc/install/win/apache1.xml +166 -0
- data/doc/install/win/apache2.xml +141 -0
- data/doc/install/win/iis.xml +162 -0
- data/doc/install/win/index.xml +24 -0
- data/doc/install/win/installer.xml +31 -0
- data/doc/install/win/manual.xml +43 -0
- data/doc/manual.xml +69 -0
- data/doc/old/apache_cgi.txt +23 -0
- data/doc/old/fastcgi.txt +23 -0
- data/doc/old/mod_ruby.txt +21 -0
- data/doc/old/snippets.rdoc +183 -0
- data/doc/old/webrick.txt +23 -0
- data/doc/old/windows_cgi.txt +9 -0
- data/doc/tutorial.xml +14 -0
- data/doc/xsl/manual-multi.xsl +10 -0
- data/doc/xsl/manual-pdf.xsl +6 -0
- data/doc/xsl/manual-single.xsl +6 -0
- data/doc/xsl/manual.css +22 -0
- data/install.rb +1022 -0
- data/lib/formatter.rb +314 -0
- data/lib/html-parser.rb +429 -0
- data/lib/htmlrepair.rb +113 -0
- data/lib/htmlsplit.rb +842 -0
- data/lib/sgml-parser.rb +332 -0
- data/lib/web.rb +68 -0
- data/lib/web/assertinclude.rb +129 -0
- data/lib/web/config.rb +50 -0
- data/lib/web/connection.rb +1070 -0
- data/lib/web/convenience.rb +154 -0
- data/lib/web/formreader.rb +318 -0
- data/lib/web/htmlparser/html-parser.rb +429 -0
- data/lib/web/htmlparser/sgml-parser.rb +332 -0
- data/lib/web/htmltools/element.rb +296 -0
- data/lib/web/htmltools/stparser.rb +276 -0
- data/lib/web/htmltools/tags.rb +286 -0
- data/lib/web/htmltools/tree.rb +139 -0
- data/lib/web/htmltools/xmltree.rb +160 -0
- data/lib/web/htmltools/xpath.rb +71 -0
- data/lib/web/info.rb +63 -0
- data/lib/web/load.rb +210 -0
- data/lib/web/mime.rb +87 -0
- data/lib/web/phprb.rb +340 -0
- data/lib/web/resources/test/cookie.rb +33 -0
- data/lib/web/resources/test/counter.rb +20 -0
- data/lib/web/resources/test/multipart.rb +14 -0
- data/lib/web/resources/test/redirect.rb +8 -0
- data/lib/web/resources/test/stock.rb +33 -0
- data/lib/web/sapi/apache.rb +129 -0
- data/lib/web/sapi/fastcgi.rb +22 -0
- data/lib/web/sapi/install/apache.rb +180 -0
- data/lib/web/sapi/install/iis.rb +93 -0
- data/lib/web/sapi/install/macosx.rb +90 -0
- data/lib/web/sapi/webrick.rb +86 -0
- data/lib/web/session.rb +83 -0
- data/lib/web/shim/cgi.rb +129 -0
- data/lib/web/shim/rails.rb +175 -0
- data/lib/web/stringio.rb +78 -0
- data/lib/web/strscanparser.rb +24 -0
- data/lib/web/tagparser.rb +96 -0
- data/lib/web/testing.rb +666 -0
- data/lib/web/traceoutput.rb +75 -0
- data/lib/web/unit.rb +56 -0
- data/lib/web/upload.rb +59 -0
- data/lib/web/validate.rb +52 -0
- data/lib/web/wiki.rb +557 -0
- data/lib/web/wiki/linker.rb +72 -0
- data/lib/web/wiki/page.rb +201 -0
- data/lib/webunit.rb +27 -0
- data/lib/webunit/assert.rb +152 -0
- data/lib/webunit/converter.rb +154 -0
- data/lib/webunit/cookie.rb +118 -0
- data/lib/webunit/domwalker.rb +185 -0
- data/lib/webunit/exception.rb +14 -0
- data/lib/webunit/form.rb +116 -0
- data/lib/webunit/frame.rb +37 -0
- data/lib/webunit/htmlelem.rb +122 -0
- data/lib/webunit/image.rb +26 -0
- data/lib/webunit/jscript.rb +31 -0
- data/lib/webunit/link.rb +33 -0
- data/lib/webunit/params.rb +321 -0
- data/lib/webunit/parser.rb +229 -0
- data/lib/webunit/response.rb +464 -0
- data/lib/webunit/runtest.rb +41 -0
- data/lib/webunit/table.rb +148 -0
- data/lib/webunit/testcase.rb +45 -0
- data/lib/webunit/ui/cui/testrunner.rb +50 -0
- data/lib/webunit/utils.rb +68 -0
- data/lib/webunit/webunit.rb +28 -0
- data/test/dev/action.rb +83 -0
- data/test/dev/forms.rb +104 -0
- data/test/dev/forms2.rb +104 -0
- data/test/dev/parser.rb +17 -0
- data/test/dev/scripts/dump.rb +24 -0
- data/test/dev/scripts/makedist.rb +62 -0
- data/test/dev/scripts/uri.rb +41 -0
- data/test/dev/scripts/uri/common.rb +432 -0
- data/test/dev/scripts/uri/ftp.rb +149 -0
- data/test/dev/scripts/uri/generic.rb +1106 -0
- data/test/dev/scripts/uri/http.rb +76 -0
- data/test/dev/scripts/uri/https.rb +26 -0
- data/test/dev/scripts/uri/ldap.rb +238 -0
- data/test/dev/scripts/uri/mailto.rb +260 -0
- data/test/dev/scripts/urireg.rb +174 -0
- data/test/dev/simpledispatcher.rb +156 -0
- data/test/dev/test.action.rb +146 -0
- data/test/dev/test.formreader.rb +463 -0
- data/test/dev/test.simpledispatcher.rb +186 -0
- data/test/dev/webunit/conv/digit-0.rb +21 -0
- data/test/dev/webunit/conv/digit-1.rb +17 -0
- data/test/dev/webunit/conv/digit.rb +23 -0
- data/test/dev/webunit/conv/test_digit-0.rb +16 -0
- data/test/dev/webunit/conv/test_digit-1.rb +19 -0
- data/test/dev/webunit/conv/test_digit.rb +26 -0
- data/test/dev/webunit/conv/test_digit_view-0.rb +76 -0
- data/test/dev/webunit/conv/test_digit_view-1.rb +102 -0
- data/test/dev/webunit/conv/test_digit_view.rb +134 -0
- data/test/installation/htdocs/cgi_test.rb +296 -0
- data/test/installation/htdocs/test_install.rb +4 -0
- data/test/installation/runwebtest.rb +5 -0
- data/test/installation/test_cookie.rb +128 -0
- data/test/installation/test_form.rb +47 -0
- data/test/installation/test_multipart.rb +51 -0
- data/test/installation/test_request.rb +24 -0
- data/test/installation/test_response.rb +35 -0
- data/test/unit/htdocs/cookie.rb +32 -0
- data/test/unit/htdocs/multipart.rb +28 -0
- data/test/unit/htdocs/redirect.rb +12 -0
- data/test/unit/htdocs/simple.rb +13 -0
- data/test/unit/htdocs/stock.rb +33 -0
- data/test/unit/test_assert.rb +162 -0
- data/test/unit/test_cookie.rb +114 -0
- data/test/unit/test_domwalker.rb +77 -0
- data/test/unit/test_form.rb +42 -0
- data/test/unit/test_frame.rb +40 -0
- data/test/unit/test_htmlelem.rb +74 -0
- data/test/unit/test_image.rb +45 -0
- data/test/unit/test_jscript.rb +57 -0
- data/test/unit/test_link.rb +85 -0
- data/test/unit/test_multipart.rb +51 -0
- data/test/unit/test_params.rb +210 -0
- data/test/unit/test_parser.rb +53 -0
- data/test/unit/test_response.rb +150 -0
- data/test/unit/test_table.rb +70 -0
- data/test/unit/test_utils.rb +106 -0
- data/test/unit/test_webunit.rb +28 -0
- data/test/web/mod_ruby_stub.rb +39 -0
- data/test/web/test.assertinclude.rb +109 -0
- data/test/web/test.buffer.rb +182 -0
- data/test/web/test.code.loader.rb +78 -0
- data/test/web/test.config.rb +31 -0
- data/test/web/test.error.handling.rb +91 -0
- data/test/web/test.formreader-2.0.rb +352 -0
- data/test/web/test.load.rb +125 -0
- data/test/web/test.mime-type.rb +23 -0
- data/test/web/test.narf.cgi.rb +106 -0
- data/test/web/test.phprb.rb +239 -0
- data/test/web/test.request.rb +368 -0
- data/test/web/test.response.rb +637 -0
- data/test/web/test.ruby-web.rb +10 -0
- data/test/web/test.session.rb +50 -0
- data/test/web/test.shim.cgi.rb +96 -0
- data/test/web/test.tagparser.rb +65 -0
- data/test/web/test.template2.rb +297 -0
- data/test/web/test.testing2.rb +318 -0
- data/test/web/test.upload.rb +45 -0
- data/test/web/test.validate.rb +46 -0
- data/test/web/test.web.test.rb +495 -0
- data/test/wiki/test.history.rb +297 -0
- data/test/wiki/test.illustration_page.rb +287 -0
- data/test/wiki/test.linker.rb +197 -0
- data/test/wiki/test.tarpit.rb +56 -0
- data/test/wiki/test.wiki.rb +300 -0
- data/test/wikitestroot/admin.rb +7 -0
- data/test/wikitestroot/wiki.rb +6 -0
- metadata +234 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<chapter id="install.general">
|
|
2
|
+
<title>General Installation Considerations</title>
|
|
3
|
+
<para>
|
|
4
|
+
To install ruby-web, you need a few things:
|
|
5
|
+
Ruby, ruby-web itself, a web server and a web browser. You
|
|
6
|
+
probably already have a web browser, and depending on
|
|
7
|
+
your operating system setup, you may also have a web
|
|
8
|
+
server (e.g. Apache on Linux and MacOS X; IIS on Windows).
|
|
9
|
+
</para>
|
|
10
|
+
|
|
11
|
+
<para>
|
|
12
|
+
There are two ways to use ruby-web: as a library, and as an extension
|
|
13
|
+
to the Ruby interpreter. Installing ruby-web as a library is simple,
|
|
14
|
+
and gives one access to the useful functions of ruby-web. There are
|
|
15
|
+
a few additional features which can be provided at a higher level:
|
|
16
|
+
</para>
|
|
17
|
+
|
|
18
|
+
<itemizedlist>
|
|
19
|
+
<listitem>
|
|
20
|
+
The big one: Web friendly reporting of all errors, including syntax errors
|
|
21
|
+
</listitem>
|
|
22
|
+
<listitem>
|
|
23
|
+
Dynamic web scripting with .rhtml documents, like php or coldfusion
|
|
24
|
+
</listitem>
|
|
25
|
+
<listitem>
|
|
26
|
+
I'm working on this one: consistent scope for interpreter state between requests
|
|
27
|
+
across different server environments
|
|
28
|
+
</listitem>
|
|
29
|
+
</itemizedlist>
|
|
30
|
+
|
|
31
|
+
<para>It's up to you, both options have been tested.</para>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<para>
|
|
35
|
+
While setting up the server and Ruby on your own, you can
|
|
36
|
+
generally choose between configuring ruby-web in a CGI or FastCGI processor.
|
|
37
|
+
This means you set up your server to use the CGI executable of
|
|
38
|
+
ruby-web to process all .rhtml and .rb file requests on the server.
|
|
39
|
+
</para>
|
|
40
|
+
|
|
41
|
+
<para>
|
|
42
|
+
ruby-web source code and binary distributions can be
|
|
43
|
+
found at
|
|
44
|
+
<ulink url="&url.ruby-web.downloads;">&url.ruby-web.downloads;</ulink>.
|
|
45
|
+
</para>
|
|
46
|
+
|
|
47
|
+
<para>
|
|
48
|
+
Finally, please note that these install instructions are a work in progress. Please report any problems at <ulink url="http://rubyforge.org/tracker/?group_id=873">http://rubyforge.org/tracker/?group_id=873</ulink>, so that we can solve your problem, and improve.
|
|
49
|
+
</para>
|
|
50
|
+
</chapter>
|
|
51
|
+
|
|
52
|
+
&install.windows;
|
|
53
|
+
|
|
54
|
+
&install.macos;
|
|
55
|
+
|
|
56
|
+
&install.unix;
|
|
57
|
+
|
|
58
|
+
<chapter>
|
|
59
|
+
<title>Webrick</title>
|
|
60
|
+
|
|
61
|
+
<para>ruby-web provides a Web::RubyWebHandler, based on the CGIHandler, to run ruby-web scripts. You will need to add the Web::RubyWebHandler to webrick with a startup script like this, replacing :DocumentRoot with the appropriate value:</para>
|
|
62
|
+
|
|
63
|
+
<programlisting>
|
|
64
|
+
#!/usr/local/bin/ruby
|
|
65
|
+
$: << File.dirname($0)
|
|
66
|
+
require 'webrick'
|
|
67
|
+
require 'web/sapi/webrick'
|
|
68
|
+
|
|
69
|
+
include WEBrick
|
|
70
|
+
|
|
71
|
+
dir = Dir::pwd
|
|
72
|
+
|
|
73
|
+
HTTPServlet::FileHandler.add_handler("rb", Web::RubyWebHandler)
|
|
74
|
+
HTTPServlet::FileHandler.add_handler("rhtml", Web::RubyWebHandler)
|
|
75
|
+
|
|
76
|
+
s = HTTPServer.new(:Port => 4476,
|
|
77
|
+
:DocumentRoot => "/.../htdocs/" )
|
|
78
|
+
trap("INT"){ s.shutdown }
|
|
79
|
+
s.start
|
|
80
|
+
</programlisting>
|
|
81
|
+
</chapter>
|
|
82
|
+
|
|
83
|
+
<chapter id="install.problems">
|
|
84
|
+
<title>Problems?</title>
|
|
85
|
+
|
|
86
|
+
<!--sect1 id="install.problems.faq">
|
|
87
|
+
<title>Read the FAQ</title>
|
|
88
|
+
<simpara>
|
|
89
|
+
Some problems are more common than others. The most
|
|
90
|
+
common ones are listed in the <link linkend="faq">PHP
|
|
91
|
+
FAQ</link>, part of this manual.
|
|
92
|
+
</simpara>
|
|
93
|
+
</sect1-->
|
|
94
|
+
|
|
95
|
+
<sect1 id="install.problems.support">
|
|
96
|
+
<title>Other problems</title>
|
|
97
|
+
|
|
98
|
+
<simpara>
|
|
99
|
+
If you are still stuck, someone on the ruby-web mailing list may be
|
|
100
|
+
able to help you. <!--You should check out the archive first, in case
|
|
101
|
+
someone already answered someone else who had the same problem as
|
|
102
|
+
you. The archives are available from the support page on <ulink
|
|
103
|
+
url="&url.ruby-web.support;">&url.ruby-web.support;</ulink>.--> To subscribe to the ruby-web installation
|
|
104
|
+
mailing list, submit the form at<ulink
|
|
105
|
+
url="mailto:&url.ruby-web.subscribe;">&url.ruby-web.subscribe;</ulink>.
|
|
106
|
+
The mailing list address is <ulink
|
|
107
|
+
url="mailto:&email.ruby-web;">&email.ruby-web;</ulink>.
|
|
108
|
+
</simpara>
|
|
109
|
+
<simpara>
|
|
110
|
+
If you want to get help on the mailing list, please try to be
|
|
111
|
+
precise and give the necessary details about your environment
|
|
112
|
+
(which operating system, what ruby-web version, what web server, if
|
|
113
|
+
you are running ruby-web as CGI or a server module, &safemode;, etc...), and
|
|
114
|
+
preferably enough code to make others able to reproduce and test
|
|
115
|
+
your problem.
|
|
116
|
+
</simpara>
|
|
117
|
+
</sect1>
|
|
118
|
+
|
|
119
|
+
<sect1 id="install.problems.bugs">
|
|
120
|
+
<title>Bug reports</title>
|
|
121
|
+
<simpara>
|
|
122
|
+
If you think you have found a bug in ruby-web, please report it. The
|
|
123
|
+
ruby-web developers probably don't know about it, and unless you
|
|
124
|
+
report it, chances are it won't be fixed. You can report bugs
|
|
125
|
+
using the bug-tracking system at <ulink
|
|
126
|
+
url="&url.ruby-web.bugs;">&url.ruby-web.bugs;</ulink>. Please do not
|
|
127
|
+
send bug reports in mailing list or personal letters. The
|
|
128
|
+
bug system is also suitable to submit feature requests.
|
|
129
|
+
</simpara>
|
|
130
|
+
<!--simpara>
|
|
131
|
+
Read the <ulink
|
|
132
|
+
url="&url.ruby-web.bugs.howtoreport;">How to report a bug</ulink>
|
|
133
|
+
document before submitting any bug reports!
|
|
134
|
+
</simpara-->
|
|
135
|
+
</sect1>
|
|
136
|
+
</chapter>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<chapter id="install_macosx">
|
|
2
|
+
<title>Mac OS X</title>
|
|
3
|
+
<para>
|
|
4
|
+
The simplest way to install ruby-web is to use the installer
|
|
5
|
+
found in the ruby-web.x.x.x-powerpc-darwin.dmg. This will install ruby-web
|
|
6
|
+
and configure the default Apache with mod_ruby.
|
|
7
|
+
</para>
|
|
8
|
+
|
|
9
|
+
<para>
|
|
10
|
+
The installer has been tested on Mac OS X Tiger (10.4).
|
|
11
|
+
Please let me know (install.help@hexane.org)
|
|
12
|
+
if you have success or failure on other versions of Mac OS X.
|
|
13
|
+
</para>
|
|
14
|
+
|
|
15
|
+
<para>
|
|
16
|
+
If the installer does not work on your version of Mac OS X,
|
|
17
|
+
use the unix instructions to install and configure ruby-web
|
|
18
|
+
by hand.
|
|
19
|
+
</para>
|
|
20
|
+
</chapter>
|
|
21
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<chapter id="install_unix">
|
|
2
|
+
<title>Unix / Other</title>
|
|
3
|
+
|
|
4
|
+
<sect1>
|
|
5
|
+
<title>Ruby-Web</title>
|
|
6
|
+
|
|
7
|
+
<para>ruby-web depends on Ruby 1.8.x. After installing ruby, download the latest ruby-web_x.x.x.tar.gz from <ulink url="http://rubyforge.org/frs/?group_id=873">Rubyforge.org</ulink>.</para>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<para>This will compile and install the ruby-web interpreter. You will have to configure the web servers separately.</para>
|
|
11
|
+
</sect1>
|
|
12
|
+
|
|
13
|
+
<sect1>
|
|
14
|
+
<title>Mod Ruby</title>
|
|
15
|
+
|
|
16
|
+
<para>First, configure and install the mod_ruby<ulink url="http://modruby.net/en/index.rbx/mod_ruby/install.html">mod_ruby</ulink></para>
|
|
17
|
+
|
|
18
|
+
<para>In http.conf setup apache to use the ruby-web runner, instead of the default mod_ruby runner:</para>
|
|
19
|
+
|
|
20
|
+
<programlisting>
|
|
21
|
+
<IfModule mod_ruby.c>
|
|
22
|
+
RubySafeLevel 0
|
|
23
|
+
# for Apache::RubyRun
|
|
24
|
+
RubyRequire web/sapi/apache
|
|
25
|
+
|
|
26
|
+
<Location / >
|
|
27
|
+
Options Indexes FollowSymLinks ExecCGI
|
|
28
|
+
AddHandler ruby-object cgi rb rhtml
|
|
29
|
+
RubyHandler Web::ModNarf.instance
|
|
30
|
+
</Location>
|
|
31
|
+
</IfModule>
|
|
32
|
+
</programlisting>
|
|
33
|
+
|
|
34
|
+
</sect1>
|
|
35
|
+
|
|
36
|
+
<sect1>
|
|
37
|
+
<title>FastCGI</title>
|
|
38
|
+
<para>To run fastcgi on unix, ruby-web depends on the 'fcgi' libary:</para>
|
|
39
|
+
<para>http://raa.ruby-lang.org/list.rhtml?name=fcgi</para>
|
|
40
|
+
|
|
41
|
+
<para>You will also need FastCGI running on your webserver. You can find a links to extensions for Apache and other web servers at the this website:</para>
|
|
42
|
+
|
|
43
|
+
<para>http://www.fastcgi.com</para>
|
|
44
|
+
</sect1>
|
|
45
|
+
</chapter>
|
|
46
|
+
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- $Revision: 1.16 $ -->
|
|
3
|
+
<sect1 id="install.windows.apache1">
|
|
4
|
+
<title>Apache 1.3.x on Microsoft Windows</title>
|
|
5
|
+
<para>
|
|
6
|
+
This section contains notes and hints specific to Apache 1.3.x installs
|
|
7
|
+
of PHP on Microsoft Windows systems. There are also
|
|
8
|
+
<link linkend="install.windows.apache2">instructions and notes
|
|
9
|
+
for Apache 2</link> on a separate page.
|
|
10
|
+
</para>
|
|
11
|
+
<note>
|
|
12
|
+
<para>
|
|
13
|
+
Please read the <link linkend="install.windows.manual">manual
|
|
14
|
+
installation steps</link> first!
|
|
15
|
+
</para>
|
|
16
|
+
</note>
|
|
17
|
+
|
|
18
|
+
<simpara>
|
|
19
|
+
There are two ways to set up PHP to work with Apache 1.3.x
|
|
20
|
+
on Windows. One is to use the CGI binary (<filename>php.exe</filename>
|
|
21
|
+
for PHP 4 and <filename>php-cgi.exe</filename> for PHP 5),
|
|
22
|
+
the other is to use the Apache Module DLL. In either case
|
|
23
|
+
you need to edit your &httpd.conf; to configure Apache to
|
|
24
|
+
work with PHP, and then restart the server.
|
|
25
|
+
</simpara>
|
|
26
|
+
|
|
27
|
+
<simpara>
|
|
28
|
+
It is worth noting here that now the SAPI module has been
|
|
29
|
+
made more stable under Windows, we recommend it's use above
|
|
30
|
+
the CGI binary, since it is more transparent and secure.
|
|
31
|
+
</simpara>
|
|
32
|
+
|
|
33
|
+
<simpara>
|
|
34
|
+
Although there can be a few variations of configuring PHP
|
|
35
|
+
under Apache, these are simple enough to be used by the
|
|
36
|
+
newcomer. Please consult the Apache Documentation for further
|
|
37
|
+
configuration directives.
|
|
38
|
+
</simpara>
|
|
39
|
+
|
|
40
|
+
<simpara>
|
|
41
|
+
After changing the configuration file, remember to restart the server, for
|
|
42
|
+
example, <command>NET STOP APACHE</command> followed by
|
|
43
|
+
<command>NET START APACHE</command>, if you run Apache as a Windows
|
|
44
|
+
Service, or use your regular shortcuts.
|
|
45
|
+
</simpara>
|
|
46
|
+
|
|
47
|
+
¬e.apache.slashes;
|
|
48
|
+
|
|
49
|
+
<sect2 id="install.windows.apache1.module">
|
|
50
|
+
<title>Installing as an Apache module</title>
|
|
51
|
+
<para>
|
|
52
|
+
You should add the following lines to your Apache &httpd.conf; file:
|
|
53
|
+
</para>
|
|
54
|
+
<para>
|
|
55
|
+
<example>
|
|
56
|
+
<title>PHP as an Apache 1.3.x module</title>
|
|
57
|
+
<para>
|
|
58
|
+
This assumes PHP is installed to <filename>c:\php</filename>. Adjust the
|
|
59
|
+
path if this is not the case.
|
|
60
|
+
</para>
|
|
61
|
+
<para>
|
|
62
|
+
For PHP 4:
|
|
63
|
+
</para>
|
|
64
|
+
<programlisting role="apache-conf">
|
|
65
|
+
<![CDATA[
|
|
66
|
+
# Add to the end of the LoadModule section
|
|
67
|
+
# Don't forget to copy this file from the sapi directory!
|
|
68
|
+
LoadModule php4_module "C:/php/php4apache.dll"
|
|
69
|
+
|
|
70
|
+
# Add to the end of the AddModule section
|
|
71
|
+
AddModule mod_php4.c
|
|
72
|
+
]]>
|
|
73
|
+
</programlisting>
|
|
74
|
+
<para>
|
|
75
|
+
For PHP 5:
|
|
76
|
+
</para>
|
|
77
|
+
<programlisting role="apache-conf">
|
|
78
|
+
<![CDATA[
|
|
79
|
+
# Add to the end of the LoadModule section
|
|
80
|
+
LoadModule php5_module "C:/php/php5apache.dll"
|
|
81
|
+
|
|
82
|
+
# Add to the end of the AddModule section
|
|
83
|
+
AddModule mod_php5.c
|
|
84
|
+
]]>
|
|
85
|
+
</programlisting>
|
|
86
|
+
<para>
|
|
87
|
+
For both:
|
|
88
|
+
</para>
|
|
89
|
+
<programlisting role="apache-conf">
|
|
90
|
+
<![CDATA[
|
|
91
|
+
# Add this line inside the <IfModule mod_mime.c> conditional brace
|
|
92
|
+
AddType application/x-httpd-php .php
|
|
93
|
+
|
|
94
|
+
# For syntax highlighted .phps files, also add
|
|
95
|
+
AddType application/x-httpd-php-source .phps
|
|
96
|
+
]]>
|
|
97
|
+
</programlisting>
|
|
98
|
+
</example>
|
|
99
|
+
</para>
|
|
100
|
+
</sect2>
|
|
101
|
+
|
|
102
|
+
<sect2 id="install.windows.apache1.cgi">
|
|
103
|
+
<title>Installing as a CGI binary</title>
|
|
104
|
+
|
|
105
|
+
<para>
|
|
106
|
+
If you unzipped the PHP package to <filename>C:\php\</filename> as described
|
|
107
|
+
in the <link linkend="install.windows.manual">Manual
|
|
108
|
+
Installation Steps</link> section, you need to insert
|
|
109
|
+
these lines to your Apache configuration file to set
|
|
110
|
+
up the CGI binary:
|
|
111
|
+
<example>
|
|
112
|
+
<title>PHP and Apache 1.3.x as CGI</title>
|
|
113
|
+
<programlisting role="apache-conf">
|
|
114
|
+
<![CDATA[
|
|
115
|
+
ScriptAlias /php/ "c:/php/"
|
|
116
|
+
AddType application/x-httpd-php .php
|
|
117
|
+
|
|
118
|
+
# For PHP 4
|
|
119
|
+
Action application/x-httpd-php "/php/php.exe"
|
|
120
|
+
|
|
121
|
+
# For PHP 5
|
|
122
|
+
Action application/x-httpd-php "/php/php-cgi.exe"
|
|
123
|
+
|
|
124
|
+
# specify the directory where php.ini is
|
|
125
|
+
SetEnv PHPRC C:/php
|
|
126
|
+
]]>
|
|
127
|
+
</programlisting>
|
|
128
|
+
</example>
|
|
129
|
+
Note that the second line in the list above can be found
|
|
130
|
+
in the actual versions of &httpd.conf;, but it is commented out. Remember
|
|
131
|
+
also to substitute the <filename>c:/php/</filename> for your actual path to
|
|
132
|
+
PHP.
|
|
133
|
+
</para>
|
|
134
|
+
&warn.install.cgi;
|
|
135
|
+
<simpara>
|
|
136
|
+
If you would like to present PHP source files syntax highlighted, there
|
|
137
|
+
is no such convenient option as with the module version of PHP.
|
|
138
|
+
If you chose to configure Apache to use PHP as a CGI binary, you
|
|
139
|
+
will need to use the <function>highlight_file</function> function. To
|
|
140
|
+
do this simply create a PHP script file and add this code:
|
|
141
|
+
<literal><?php highlight_file('some_php_script.php'); ?></literal>.
|
|
142
|
+
</simpara>
|
|
143
|
+
</sect2>
|
|
144
|
+
|
|
145
|
+
</sect1>
|
|
146
|
+
|
|
147
|
+
<!-- Keep this comment at the end of the file
|
|
148
|
+
Local variables:
|
|
149
|
+
mode: sgml
|
|
150
|
+
sgml-omittag:t
|
|
151
|
+
sgml-shorttag:t
|
|
152
|
+
sgml-minimize-attributes:nil
|
|
153
|
+
sgml-always-quote-attributes:t
|
|
154
|
+
sgml-indent-step:1
|
|
155
|
+
sgml-indent-data:t
|
|
156
|
+
indent-tabs-mode:nil
|
|
157
|
+
sgml-parent-document:nil
|
|
158
|
+
sgml-default-dtd-file:"../../manual.ced"
|
|
159
|
+
sgml-exposed-tags:nil
|
|
160
|
+
sgml-local-catalogs:nil
|
|
161
|
+
sgml-local-ecat-files:nil
|
|
162
|
+
End:
|
|
163
|
+
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
164
|
+
vim: et tw=78 syn=sgml
|
|
165
|
+
vi: ts=1 sw=1
|
|
166
|
+
-->
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- $Revision: 1.13 $ -->
|
|
3
|
+
<sect1 id="install.windows.apache2">
|
|
4
|
+
<title>Apache 2.0.x on Microsoft Windows</title>
|
|
5
|
+
<para>
|
|
6
|
+
This section contains notes and hints specific to Apache 2.0.x installs
|
|
7
|
+
of ruby-web on Microsoft Windows systems. We also
|
|
8
|
+
have <link linkend="install.windows.apache1">instructions and notes
|
|
9
|
+
for Apache 1.3.x users on a separate page</link>.
|
|
10
|
+
</para>
|
|
11
|
+
<note>
|
|
12
|
+
<para>
|
|
13
|
+
You should read the <link linkend="install.windows.manual">manual
|
|
14
|
+
installation steps</link> first!
|
|
15
|
+
</para>
|
|
16
|
+
</note>
|
|
17
|
+
|
|
18
|
+
<para>
|
|
19
|
+
You are highly encouraged to take a look at the
|
|
20
|
+
<ulink url="&url.apache2.docs;">Apache Documentation</ulink> to get
|
|
21
|
+
a basic understanding of the Apache 2.0.x Server. Also consider to
|
|
22
|
+
read the <ulink url="&url.apache2.windows;">Windows specific
|
|
23
|
+
notes</ulink> for Apache 2.0.x before reading on here.
|
|
24
|
+
</para>
|
|
25
|
+
|
|
26
|
+
<warning>
|
|
27
|
+
<para>
|
|
28
|
+
Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or
|
|
29
|
+
Windows XP. At this time, support for Windows 9x is incomplete.
|
|
30
|
+
Apache 2.0.x is not expected to work on those platforms at this time.
|
|
31
|
+
</para>
|
|
32
|
+
</warning>
|
|
33
|
+
<para>
|
|
34
|
+
Download the most recent version of <ulink url= "&url.apache;">
|
|
35
|
+
Apache 2.0.x</ulink> and a fitting ruby-web version.
|
|
36
|
+
Follow the <link linkend="install.windows.manual">Manual Installation
|
|
37
|
+
Steps</link> and come back to go on with the integration of ruby-web and Apache.
|
|
38
|
+
</para>
|
|
39
|
+
<para>
|
|
40
|
+
There are two ways to set up ruby-web to work with Apache 2.0.x on Windows.
|
|
41
|
+
One is to use the CGI binary the other is to use the Apache module DLL.
|
|
42
|
+
In either case you need to edit your &httpd.conf; to configure Apache
|
|
43
|
+
to work with ruby-web and then restart the server.
|
|
44
|
+
</para>
|
|
45
|
+
|
|
46
|
+
¬e.apache.slashes;
|
|
47
|
+
|
|
48
|
+
<sect2 id="install.windows.apache2.cgi">
|
|
49
|
+
<title>Installing as a CGI binary</title>
|
|
50
|
+
|
|
51
|
+
<para>
|
|
52
|
+
You need to insert these three lines to your Apache &httpd.conf;
|
|
53
|
+
configuration file to set up the CGI binary:
|
|
54
|
+
<example>
|
|
55
|
+
<title>ruby-web and Apache 2.0 as CGI</title>
|
|
56
|
+
<programlisting role="apache-conf">
|
|
57
|
+
<![CDATA[
|
|
58
|
+
ScriptAlias /ruby-web/ "c:/ruby/bin"
|
|
59
|
+
AddType application/x-httpd-ruby .rb
|
|
60
|
+
|
|
61
|
+
Action application/x-httpd-rb "/ruby-web/ruby-web.exe"
|
|
62
|
+
|
|
63
|
+
]]>
|
|
64
|
+
</programlisting>
|
|
65
|
+
</example>
|
|
66
|
+
</para>
|
|
67
|
+
&warn.install.cgi;
|
|
68
|
+
</sect2>
|
|
69
|
+
|
|
70
|
+
<sect2 id="install.windows.apache2.module">
|
|
71
|
+
<title>Installing as an Apache module</title>
|
|
72
|
+
<para>
|
|
73
|
+
You need to insert these two lines to your
|
|
74
|
+
Apache &httpd.conf; configuration file to set up the
|
|
75
|
+
ruby-web module for Apache 2.0:
|
|
76
|
+
<example>
|
|
77
|
+
<title>ruby-web and Apache 2.0 as Module</title>
|
|
78
|
+
<programlisting role="apache-conf">
|
|
79
|
+
<![CDATA[
|
|
80
|
+
# For PHP 4 do something like this:
|
|
81
|
+
LoadModule php4_module "c:/php/php4apache2.dll"
|
|
82
|
+
# Don't forget to copy the php4apache2.dll file from the sapi directory!
|
|
83
|
+
AddType application/x-httpd-php .php
|
|
84
|
+
|
|
85
|
+
# For PHP 5 do something like this:
|
|
86
|
+
LoadModule php5_module "c:/php/php5apache2.dll"
|
|
87
|
+
AddType application/x-httpd-php .php
|
|
88
|
+
|
|
89
|
+
# configure the path to php.ini
|
|
90
|
+
PHPIniDir "C:/php"
|
|
91
|
+
]]>
|
|
92
|
+
</programlisting>
|
|
93
|
+
</example>
|
|
94
|
+
</para>
|
|
95
|
+
<note>
|
|
96
|
+
<simpara>
|
|
97
|
+
Remember to substitute your actual path to PHP for the
|
|
98
|
+
<filename>c:/php/</filename> in the above examples. Take care to use
|
|
99
|
+
either <filename>php4apache2.dll</filename> or
|
|
100
|
+
<filename>php5apache2.dll</filename> in your LoadModule directive and
|
|
101
|
+
<emphasis>not</emphasis> <filename>php4apache.dll</filename> or
|
|
102
|
+
<filename>php5apache.dll</filename> as the latter ones are designed to
|
|
103
|
+
run with <link linkend="install.windows.apache1">Apache 1.3.x</link>.
|
|
104
|
+
</simpara>
|
|
105
|
+
</note>
|
|
106
|
+
<note>
|
|
107
|
+
<para>
|
|
108
|
+
If you want to use content negotiation, read
|
|
109
|
+
<link linkend="faq.installation.apache.multiviews">related FAQ</link>.
|
|
110
|
+
</para>
|
|
111
|
+
</note>
|
|
112
|
+
<warning>
|
|
113
|
+
<simpara>
|
|
114
|
+
Don't mix up your installation with DLL files from
|
|
115
|
+
<emphasis>different PHP versions</emphasis>. You have the only choice
|
|
116
|
+
to use the DLL's and extensions that ship with your downloaded PHP version.
|
|
117
|
+
</simpara>
|
|
118
|
+
</warning>
|
|
119
|
+
</sect2>
|
|
120
|
+
</sect1>
|
|
121
|
+
|
|
122
|
+
<!-- Keep this comment at the end of the file
|
|
123
|
+
Local variables:
|
|
124
|
+
mode: sgml
|
|
125
|
+
sgml-omittag:t
|
|
126
|
+
sgml-shorttag:t
|
|
127
|
+
sgml-minimize-attributes:nil
|
|
128
|
+
sgml-always-quote-attributes:t
|
|
129
|
+
sgml-indent-step:1
|
|
130
|
+
sgml-indent-data:t
|
|
131
|
+
indent-tabs-mode:nil
|
|
132
|
+
sgml-parent-document:nil
|
|
133
|
+
sgml-default-dtd-file:"../../manual.ced"
|
|
134
|
+
sgml-exposed-tags:nil
|
|
135
|
+
sgml-local-catalogs:nil
|
|
136
|
+
sgml-local-ecat-files:nil
|
|
137
|
+
End:
|
|
138
|
+
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
139
|
+
vim: et tw=78 syn=sgml
|
|
140
|
+
vi: ts=1 sw=1
|
|
141
|
+
-->
|