【求助】Apache 的 ./configure 請教



贊助商連結


頁 : [1] 2

b90220208
2005-05-03, 08:17 PM
(我是新手,如發言中有錯誤觀念還請見諒與不吝指正. :) )

我抓了 apache 1.33 的 tarball 下來並在 install 文件中的 Configuring the source tree 一段讀到如下敘述:
------------------------------------------------------
Use the --enable-shared=NAME and --disable-shared=NAME options to enable
or disable the shared object support for a particular module from the
Apache src/Configuration.tmpl file. The defaults (yes=enabled,
no=disabled) can be seen when running `./configure --help'. There are two
special NAME variants: `max' for enabling or disabling DSO on all modules
except the bootstrapping `so' module and `remain' for enabling or
disabling DSO for only those modules which are still not enabled (which
this way implicitly enables them itself).
-----------------------------------------------------

請教,
Q1.
在作APACHE的./configure 時,
是不是一旦設定了--enable-shared=任一模組,
即表示自動啟用了--enable-module=so ...
(意即不需再作 --enable-module=so 這一動作,對嗎?)

mod_so 本身不能以 DSO 方式建立,對嗎?
那麼如上之敘述末段又是何義呢?
bootstrapping 一辭翻成白話是何意義呢?


Q2.
何謂:out-of-the-box 以及 third party libraries ?

Q3.
還有..是否只要在執行 ./configure source distribution時有做
--enable-module, script就會自動在httpd.conf加上對應的LoadModule,但若要真正啟用該module則還需手動在httpd.conf中加上
AddModule *.c才行是嗎?

Q4.
請問關於 Configuring the source tree 中的 source tree 指的是apache的安裝路徑還是什麼呢?

Q5.
最後,請教關於 mod_foo.c , 所謂的:
On-the-fly added additional/private module
"On-the-fly "是何義?

贊助商連結


阿 土
2005-05-04, 12:30 AM
Q1.我都用 --enable-module=most --enable-shared=max
之後可以自己把不需用到的 mod 取消載入

Q3.相對應的 Add Module *.c 也會自動加入 httpd.conf 中

b90220208
2005-05-04, 09:28 AM
Q1.我都用 --enable-module=most --enable-shared=max
之後可以自己把不需用到的 mod 取消載入

Q3.相對應的 Add Module *.c 也會自動加入 httpd.conf 中
感謝您的回應
取消載入是否表示在httpd.conf中將相對應的兩行
Add Module *.c
LoadModule
給註解掉即可?

之前看書時有提到(但我不確定是否與此有關):
--enable-module=most 的方式會佔用較多記憶體與降低執行的效能,而若如您所提,之後再作"取消載入"的動作是否就無此問題了呢?

repsol
2005-05-05, 09:47 PM
--enable-module=most 加入了太多不常用到 module

repsol
2005-05-05, 09:48 PM
default 的安裝 就是 ./configure 沒有下任何的參數 ,列出以下的 module
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_access.c
mod_auth.c
mod_setenvif.c

然後
這是 --enable-module=most 裝出來的 module list

http_core.c
mod_vhost_alias.c
mod_env.c
mod_log_config.c
mod_mime_magic.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_speling.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_auth_anon.c
mod_auth_dbm.c
mod_digest.c
mod_proxy.c
mod_cern_meta.c
mod_expires.c
mod_headers.c
mod_usertrack.c
mod_unique_id.c
mod_setenvif.c

多出很多

repsol
2005-05-05, 10:06 PM
原廠安裝文件的 module list
LIST OF AVAILABLE MODULES

