File: apache.html

package info (click to toggle)
lg-issue34 3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,396 kB
  • ctags: 194
  • sloc: ansic: 261; sh: 186; makefile: 34
file content (230 lines) | stat: -rw-r--r-- 9,387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head>
<META NAME="generator" CONTENT="lgazmail v1.1D.l">
<TITLE>The Answer Guy 34: 
Executing "Normal HTML" Files with Apache
</TITLE> 
<!-- ORIGINAL SUBJECT:
apache server 
JTD SUBTITLE:

-->
</head>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H1 align="center"><A NAME="answer">
	<img src="../../gx/dennis/qbubble.gif" alt="" border="0" align="middle">
	<a href="../index.html">The Answer Guy</a>
	<img src="../../gx/dennis/bbubble.gif" alt="" border="0" align="middle">
</A></H1> 
<BR>
<H4 align="center">By James T. Dennis,
	<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a>
	<BR>Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A> 
</H4>
<p><hr><p>
<!--endcut ========================================================= -->
<H3><img src="../../gx/dennis/qbub.gif" alt="(?)"
width="50" height="28" align="left" border="0"
>Executing "Normal HTML" Files with Apache</H3>
<p><strong>From ajrlly on 26 Sep 1998 </strong></p>
<!-- begin body -->


<p><strong>is there a way to configure apache so that when someone requests a
particular page (ie http://www.whatever.com/~user/index.html) that a cgi
script is automatically invoked, transparent to the requestor. The goal
is to have a  diff page served depending on the ip address.
</strong></p>

<p><strong>thnx
</strong></p>

<blockquote><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)" height="28" width="50" align="bottom">I think you could use the "x-bit hack" feature ---
mark the index.html page as a Unix/Linux "executable"
and use SSI (server-side include) directives to 
accomplish this.
</blockquote>

<blockquote>There are also various modules for Apache to support
XSSI (extended server-side includes) ePerl and EmbPerl
(embedded perl interpreters which execute code your
documents), and other forms of dynamic output.
</blockquote>

<blockquote>For real details you should probably read the FAQ
--- try <A HREF="http://www.apache.org">http://www.apache.org</A> for access to that.
</blockquote>

<blockquote>In addition that FAQ recommends the
comp.infosystems.www.servers.unix  newsgroup for general
support.  There are also a couple of companies that offer
commercial support for the system.
</blockquote>

<blockquote>You can read about new developments in Apache by regularly 
visiting the Apache Week web site (<A HREF="http://www.apacheweek.com">http://www.apacheweek.com</A>)
Which should probably be right next to "Linux Weekly News"
<A HREF="http://www.lwn.net">http://www.lwn.net</A>, on your lists of weekly sites to visit.
</blockquote>

<blockquote>Unfortunately they don't seem to have an "answer guy" over
at Apache Week --- so we can't forward your question off to
him.
</blockquote>

<blockquote>Personally I don't like the idea of publishing different
"apparently static" web pages based on the IP address of the
requestor.  First it seems deceitful.  Also IP addresses and
DNS domains (reverse or otherwise) are very poor ways of
identifying users or readership.  In addition these sorts
of "dynamic" pages put extra load on the server and 
add additional latency to the request.  This is a
particularly bad idea for index.html pages --- which are
the most often accessed.
</blockquote>

<blockquote>I think it is best to identify what you really want 
the world to see (a process of <em>writing</em>, <em>composition</em>
and <em>publication</em>) and put that into your main static
web pages.  If you need timely or periodic updates 
(web counters, whatever) use a cron job to periodically
re "make" to static pages from their "sources" (templates)
using the text processing tool of your choice (m4 and 
the C preprocessor, cpp seem to be particularly popular
for this, although many specialized tools exist for the
task).
</blockquote>

<blockquote>Part of this also depends on what you really trying to
do.  For example if you want "internal" users to see 
one set of pages and "external" users to see another
--- you best bet is to configure your server with 
two interfaces (or at least IP aliases) and use the
Apache "Bind" directive to bind one copy of the Apache
server to one IP address/interface and a different one
(with different configuration, document root, etc) on
the other).  
</blockquote>

<blockquote>Naturally each of your virtual hosts ("soft" using HTTP 1.1
features, or "hard" requiring separate IP addresses) can
have completely different document roots and many other
configuration differences. All of that falls under the
category of "virtual hosting" and is covered pretty 
extensively in the Apache documentation (which is all
avialable at the aforementioned web sites).
</blockquote>

