Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 174 lines (98 sloc) 3.213 kb
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
1 #!/usr/bin/perl
2 ##!~_~perlpath~_~
3
4
5 =head1 NAME
6
7 ic_mod_perl -- Run Interchange entirely inside Apache/mod_perl
8
9
10 =head1 SYNOPSIS
11
12 # Add to Apache httpd.conf:
13 PerlRequire /usr/lib/interchange/bin/ic_mod_perl
14 PerlChildInitHandler Vend::ModPerl::child_start
15 PerlChildExitHandler Vend::ModPerl::child_end
16 <Location /ic>
17 SetHandler perl-script
18 PerlHandler Vend::ModPerl
19 PerlSendHeader Off
20 PerlSetupEnv On
21 </Location>
22
23
24 =head1 DESCRIPTION
25
26
27 =head2 Benefits
28
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
29 =over
30
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
31 =item *
32
33 Possibly better stability, especially on non-Linux platforms where
34 Perl signals are often buggy.
35
36 =item *
37
38 Use less memory total; don't have preforked Apache I<and> Interchange
39 daemons. Adds about 8 MB more to a typical Apache/mod_perl child process,
40 for a total of, say, 32 MB per Apache child process. But standalone
41 Interchange usually has 3 processes: an Interchange child process (~24
42 MB), an httpd child (~24 MB), I<and> a link CGI (~1 MB), so it's
43 actually a decent savings in total memory used.
44
45 =item *
46
47 Speed (ranging from slightly faster to the same on heavy pages,
48 to 10 hits/sec. faster on empty pages).
49
50 =item *
51
52 Debugging -- delve into bowels with Apache::Status.
53
54 =item *
55
56 Easier coexistence with other mod_perl code and libraries.
57
58 =item *
59
60 Can coexist with standalone Interchange codebase without problems.
61
62 =item *
63
64 Administrative ease (for sysadmins who know Apache but not Interchange).
65
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
66 =back
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
67
68 =head2 Drawbacks
69
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
70 =over
71
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
72 =item *
73
74 Interchange runs as web server user, which in a standard system is usually
75 apache or www, so you wouldn't want to share that Apache installation
76 with untrusted user CGIs, PHP, etc. as they could read any Interchange
77 files, including DSNs, userdb, etc.
78
79 =item *
80
81 Apache needs to be dedicated, or very closely watched because all
82 mod_perl stuff runs in the same interpreter, and lots of mod_perl code
83 doesn't use Safe.
84
85 =item *
86
87 How do you scale to multiple app servers in this configuration?
88
89 =over 4
90
91 =item *
92
93 Hardware or software port redirector
94
95 =item *
96
97 Tux CGI front-end redirector like tlink
98
99 =item *
100
101 Separate lightweight Apache (no modules) that proxies /ic requests
102
103 =back
104
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
105 =back
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
106
107 =head2 Ideal system setup
108
109 Use Tux to serve images & static content, and a dedicated Apache for
110 Interchange running under the 'interch' user and with no UserDir, CGI,
111 PHP, etc. enabled and an empty DocRoot.
112
113
114 =head1 CAVEATS
115
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
116 =over
117
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
118 =item *
119
120 Watch out for differing Storable versions in sessions when switching
121 between standalone and mod_perl runs!
122
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
123 =back
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
124
125 =head1 BUGS
126
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
127 =over
128
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
129 =item *
130
131 Haven't yet implemented form/multipart submissions.
132
133 =item *
134
135 Don't yet handle TolerateGet.
136
137 =item *
138
139 Don't yet handle MiniVend 3 style GETs (mv_session_id;mv_arg;mv_pc)
140
141 =item *
142
143 URIs must follow format C</ic/catalogname/page...>, where /ic is
144 customizable but must only be one "directory" deep (i.e., no
145 slashes).
146
57c434e @racke fix POD errors and remove extraneous whitespace
racke authored
147 =back
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
148
149 =head1 AUTHOR
150
3397adc @jonjensen The great copyright, email address, URL, and version update.
jonjensen authored
151 Jon Jensen <jon@icdevgroup.org>, March 2002
4c19058 @jonjensen Add entirely new way to run Interchange: inside Apache/mod_perl, with no
jonjensen authored
152
153 =cut
154
155
156 die <<EOF unless $ENV{MOD_PERL};
157
158 ic_mod_perl is meant to run only inside of Apache/mod_perl.
159 Please see the POD documentation for details:
160
161 perldoc $0
162
163 EOF
164
165
166 $Global::mod_perl = 1;
167
168 package main;
169 require '/home/jon/xfxf/bin/interchange';
170 #require '~_~INSTALLARCHLIB~_~/bin/interchange';
171
172
173 1;
Something went wrong with that request. Please try again.