File: con-ch4.htm

package info (click to toggle)
aolserver 3.4.2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 22,692 kB
  • ctags: 33,612
  • sloc: ansic: 171,340; tcl: 10,218; sh: 3,821; cpp: 2,779; makefile: 2,041; yacc: 1,648; perl: 456; php: 13
file content (199 lines) | stat: -rw-r--r-- 9,896 bytes parent folder | download | duplicates (2)
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
<HTML><HEAD>
<TITLE>Configuration -- Example Configuration Files</TITLE>
<LINK rel=Previous href="con-ch3.htm">
<LINK rel=ToC href="toc.htm">
<LINK rel=Index href="master.htm">
<LINK rel=Next href="sec-ch.htm">
</HEAD><BODY BGCOLOR="#ffffff"><A NAME="topofpage"></A>
<TABLE WIDTH=100%>
  <TR>
    <TD ALIGN=LEFT>
      <A NAME="topofpage"></A> <IMG SRC="as-c-sm.gif">
    </TD>
    <TD ALIGN=RIGHT>
      <A href="con-ch3.htm"><IMG  BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
      <A href=toc.htm> <IMG  BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
      <A href=master.htm> <IMG  BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
      <A href="sec-ch.htm"> <IMG  BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
      <A name="7983"> </A>
    </TD>
  </TR>
</TABLE>