<blockquote>If you're trying to provide information in a different
language or format based on the source of the request
you should read about "Content Negotiation" at:
</blockquote>

<dl><dt>Apache Week: 26th July 1996
<dd><A HREF="http://www.apacheweek.com/issues/96-07-26">http://www.apacheweek.com/issues/96-07-26</A>
</dl>

<blockquote>If you're attempting to do this based on "security"
or "cookies" there extensive methods for doing this
supported by Apache -- and most of them are most easily
accomplished by performing "redirection" as the 
connection is established.
</blockquote>

<blockquote>For real security --- to provide web pages to your
"extranet" partners (strategic customers, vendors,
etc) and your mobile employees ---  I wouldn't 
suggest anything less then "client side certificates"
over SSL (secure sockets layer --- a set of encryption
protocols, proposed by Netscape and implemented by many
browsers and in several other packages.  The dominant
"free" SSL code base is SSLeay --- by Eric A. Young of
Australia).
</blockquote>

<blockquote>These sorts of certificates are issued to users on 
and individual basis (they can be from a recognized
third party CA --- certifying authority --- or you can
create your own "in-house" CA and accept those, exclusively
or otherwise.
</blockquote>

<blockquote>There are a large number of modules available for 
Apache, some to things like block access based on the
"Referrer" value (to prevent other web sites from 
using your pictures and bandwidth by "reference", for 
example), or to fix UpperVSLOWER/CasING/ problems in 
the requeste URL's, and a couple of different ones to
perform rewriting of request URL's --- like the
mod_rewrite module which supports full regex re-writes
and some weird conditional and variable assignment features.
</blockquote>

<blockquote>It appears that the "official" place to learn about 
Apache modules seems to be the "Module Registry" at
<A STUB="http://www.zyzzyva.com">http://www.zyzzyva.com</A>
</blockquote>

<p><em>[ It moved to 
<a href="http://modules.apache.org/">http://modules.apache.org/</a> which is much easier to remember too.  Update your bookmarks, everybody <img src="../../gx/dennis/smily.gif" alt=":)" border="0" align="middle">
-- Heather ]</em></p>
<!-- end body -->

<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
	>Copyright &copy;</a> 1998, James T. Dennis <BR>
Published in <I>Linux Gazette</I> Issue 34 November 1998</H5>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<P align="center">
<table width="98%"><tr valign="center" align="center">
<td rowspan="3"><A HREF="../lg_answer34.html"><IMG
        SRC="../../gx/dennis/answernew.gif"
        ALT="[ Answer Guy Index ]"></A></td>
  <td><A HREF="./apache.html">apache</a>
  <td><A HREF="./current.html">current</a>
  <td><A HREF="./digi.html">digi</a>
  <td><A HREF="./ether.html">ether</a>
  <td><A HREF="./goodtimes.html">goodtimes</a>
  <td><A HREF="./intlX.html">intlX</a>
  <td><A HREF="./largedisk.html">largedisk</a>
</tr><tr valign="center" align="center">
  <td><A HREF="./maybe.html">maybe</a>
  <td><A HREF="./numlock.html">numlock</a>
  <td><A HREF="./quota.html">quota</a>
  <td><A HREF="./recovery.html">recovery</a>
  <td><A HREF="./script.html">script</a>
  <td><A HREF="./serial.html">serial</a>
  <td><A HREF="./session.html">session</a>
</tr><tr valign="center" align="center">
  <td><A HREF="./sound.html">sound</a>
  <td><A HREF="./tape.html">tape</a>
  <td><A HREF="./testsuite.html">testsuite</a>
  <td><A HREF="./w95ie.html">w95ie</a>
  <td><A HREF="./w95ras.html">w95ras</a>
  <td><A HREF="./w95virus.html">w95virus</a>
  <td><A HREF="./xdm.html">xdm</a>
</tr></table>
	</P>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../index.html"><IMG SRC="../../gx/indexnew.gif"
        ALT="[ Table Of Contents ]"></A>
<A HREF="../../index.html"><IMG SRC="../../gx/homenew.gif"
        ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes34.html"><IMG SRC="../../gx/back2.gif"
        ALT="[ Previous Section ]"></A>
<A HREF="../izquierdo.html"><IMG SRC="../../gx/fwd.gif"
        ALT="[ Next Section ]"></A>
</body>
</html>
<!--endcut ========================================================= -->