Environment creation
(+) mod_env .......... Set environment variables for CGI/SSI scripts
(+) mod_setenvif ..... Set environment variables based on HTTP headers
(-) mod_unique_id .... Generate unique identifiers for request
Content type decisions
(+) mod_mime ......... Content type/encoding determination (configured)
(-) mod_mime_magic ... Content type/encoding determination (automatic)
(+) mod_negotiation .. Content selection based on the HTTP Accept* headers
URL mapping
(+) mod_alias ........ Simple URL translation and redirection
(-) mod_rewrite ...... Advanced URL translation and redirection
(+) mod_userdir ...... Selection of resource directories by username
(-) mod_speling ...... Correction of misspelled URLs
Directory Handling
(+) mod_dir .......... Directory and directory default file handling
(+) mod_autoindex .... Automated directory index file generation
Access Control
(+) mod_access ....... Access Control (user, host, network)
(+) mod_auth ......... HTTP Basic Authentication (user, passwd)
(-) mod_auth_dbm ..... HTTP Basic Authentication via Unix NDBM files
(-) mod_auth_db ...... HTTP Basic Authentication via Berkeley-DB files
(-) mod_auth_anon .... HTTP Basic Authentication for Anonymous-style users
(-) mod_digest ....... HTTP Digest Authentication
HTTP response
(-) mod_headers ...... Arbitrary HTTP response headers (configured)
(-) mod_cern_meta .... Arbitrary HTTP response headers (CERN-style files)
(-) mod_expires ...... Expires HTTP responses
(+) mod_asis ......... Raw HTTP responses
Scripting
(+) mod_include ...... Server Side Includes (SSI) support
(+) mod_cgi .......... Common Gateway Interface (CGI) support
(+) mod_actions ...... Map CGI scripts to act as internal `handlers'
Internal Content Handlers
(+) mod_status ....... Content handler for server run-time status
(-) mod_info ......... Content handler for server configuration summary
Request Logging
(+) mod_log_config ... Customizable logging of requests
(-) mod_log_agent .... Specialized HTTP User-Agent logging (deprecated)
(-) mod_log_referer .. Specialized HTTP Referrer logging (deprecated)
(-) mod_usertrack .... Logging of user click-trails via HTTP Cookies
Miscellaneous
(+) mod_imap ......... Server-side Image Map support
(-) mod_proxy ........ Caching Proxy Module (HTTP, HTTPS, FTP)
(-) mod_so ........... Dynamic Shared Object (DSO) bootstrapping
Experimental
(-) mod_mmap_static .. Caching of frequently served pages via mmap()
Development
(-) mod_example ...... Apache API demonstration (developers only)


(+) = enabled per default [disable with --disable-module]
(-) = disabled per default [enable with --enable-module ]

PAN_PAN
2005-05-07, 12:26 AM
Q2.
何謂:out-of-the-box 以及 third party libraries ?

對美國人來說. out of the the box 和 third party. 意思是說東西不是他們自家的或還沒有經過認證的
例如, 3dfx 的驅動程式. 他們以前有自己的一群人在維護. 但是自從被 Nvida 買了之後 網路上就出現的一些其他人改的驅動程式. 所以說簡單說是非官方的東西

=====
Q4.
請問關於 Configuring the source tree 中的 source tree 指的是apache的安裝路徑還是什麼呢?

Apache 是 open source 的軟體. 好處之一是彈性很大, Source tree 是只程式本身的結構, 使用者可以依照自己的需要去編輯你鎖需要的功能. 不用像很多 M$ 的軟體給你了一堆你不需要的功能. 像你前面所下的指令就是在 config source tree.

=====
Q5.
最後,請教關於 mod_foo.c , 所謂的:
On-the-fly added additional/private module
"On-the-fly "是何義?

On the fly 我能想到的意思應該是. 不經過 kernal 或 buffer 直接執行. 以前的燒錄機對考 CD 片需要將資料全部傳到電腦裡面去. 再從電腦裡面把東西讀出來寫到片子上. 但是科技的進步, 現在可以做到一邊讀資料一邊寫入光碟. 英文這就叫做 On the fly.
用於你的 Apache 上我想應該就是. Apache Kernal 直接呼叫這個 module 不需要 load 到 apache 的 buffer 裡面去, 好處是執行速度比較快, 至於安全性我覺得很難說. 可能你會說東西不經過 kernal 會比較安全, 但是如果是 module 本身造成問題你可能很難找到, 這有時反而更危險

b90220208
2005-05-09, 02:04 AM
感謝各位的回應,再請教:

Qa:
./configure --with-layout=GNU是作什麼的

Qb:
--enable-suexec與--enable-module=suexec有何不同?

Qc:
要使用APXS時,一般不是應該要接連下:
--enable-shared=模組名
--enable-module=模組名
為何 apache 的readme.configure文件上關於php的部分是如下設定呢?
./configure --prefix=/path/to/apache \
--enable-shared=max
那麼--enable-module=模組名,為何不用作呢?

Qd:
在編譯php時,--with-config-file-path=/path/to/apache是作什麼的?

repsol
2005-05-09, 10:26 PM
可以看 config.layout

這邊解釋

##
## config.layout -- APACI Pre-defined Installation Path Layouts
##
## Hints:
## - layouts can be loaded with APACI's --with-layout=ID option
## - when no --with-layout option is given, the default layout is `Apache'
## - a trailing plus character (`+') on paths is replaced with a
## `/<target>' suffix where <target> is the the argument from
## option --target (defaults to `httpd').
##


這邊告知 GNU 的 layout

# GNU standards conforming path layout.
# See FSF's GNU project `make-stds' document for details.
<Layout GNU>
prefix: /usr/local
exec_prefix: $prefix
bindir: $exec_prefix/bin
sbindir: $exec_prefix/sbin
libexecdir: $exec_prefix/libexec
mandir: $prefix/man
sysconfdir: $prefix/etc+
datadir: $prefix/share+
iconsdir: $datadir/icons
htdocsdir: $datadir/htdocs
manualdir: $htdocsdir/manual
cgidir: $datadir/cgi-bin
includedir: $prefix/include+
localstatedir: $prefix/var+
runtimedir: $localstatedir/run
logfiledir: $localstatedir/log
proxycachedir: $localstatedir/proxy
</Layout>


你的問題都可以在 apache 那各目錄裡找到答案
When you later want to extend your Apache installation via third-party modules through the DSO+APXS mechanism make sure
that you at least compile with mod_so included, even when no distributed modules are build as shared objects.
This can be achieved by explicitly using --enable-module=so.

告訴你說
如果你要裝 third-party 的 module
然後利用 apache 以 DSO+APXS 的方式載入該 module,你必須確認 mod_so 是否有裝好

再來
--enable-shared=max
這各文件裡面也有提到

`./configure --help'. There are two special NAME variants:
`max' for enabling or disabling DSO on all modules except the bootstrapping
`so' module and `remain' for enabling or disabling DSO for only those modules which are still not enabled
(which this way implicitly enables them itself).


--enable-shared=max 這各參數把以下這些 module 裝成了 shared module mode

mod_env
mod_mime
mod_negotiation
mod_status
mod_include
mod_autoindex
mod_dir
mod_cgi
mod_asis
mod_imap
mod_alias
mod_actions
mod_userdir
mod_auth
mod_setenvif
mod_log_config
mod_access

--enable-module 這各參數是要把 module 裝成 static 的 module
--enable-shared 這各參數是要把 module 裝成 share 的 module

你要用哪一種方式使用這各 module ??

--with-config-file-path
這各就是你的 php 的 php.ini 要指定放到哪邊

repsol
2005-05-09, 10:31 PM
--enable-suexec與--enable-module=suexec
只有一各有這各參數(--enable-suexec)
一各沒有這各參數(--enable-module=suexec)

suEXEC 是基於CGI or SSI 使用安全考量的設定
http://httpd.apache.org/docs/suexec.html