<a name="115417">
</a><h3>Example Configuration Files</h3>
<a name="115423">
</a><h4>Default Configuration File</h4>
<p><a name="115426">
</a>The default nsd.tcl file is shown below. There is one server defined, server1, which contains the nscp, nslog, and nssock modules. You can define multiple servers, but only one of them can be run with each command line execution. See <a href="tech-ch1.htm#20993">page 5</a> for more information on the AOLserver command line.</p>
<pre>    <a name="115433"></a>ns_section "ns/parameters"
    <a name="115434"></a>ns_param debug        on
    <a name="115435"></a>ns_param User         [exec whoami]
    <a name="115436"></a>ns_param Home         [exec pwd]
    <a name="115437"></a>
    <a name="115471"></a>ns_section "ns/servers"
    <a name="115472"></a>ns_param server1      "Server One"
    <a name="115438"></a>
    <a name="115475"></a>ns_section "ns/server/server1"
    <a name="115439"></a>ns_param DirectoryFile index.html
    <a name="115492"></a>
    <a name="115498"></a>ns_section "ns/server/server1/adp"
    <a name="115493"></a>ns_param Map          /*.adp
    <a name="115494"></a>ns_param fancy        on
    <a name="115495"></a>
    <a name="115482"></a>
    <a name="115483"></a>ns_section "ns/server/server1/modules"
    <a name="115484"></a>ns_param nssock       nssock.so
    <a name="115485"></a>ns_param nscp         nscp.so
    <a name="115486"></a>ns_param nslog        nslog.so
    <a name="115443"></a>
    <a name="115444"></a>ns_section "ns/server/server1/module/nssock"
    <a name="115445"></a>ns_param Port         80
    <a name="115446"></a>ns_param Hostname     [exec hostname]
    <a name="115452"></a>
    <a name="115453"></a>ns_section "ns/server/server1/module/nscp/users"
    <a name="115454"></a># password=x
    <a name="115455"></a>ns_param user "nsadmin:t2GqvvaiIUbF2:"
</pre><p><p><a name="115427">
</a></p>
<a name="115501">
</a><h4>Configuration for Multiple Database Pools</h4>
<p><a name="115502">
</a>This configuration file defines one server named <code>default</code> and two database pools named <code>defdb</code> and <code>otherdb</code>. A few things to note about this configuration file are:</p>
<p><a name="115503">
</a><b>SOLID and Postgres database pools:</b> The <code>defdb</code> database pool is associated with an SOLID database, and the <code>otherdb</code> database pool is associated with a Postgres database. (See the <code>driver</code> parameters in the ns/db/pool/<i>pool-name</i> sections.)</p>
<p><a name="115504">
</a><b>SOLID and Postgres drivers:</b> The drivers used for all of the defined database pools are listed in the ns/db/drivers section.</p>
<p><a name="115505">
</a><b>Database pools accessible by each server:</b> The <code>pools</code> parameter in the ns/server/default/db section specifies which database pool the default server has access to. In this example, the <code>default</code> server can access both the <code>otherdb</code> and the <code>defdb</code> database pools.</p>
<pre>    <a name="115507"></a>ns_section "ns/parameters"
    <a name="115508"></a>ns_param home <i>/home/mary/ns
</i>    <a name="115509"></a>
    <a name="115510"></a>ns_section "ns/servers"
    <a name="115511"></a>ns_param default "The Default Server"
    <a name="115512"></a>
    <a name="115513"></a>ns_section "ns/server/default"
    <a name="115514"></a>ns_param directoryfile index.htm
    <a name="115515"></a>ns_param verbose y
    <a name="115516"></a>ns_param pageroot /servers/default/pages
    <a name="115517"></a>
    <a name="115518"></a>ns_section "ns/server/default/modules"
    <a name="115519"></a>ns_param nssock nssock.so
    <a name="115521"></a>ns_param nslog nslog.so
    <a name="115522"></a>ns_param nsperm nsperm.so
    <a name="115523"></a>
    <a name="115524"></a>ns_section "ns/server/default/module/nssock"
    <a name="115525"></a>ns_param port 8000
    <a name="115526"></a>
    <a name="115533"></a>ns_section "ns/server/default/module/nslog"
    <a name="115534"></a>ns_param maxsizekb 100
    <a name="115535"></a>ns_param maxbackup 5
    <a name="115536"></a>
    <a name="115537"></a>ns_section "ns/server/default/module/nsperm"
    <a name="115538"></a>ns_param model small
    <a name="115539"></a>
    <a name="115540"></a>ns_section "ns/server/default/db"
    <a name="115541"></a>ns_param pools *
    <a name="115542"></a>
    <a name="115543"></a>ns_section "ns/db/drivers"
    <a name="115544"></a>ns_param postgres nspostgres.so
    <a name="115545"></a>ns_param solid nssolid.so
    <a name="115546"></a>
    <a name="115547"></a>ns_section "ns/db/pools"
    <a name="115548"></a>ns_param defdb "The Default Database Pool"
    <a name="115549"></a>ns_param otherdb "The Other Database Pool"
    <a name="115550"></a>
    <a name="115551"></a>ns_section "ns/db/pool/defdb"
    <a name="115552"></a>ns_param driver postgres
    <a name="115553"></a>ns_param connections 2
    <a name="115554"></a>ns_param datasource <i>host:port:database
</i>    <a name="115556"></a>
    <a name="115558"></a>ns_section "ns/db/pool/otherdb"
    <a name="115559"></a>ns_param driver solid
    <a name="115560"></a>ns_param connections 4
    <a name="115561"></a>ns_param datasource "TCP/IP <i>hostname</i> 1313"
</pre><p><p><a name="115425">
</a></p>
<a name="115766">
</a><h4>Configuration for Multiple IP Addresses</h4>
<p><a name="115768">
</a>This section describes how to get your computer to listen to multiple IP addresses at the same time, which you will need to do if you plan to run several servers and want them all to listen on port 80. The instructions vary by operating system.</p>
<a name="115770">
</a><h4>Solaris 2.5:</h4>
<p><a name="115771">
</a>The Solaris operating system already has the necessary functionality to support multiple IP addresses on a single interface. Note that it is not supported by Sun, and not mentioned in the man pages. Here is the description from Casper Dik's FAQ for Solaris 2:</p>
<p><a name="115772">
</a>4.11) How can I have multiple addresses per interface?</p>
<p><a name="115773">
</a>Solaris 2.5 provides an undocumented feature in ifconfig that allows having more than one IP address per interfaces. </p>
<p><a name="115774">
</a>Syntax:</p>
<pre>    <a name="115775"></a>ifconfig IF:N ip-address up
</pre><p><p><a name="115776">
</a>where "IF" is an interface (e.g., le0) and N is a number between 1 and 255. Removing the pseudo interface and associated address is done with "ifconfig IF:N 0.0.0.0 down".</p>
<a name="115778">
</a><h4>DEC OSF/1 (aka Digital Unix):</h4>
<p><a name="115779">
</a>The Digital Unix operating system already has the necessary functionality to support multiple IP addresses on a single interface. You can use the ifconfig command to create as many aliases as needed with following syntax:</p>
<pre>    <a name="115780"></a>ifconfig interface alias address [netmask mask]
</pre><p><p><a name="115781">
</a>This command is well documented in the Digital Unix man pages.</p>
<a name="115783">
</a><h4>HP-UX 10.x:</h4>
<p><a name="115784">
</a>The HP-UX 10.x operating system already has the necessary support for multiple IP addresses per interface. If you want a solution supported by HP, you need to buy the ServiceGuard product. If you just want the functionality, a small program from Julian Perry will do the job. See the <code>http://www.limitless.co.uk/hp_ifalias.html</code> web site for detailed information.</p>
<a name="115803">
</a><h4>Linux:</h4>
<ol>
<li>Load dummy device (if you do not have it compiled in):
<a name="115804">
</a><p>
<pre>    <a name="115805"></a>% insmod dummy.o
</pre><p><li>Configure the dummy device:
<a name="115806">
</a><p>
<pre>    <a name="115807"></a>% ifconfig dummy different_IP
</pre><p><dl>
<dt>(or dummy0 etc. if using <code>insmod</code>)<a name="115808">
</a>
<p></dl>
<li>Add an entry to your routing table:
<a name="115809">
</a><p>
<pre>    <a name="115810"></a>% route add different_IP dev dummy
</pre><p><li>Set up a proxy ARP entry:
<a name="115811">
</a><p>
<pre>    <a name="115812"></a>arp -t ether -s different_IP your_ethernet_number pub"
</pre><p><dl>
<dt>(Note that <code>different_IP</code> must be on the same subnet as your <code>primary_IP</code>)<a name="115813">
</a>
<p><dt>You can determine your_ethernet_number just by typing<a name="115814">
</a>
<p></dl>
<pre>    <a name="115815"></a>% ifconfig
</pre><p></ol>
<p><a name="115764">
</a></p>


<TABLE BORDER="2" CELLPADDING="1" width="100%">
<TR><TD COLSPAN=3><P ALIGN=Center>
<IMG SRC="bluebult.gif">
<A HREF="#topofpage">
<FONT SIZE=-1>Top of Page</FONT></A>
<IMG SRC="bluebult.gif">
</TD></TR>
<TR><TD COLSPAN=3><P ALIGN=Center>
<A href="con-ch3.htm">
<IMG  BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm>
<IMG  BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm>
<IMG  BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="sec-ch.htm">
<IMG  BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<BR align=center>
<FONT size=-1>Copyright &copy; 1998-99 America Online,
Inc.</FONT>
</TD></TR></TABLE></BODY></HTML>