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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
<?xml version="1.0" encoding="EUC-KR" ?>
<!DOCTYPE manualpage SYSTEM "./style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="./style/manual.ko.xsl"?>
<!-- English Revision: 106090:396609 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manualpage metafile="dso.xml.meta">
<title>µ¿Àû°øÀ¯°´Ã¼ (DSO) Áö¿ø</title>
<summary>
<p>¾ÆÆÄÄ¡ À¥¼¹ö´Â °ü¸®ÀÚ°¡ ¸ðµâµéÀ» ¼±ÅÃÇÏ¿© ¼¹ö¿¡ Æ÷ÇÔÇÒ
±â´ÉÀ» °áÁ¤ÇÒ ¼ö ÀÖ´Â ¸ðµâÈµÈ ÇÁ·Î±×·¥ÀÌ´Ù. ¼¹ö¸¦ ÄÄÆÄÇÒ¶§
<code>httpd</code> ½ÇÇàÆÄÀÏ¿¡ Á¤ÀûÀ¸·Î ¸ðµâÀ» ÄÄÆÄÀÏÇÒ
¼ö ÀÖ´Ù. ¾Æ´Ï¸é ¸ðµâÀ» <code>httpd</code> ½ÇÇàÆÄÀÏ°ú
ºÐ¸®ÇÏ¿© µ¿Àû°øÀ¯°´Ã¼(Dynamic Shared Objects, DSO)·Î ÄÄÆÄÀÏÇÒ
¼ö ÀÖ´Ù. DSO ¸ðµâÀº ¼¹ö¸¦ ÄÄÆÄÀÏÇÒ¶§ ÄÄÆÄÀÏÇϰųª, Apache
Extension Tool (<a href="programs/apxs.html">apxs</a>)À»
»ç¿ëÇÏ¿© ³ªÁß¿¡ ÄÄÆÄÀÏÇÏ¿© Ãß°¡ÇÒ ¼ö ÀÖ´Ù.</p>
<p>ÀÌ ¹®¼´Â DSO ¸ðµâ »ç¿ë¹ý°ú ¹è°æ ÀÌ·ÐÀ» ¼³¸íÇÑ´Ù.</p>
</summary>
<section id="implementation"><title>±¸Çö</title>
<related>
<modulelist>
<module>mod_so</module>
</modulelist>
<directivelist>
<directive module="mod_so">LoadModule</directive>
</directivelist>
</related>
<p>¾ÆÆÄÄ¡ Çٽɿ¡ Á¤ÀûÀ¸·Î ÄÄÆÄÀÏÇؾßÇÒ
<module>mod_so.c</module>¶ó´Â ¸ðµâÀº ¾ÆÆÄÄ¡ ¸ðµâÀ»
ÀоîµéÀ̱âÀ§ÇÑ DSO¸¦ Áö¿øÇÑ´Ù.
ÀÌ ¸ðµâÀº <module>core</module>¸¦ Á¦¿ÜÇÏ°í DSO°¡
µÉ ¼ö ¾ø´Â À¯ÀÏÇÑ ¸ðµâÀÌ´Ù. ½ÇÁ¦·Î ´Ù¸¥ ¸ðµç ¾ÆÆÄÄ¡ ¸ðµâÀº
<a href="install.html">¼³Ä¡ ¹®¼</a>¿¡¼ ¼³¸íÇÑ
<code>configure</code>ÀÇ <code>--enable-<em>module</em>=shared</code>
¿É¼ÇÀ» »ç¿ëÇÏ¿© DSO·Î ÄÄÆÄÀÏÇÒ ¼ö ÀÖ´Ù. ¸ðµâÀ»
<code>mod_foo.so</code>¿Í °°ÀÌ DSO·Î ÄÄÆÄÀÏÇÑÈÄ <code>httpd.conf</code>
ÆÄÀÏ¿¡ <module>mod_so</module>ÀÇ
<directive module="mod_so">LoadModule</directive> ¸í·É¾î¸¦
»ç¿ëÇÏ¿© ¼¹ö ½ÃÀ۽à ȤÀº Àç½ÃÀ۽à ±× ¸ðµâÀ» ÀоîµéÀÏ ¼ö
ÀÖ´Ù.</p>
<p>¾ÆÆÄÄ¡ ¸ðµâ(ƯÈ÷ Á¦»ïÀÚ°¡ ¸¸µç ¸ðµâ)·Î »ç¿ëÇÒ DSO ÆÄÀÏÀ» ½±°Ô
¸¸µé±âÀ§ÇØ <a href="programs/apxs.html">apxs</a> (<em>APache
eXtenSion</em>)¶ó´Â »õ·Î¿î Áö¿ø ÇÁ·Î±×·¥ÀÌ ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥Àº
¾ÆÆÄÄ¡ ¼Ò½º Æ®¸® <em>¹Û¿¡¼</em> DSO·Î »ç¿ëÇÒ ¸ðµâÀ»
ÄÄÆÄÀÏÇÒ¶§ »ç¿ëÇÑ´Ù. °³³äÀº ½±´Ù. ¾ÆÆÄÄ¡¸¦ ¼³Ä¡ÇÒ¶§
<code>configure</code>¿Í <code>make install</code>ÀÌ
¾ÆÆÄÄ¡ C Çì´õÆÄÀÏÀ» ¼³Ä¡ÇÏ°í, DSO ÆÄÀÏÀ» ÄÄÆÄÀÏÇϱâÀ§ÇÑ
Ç÷¡Æû ƯÀ¯ÀÇ ÄÄÆÄÀÏ·¯ ¿É¼Ç°ú ¸µÄ¿ ¿É¼ÇÀ» <code>apxs</code>
ÇÁ·Î±×·¥¿¡ ±â·ÏÇÑ´Ù. ±×·¡¼ <code>apxs</code>¸¦ »ç¿ëÇÏ´Â »ç¿ëÀÚ´Â
¾ÆÆÄÄ¡ ¹èÆ÷º» ¼Ò½º Æ®¸®¾øÀÌ, ¶Ç DSO Áö¿øÀ» À§ÇÑ Ç÷¡Æû ƯÀ¯ÀÇ
ÄÄÆÄÀÏ·¯ ¿É¼Ç¿Í ¸µÄ¿ ¿É¼Ç¿¡ ½Å°æÀ» ¾²Áö¾Ê°í ÀÚ½ÅÀÇ ¾ÆÆÄÄ¡
¸ðµâ ¼Ò½º¸¦ ÄÄÆÄÀÏÇÒ ¼ö ÀÖ´Ù.</p>
</section>
<section id="usage"><title>»ç¿ë¹ý ¿ä¾à</title>
<p>Apache 2.0ÀÇ DSO ±â´É¿¡ ´ëÇÑ Âª°í °£·«ÇÑ ¿ä¾àÀÌ´Ù:</p>
<ol>
<li>
<em>¹èÆ÷º»¿¡ ÀÖ´Â</em> ¾ÆÆÄÄ¡ ¸ðµâÀ» ÄÄÆÄÀÏÇÏ°í ¼³Ä¡ÇÏ´Â
°æ¿ì. ¿¹¸¦ µé¾î <code>mod_foo.c</code>¸¦ DSO
<code>mod_foo.so</code>·Î:
<example>
$ ./configure --prefix=/path/to/install --enable-foo=shared<br />
$ make install
</example>
</li>
<li>
<em>Á¦»ïÀÚ°¡ ¸¸µç</em> ¾ÆÆÄÄ¡ ¸ðµâÀ» ÄÄÆÄÀÏÇÏ°í ¼³Ä¡ÇÏ´Â
°æ¿ì. ¿¹¸¦ µé¾î <code>mod_foo.c</code>¸¦ DSO
<code>mod_foo.so</code>·Î:
<example>
$ ./configure --add-module=module_type:/path/to/3rdparty/mod_foo.c --enable-foo=shared<br />
$ make install
</example>
</li>
<li>
°øÀ¯ ¸ðµâÀ» <em>³ªÁß¿¡ »ç¿ëÇϱâÀ§ÇØ</em> ¾ÆÆÄÄ¡¸¦ ±¸¼ºÇÏ´Â
°æ¿ì:
<example>
$ ./configure --enable-so<br />
$ make install
</example>
</li>
<li>
<em>Á¦»ïÀÚ°¡ ¸¸µç</em> ¾ÆÆÄÄ¡ ¸ðµâÀ» ÄÄÆÄÀÏÇÏ°í ¼³Ä¡ÇÏ´Â
°æ¿ì. <a href="programs/apxs.html">apxs</a>¸¦ »ç¿ëÇÏ¿©
¾ÆÆÄÄ¡ ¼Ò½º Æ®¸® <em>¹Û¿¡¼</em> <code>mod_foo.c</code>¸¦
DSO <code>mod_foo.so</code>·Î:
<example>
$ cd /path/to/3rdparty<br />
$ apxs -c mod_foo.c<br />
$ apxs -i -a -n foo mod_foo.la
</example>
</li>
</ol>
<p>¸ðµç °æ¿ì ÀÏ´Ü °øÀ¯ ¸ðµâÀÌ ÄÄÆÄÀϵǸé, <code>httpd.conf</code>¿¡
<directive module="mod_so">LoadModule</directive> Áö½Ã¾î¸¦
»ç¿ëÇÏ¿© ¾ÆÆÄÄ¡°¡ ±× ¸ðµâÀ» ÀоîµéÀÌ°Ô ¸¸µç´Ù.</p>
</section>
<section id="background"><title>¹è°æÁö½Ä</title>
<p>Çö´ëÀûÀÎ À¯´Ð½º·ù¿¡´Â <em>µ¿Àû°øÀ¯°´Ã¼</em> (DSO)ÀÇ
µ¿Àû ¸µÅ·/·Îµù(dynamic linking/loading)À̶ó°í ÇÏ¿©, Ưº°ÇÑ
Çü½ÄÀÇ ½ÇÇàÄÚµå Á¶°¢À» ¸¸µé¾î ½ÇÇàÁßÀÎ ½ÇÇàÇÁ·Î±×·¥ÀÇ
ÁÖ¼Ò°ø°£¿¡ ÀоîµéÀÌ´Â ¸ÚÁø ±â´ÉÀÌ ÀÖ´Ù.</p>
<p>º¸Åë µÎ°¡Áö ¹æ¹ýÀ¸·Î ÀоîµéÀÏ ¼ö ÀÖ´Ù. Çϳª´Â ½ÇÇàÇÁ·Î±×·¥ÀÌ
½ÃÀÛÇÒ¶§ <code>ld.so</code>¶ó´Â ½Ã½ºÅÛ ÇÁ·Î±×·¥ÀÌ ÀÚµ¿À¸·Î
ÀоîµéÀÌ´Â °æ¿ì°í, ´Ù¸¥ Çϳª´Â ½ÇÇàÁßÀÎ ÇÁ·Î±×·¥ÀÌ
<code>dlopen()/dlsym()</code> ½Ã½ºÅÛÈ£Ãâ·Î À¯´Ð½º ·Î´õ(loader)ÀÇ
½Ã½ºÅÛ ÀÎÅÍÆäÀ̽ºÀ» »ç¿ëÇÏ¿© Á÷Á¢ ÀоîµéÀÌ´Â °æ¿ì´Ù.</p>
<p>ù¹ø° °æ¿ì DSO¸¦ º¸Åë <em>°øÀ¯¶óÀ̺귯¸®(shared libraries)</em>
ȤÀº <em>DSO ¶óÀ̺귯¸®</em>¶ó°í ºÎ¸£¸ç, ÆÄÀÏÀº
<code>libfoo.so</code>³ª <code>libfoo.so.1.2</code> °°Àº
À̸§À» °¡Áø´Ù. À̵éÀº ½Ã½ºÅÛ µð·ºÅ丮(º¸Åë <code>/usr/lib</code>)¿¡
ÀÖ°í, ÄÄÆÄÀϽà ¸µÄ¿ ¸í·É¾î¿¡ <code>-lfoo</code>¸¦ ÁÖ¾î
½ÇÇàÆÄÀÏ°ú ¿¬°áÇÑ´Ù. ÀÌ·¸°Ô Á÷Á¢ ½áÁØ ¶óÀ̺귯¸®´Â ½ÇÇàÆÄÀÏ¿¡
ÂüÁ¶µÇ¿©¼, ÇÁ·Î±×·¥ÀÌ ½ÃÀÛÇÒ¶§ ¸µÄ¿ ¿É¼Ç <code>-R</code>·Î
Á÷Á¢ ÁöÁ¤ÇÑ °æ·Î, ȯ°æº¯¼ö <code>LD_LIBRARY_PATH</code>·Î
ÁöÁ¤ÇÑ °æ·Î ȤÀº <code>/usr/lib</code>¿¡¼ À¯´Ð½º ·Î´õ°¡
<code>libfoo.so</code>¸¦ ãÀ» ¼ö ÀÖ´Ù. ±×·¯¸é ½ÇÇàÇÁ·Î±×·¥ÀÇ
(¾ÆÁ÷ ¸øãÀº(unresolved)) ½Éº¼(symbol)À» DSO¿¡¼ ã°ÔµÈ´Ù.</p>
<p>DSO´Â º¸Åë ½ÇÇàÇÁ·Î±×·¥ÀÇ ½Éº¼À» ãÁö¾Ê±â ¶§¹®¿¡ (DSO°¡
Àç»ç¿ë°¡´ÉÇÑ ÀϹÝÀûÀÎ ÄÚµå ¶óÀ̺귯¸®À̹ǷÎ) ã±â´Â ¿©±â¼
³¡³´Ù. À¯´Ð½º ·Î´õ°¡ ½Éº¼ ã±â¸¦ ¿ÏÀüÈ÷ ´ã´çÇϹǷΠ½ÇÇàÇÁ·Î±×·¥ÀÌ
Á÷Á¢ DSO¿¡¼ ½Éº¼À» ãÀ» ÇÊ¿ä°¡ ¾ø´Ù. (»ç½Ç <code>ld.so</code>¸¦
ºÎ¸£´Â ÄÚµå´Â Á¤ÀûÀÌ ¾Æ´Ñ ¸ðµç ½ÇÇàÇÁ·Î±×·¥¿¡ ¸µÅ©µÇ´Â ½ÇÇà½Ã
½ÃÀÛÄÚµåÀÇ ÀϺδÙ.) °øÅëµÈ ¶óÀ̺귯¸® Äڵ带 µ¿ÀûÀ¸·Î ÀоîµéÀÌ´Â
ÀåÁ¡Àº ¸íÈ®ÇÏ´Ù. ¶óÀ̺귯¸® Äڵ尡 ¸ðµç ÇÁ·Î±×·¥¿¡ Áߺ¹Çؼ
ÀúÀåµÇ´Â ´ë½Å <code>libc.so</code>¿Í °°Àº ½Ã½ºÅÛ ¶óÀ̺귯¸®¿¡
Çѹø¸¸ ÀúÀåµÇ±â ¶§¹®¿¡ µð½ºÅ© °ø°£ÀÌ Àý¾àµÈ´Ù.</p>
<p>µÎ¹ø° °æ¿ì DSO¸¦ º¸Åë <em>°øÀ¯°´Ã¼(shared objects)</em>
ȤÀº <em>DSO ÆÄÀÏ</em>À̶ó°í ºÎ¸£°í, (±ÔÄ¢»ó À̸§Àº
<code>foo.so</code>ÀÌÁö¸¸) ÆÄÀÏÀÇ È®ÀåÀÚ´Â ÀÚÀ¯·Ó´Ù. ÀÌ
ÆÄÀϵéÀº º¸Åë ÇÁ·Î±×·¥ ÀÚü µð·ºÅ丮¿¡ À§Ä¡ÇÏ°í ½ÇÇàÇÁ·Î±×·¥¿¡
ÀÚµ¿À¸·Î ¿¬°áµÇÁö ¾Ê´Â´Ù. ´ë½Å ½ÇÇàÇÁ·Î±×·¥Àº ½ÇÇà½Ã
<code>dlopen()</code>À» »ç¿ëÇÏ¿© DSO¸¦ ÁÖ¼Ò°ø°£¿¡
Á÷Á¢ Àоîµé¿©¾ß ÇÑ´Ù. À̶§ ½ÇÇàÇÁ·Î±×·¥Àº DSO¿¡¼ ½Éº¼À»
ãÁö ¾Ê´Â´Ù. ´ë½Å ¾Õ¿¡¼ º» À¯´Ð½º ·Î´õ´Â ÀÚµ¿À¸·Î ½ÇÇàÆÄÀÏ°ú
½ÇÇàÆÄÀÏÀÌ ÀÌ¹Ì ÀоîµéÀÎ DSO ¶óÀ̺귯¸®(ƯÈ÷ Ç×»ó Á¸ÀçÇÏ´Â
<code>libc.so</code>ÀÇ ¸ðµç ½Éº¼)¿¡¼ DSOÀÇ (¾ÆÁ÷ ¸øãÀº)
½Éº¼À» ã´Â´Ù. ±×·¡¼ DSO´Â ¸¶Ä¡ óÀ½ºÎÅÍ ½ÇÇàÇÁ·Î±×·¥¿¡
Á¤ÀûÀ¸·Î ¸µÅ©µÈ°Í°ú °°ÀÌ ½ÇÇàÆÄÀÏÀÇ ½Éº¼À» ¾Ë°ÔµÈ´Ù.</p>
<p>DSOÀÇ API¸¦ ÀÌ¿ëÇϱâÀ§Çؼ ¸¶Áö¸·À¸·Î ½ÇÇàÇÁ·Î±×·¥Àº
<code>dlsym()</code>À¸·Î DSO¿¡¼ ƯÁ¤ ½Éº¼À» ã¾Æ¼, ¾ÕÀ¸·Î
»ç¿ëÇϱâÀ§ÇØ µð½ºÆÐÄ¡(dispatch) Ç¥ <em>µî</em>¿¡ ÀúÀåÇÑ´Ù.
´Ù¸¥ ¸»·Î ½ÇÇàÇÁ·Î±×·¥Àº »ç¿ëÇÒ ¸ðµç ½Çº¼À» Á÷Á¢ ã¾Æ¾ßÇÑ´Ù.
ÀÌ·± ±¸Á¶ÀÇ ÀåÁ¡Àº ÇÁ·Î±×·¥ÀÇ ÀϺθ¦ ÇÁ·Î±×·¥ÀÌ
ÇÊ¿äÇÒ¶§±îÁö ÀоîµéÀÌÁö ¾Ê¾Æµµ (±×·¡¼ ¸Þ¸ð¸®¸¦ ³¶ºñÇÏÁö
¾Ê°Ô) µÈ´Ù´Â Á¡ÀÌ´Ù. ±âº» ÇÁ·Î±×·¥ÀÇ ±â´ÉÀ» È®ÀåÇϱâÀ§ÇØ
ÇÊ¿äÇÑ °æ¿ì ÀÌ ºÎºÐÀ» µ¿ÀûÀ¸·Î ÀоîµéÀÏ ¼ö ÀÖ´Ù.</p>
<p>ÀÌ·± DSO ±¸Á¶°¡ ÀÚ¿¬½º·´°Ô º¸ÀÌÁö¸¸, ÃÖ¼ÒÇÑ ¾î·Á¿î Á¡ÀÌ
ÇÑ°¡ÁöÀÖ´Ù. ÇÁ·Î±×·¥À» È®ÀåÇϱâÀ§ÇØ DSO¸¦ »ç¿ëÇÒ¶§ DSO°¡
½ÇÇàÇÁ·Î±×·¥ÀÇ ½Éº¼À» ã´Â ÀÏÀÌ´Ù. ¿Ö? DSO°¡ ½ÇÇàÇÁ·Î±×·¥ÀÇ
½Éº¼À» "¿ªÀ¸·Î ã´Â °Í"Àº (¶óÀ̺귯¸®´Â ÀÚ½ÅÀ» »ç¿ëÇÏ´Â ÇÁ·Î±×·¥¿¡
´ëÇØ ¸ð¸¥´Ù´Â) ¶óÀ̺귯¸® ¼³°è¿¡ ¹ÝÇϸç, ¸ðµç Ç÷¡Æû¿¡¼
Áö¿øµÇÁö¾Ê°í Ç¥ÁØȵÇÁöµµ ¾Ê¾Ò±â ¶§¹®ÀÌ´Ù. ½ÇÁ¦·Î ½ÇÇàÆÄÀÏÀÇ
Àü¿ª½Éº¼(global symbol)Àº º¸Åë ÀͽºÆ÷Æ®(export)µÇÁö ¾Ê±â¶§¹®¿¡
DSO°¡ »ç¿ëÇÒ ¼ö ¾ø´Ù. DSO¸¦ »ç¿ëÇÏ¿© ½ÇÇàÁß ÇÁ·Î±×·¥À» È®ÀåÇÏ·Á¸é
¸µÄ¿¿¡°Ô ¸ðµç Àü¿ª½Éº¼À» ÀͽºÆ÷Æ®Çϵµ·Ï °Á¦ÇÏ´Â °ÍÀÌ ÁÖµÈ
ÇØ°áÃ¥ÀÌ´Ù.</p>
<p>°øÀ¯¶óÀ̺귯¸®´Â DSO ¹æ½ÄÀÇ ¼³°è¿øÄ¢´ë·Î ÀüÇüÀûÀ̱⶧¹®¿¡
¿î¿µÃ¼Á¦°¡ Á¦°øÇÏ´Â °ÅÀÇ ¸ðµç Á¾·ùÀÇ ¶óÀ̺귯¸®°¡ »ç¿ëÇÑ´Ù.
¹Ý´ë·Î ¸¹Àº ÇÁ·Î±×·¥Àº ÇÁ·Î±×·¥À» È®ÀåÇϱâÀ§ÇØ °øÀ¯°´Ã¼¸¦
»ç¿ëÇÏÁö ¾Ê´Â´Ù.</p>
<p>1998³â ½ÇÇàÁß ½ÇÁ¦·Î ±â´ÉÀ» È®ÀåÇϱâÀ§ÇØ DSO ±¸Á¶¸¦ »ç¿ëÇÑ
¼ÒÇÁÆ®¿þ¾î ÆÐÅ°Áö´Â (XS ±¸Á¶¿Í DynaLoader ¸ðµâÀ» »ç¿ëÇÑ)
Perl 5, Netscape Server <em>µî</em>À¸·Î µå¹°¾ú´Ù. ¾ÆÆÄÄ¡´Â
ÀÌ¹Ì ±â´ÉÀ» È®ÀåÇϱâÀ§ÇØ ¸ðµâ °³³äÀ» »ç¿ëÇß°í ¿ÜºÎ ¸ðµâÀ»
¾ÆÆÄÄ¡ Çٽɱâ´É¿¡ ¿¬°áÇϱâÀ§ÇØ ³»ºÎÀûÀ¸·Î µð½ºÆÐÄ¡¸ñ·ÏÀ»
ÀÌ¿ëÇÑ Á¢±Ù¹æ¹ýÀ» »ç¿ëÇ߱⶧¹®¿¡ 1.3 ¹öÀüºÎÅÍ ÀÌ ´ë¿¿¡ ÇÕ·ùÇß´Ù.
±×·¡¼ ¾ÆÆÄÄ¡´Â ½ÇÇàÁß ¸ðµâÀ» ÀоîµéÀ̴µ¥ DSO¸¦ »ç¿ëÇϵµ·Ï
¿î¸íÁö¿öÁ³´Ù.</p>
</section>
<section id="advantages"><title>Àå´ÜÁ¡</title>
<p>¾Õ¿¡¼ ¸»ÇÑ DSO¸¦ »ç¿ëÇÏ¸é ´ÙÀ½°ú °°Àº ÀåÁ¡ÀÌ ÀÖ´Ù:</p>
<ul>
<li>½ÇÁ¦ ¼¹ö ÇÁ·Î¼¼½º°¡ ÄÄÆÄÀϽà <code>configure</code>
¿É¼Ç´ë½Å <code>httpd.conf</code>ÀÇ <directive
module="mod_so">LoadModule</directive>À» »ç¿ëÇÏ¿© ½ÇÇàÁß¿¡
°áÇյǹǷΠ¼¹ö ÆÐÅ°Áö ½ÇÇàÀÌ ´õ À¯¿¬ÇÏ´Ù. ¿¹¸¦ µé¾î ÇѹøÀÇ
¾ÆÆÄÄ¡ ¼³Ä¡¸¸À¸·Î ´Ù¸¥ ¼¹ö(Ç¥ÁØ ¹öÀü°ú SSL ¹öÀü, ÃÖ¼ÒÈ
¹öÀü°ú ±â´ÉÃß°¡ ¹öÀü [mod_perl, PHP3] <em>µî</em>)¸¦ ½ÇÇàÇÒ
¼ö ÀÖ´Ù.</li>
<li>¼¹ö´Â ¼³Ä¡ÈÄ¿¡µµ Á¦»ïÀÚ°¡ ¸¸µç ¸ðµâÀ» »ç¿ëÇÏ¿© ½±°Ô
È®ÀåÇÒ ¼ö ÀÖ´Ù. ÃÖ¼ÒÇÑ ±â¾÷ÀÇ ÆÐÅ°Áö Á¦ÀÛÀÚ´Â ¾ÆÆÄÄ¡ ÇÙ½É
ÆÐÅ°Áö¿Í º°µµ·Î PHP3, mod_perl, mod_fastcgi <em>µî</em>À»
Ãß°¡ ÆÐÅ°Áö·Î ¸¸µé ¼ö ÀÖ¾î¼ Å« À̵æÀÌ´Ù.</li>
<li>DSO¿Í <code>apxs</code>¸¦ °¡Áö°í ¾ÆÆÄÄ¡ ¼Ò½º Æ®¸® ¹Û¿¡¼
ÀÛ¾÷ÇÏ°í <code>apxs -i</code>¿Í <code>apachectl restart</code>
¸í·É¾î¸¸À¸·Î ÇöÀç °³¹ßÇÑ ¸ðµâÀÇ »õ ¹öÀüÀ» ½ÇÇàÁßÀÎ ¾ÆÆÄÄ¡
¼¹ö¿¡ ¹Ý¿µÇÒ ¼ö ÀÖ¾î¼ ´õ ½±°Ô ¾ÆÆÄÄ¡ ¸ðµâÀ» °³¹ßÇÒ ¼ö
ÀÖ´Ù.</li>
</ul>
<p>DSO´Â ´ÙÀ½°ú °°Àº ´ÜÁ¡ÀÌ ÀÖ´Ù:</p>
<ul>
<li>ÇÁ·Î±×·¥ÀÇ ÁÖ¼Ò°ø°£¿¡ Äڵ带 µ¿ÀûÀ¸·Î ÀоîµéÀÌ´Â ±â´ÉÀ»
Áö¿øÇÏÁö¾Ê´Â ¿î¿µÃ¼Á¦°¡ Àֱ⠶§¹®¿¡ ¸ðµç Ç÷¡Æû¿¡¼ DSO¸¦
»ç¿ëÇÒ ¼ö ¾ø´Ù.</li>
<li>À¯´Ð½º ·Î´õ°¡ ½Éº¼À» ã¾Æ¾ßÇϱ⠶§¹®¿¡ ¼¹ö ½ÃÀÛÀÌ
¾à 20% Á¤µµ ´Ê¾îÁø´Ù.</li>
<li>¼¹ö´Â À§Ä¡µ¶¸³ÄÚµå(position independent code, PIC)
¶§¹®¿¡ Àý´ëÁÖ¼ÒÁöÁ¤(absolute addressing)º¸´Ù ´À¸°
»ó´ëÁÖ¼ÒÁöÁ¤(relative addressing)ÀÇ º¹ÀâÇÑ ¾î¼Àºí·¯ ±â¹ýÀÌ
ÇÊ¿äÇϹǷΠ¾î¶² Ç÷¡Æû¿¡¼ ½ÇÇà½Ã ¾à 5% Á¤µµ ´Ê´Ù.</li>
<li>DSO ¸ðµâÀ» ´Ù¸¥ DSO±â¹Ý ¶óÀ̺귯¸®(<code>ld -lfoo</code>)¿¡
¸µÅ©ÇÒ ¼ö ¾ø´Â Ç÷¡ÆûÀÌ Àֱ⶧¹®¿¡ (¿¹¸¦ µé¾î ELF±â¹Ý
Ç÷¡ÆûÀº Áö¿øÇÏÁö¸¸ a.out±â¹Ý Ç÷¡ÆûÀº º¸Åë ÀÌ ±â´ÉÀ»
Áö¿øÇÏÁö ¾Ê´Â´Ù) ¸ðµç Á¾·ùÀÇ ¸ðµâ¿¡ DSO¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù.
´Ù¸¥ ¸»·Î DSO ÆÄÀÏ·Î ÄÄÆÄÀÏÇÏ´Â ¸ðµâÀº ¾ÆÆÄÄ¡ Çٽɰú ¾ÆÆÄÄ¡
ÇÙ½ÉÀÌ »ç¿ëÇÏ´Â C ¶óÀ̺귯¸®(<code>libc</code>)¿Í ´Ù¸¥
µ¿Àû/Á¤Àû ¶óÀ̺귯¸®, À§Ä¡µ¶¸³Äڵ带 ´ã°í ÀÖ´Â Á¤Àû ¶óÀ̺귯¸®
¾ÆÄ«À̺ê(<code>libfoo.a</code>)ÀÇ ½Éº¼¸¸À» »ç¿ëÇÒ ¼ö ÀÖ´Ù.
´Ù¸¥ Äڵ带 »ç¿ëÇÏ·Á¸é ¾ÆÆÄÄ¡ ÇÙ½ÉÀÌ ±×°ÍÀ» ÂüÁ¶ÇÏ´øÁö,
<code>dlopen()</code>À¸·Î Á÷Á¢ Äڵ带 Àоîµé¿©¾ß ÇÑ´Ù.</li>
</ul>
</section>
</manualpage>
|