<-
Apache > HTTP Server > Documentation > Version 2.4 > Miscellaneous Documentation

݋b _ _ Ɯ”. ٿ ~@ ݋ O[.

݋L V n L h ƴ. ͻ@ ^ƽO, ͻ@ Hġ ش[b ͓ƴ.

Support Apache!

O

top

_Ǚڷ Ϟ[

Hġ ݋Lb U @ T ü Ϟ[. ׵\ r ۰ TF TߵǾb @ ] ^. E݋ h _Lڷ Ϟ[b ͓ ߿[. Hġ݋ ݋L ٿεߴٔR, ؛ο L EΓh ˷־b Hġ ݋L TF ϸzh 䵶[ Kž Ѵ. Hġ h [b @ ڵn ݋z Ѵ.

݋L ȵV얿 ݋L @ [b b ʴ. ׺ ߰ ȵ, CGI zrxh, [ ü @ [b 찡 . ׵\Ƿ H Ǹ[ Cz h EΓhؾ Ѵ.

top

ServerRoot 丮

root ȝ~ڰ Hġ C , ]@ ݋z[ User C r ȝ~ڷ ȯѴ. root [b w ٔR, root ƿ ȝ~ڰ ]r[ o[nU ؾ Ѵ. Hϵ@ root R ] [O, 丮 丮n U. 齁, ServerRoot /usr/local/apache ȝ~ѴٔR root ȝ~ڰ ٞ 丮 Ѵ:

mkdir /usr/local/apache
cd /usr/local/apache
mkdir bin conf logs
chown 0 . bin conf logs
chgrp 0 . bin conf logs
chmod 755 . bin conf logs

׵\R /, /usr, /usr/local @ root ]r ] . httpd H@ ġV ٞ xؾ Ѵ:

cp httpd /usr/local/apache/bin
chown 0 /usr/local/apache/bin/httpd
chgrp 0 /usr/local/apache/bin/httpd
chmod 511 /usr/local/apache/bin/httpd

htdocs [丮b ٸ ȝ~ڵ ]r ] nU ] -- rootb ^ b H@ [n, n ʾƾ Ѵ.

root Ƈ ȝ~ڰ root [ų oⰡ H@ ]r ] ٔR Cz root @ ĥ ] . 齁, httpd H@ [ٔR ٞ CV ȵ带 [ ȴ. logs 丮 (root Ƈ ȝ~ڿ) oⰡɸ[ٔR αH@ ٸ CzHϷ Ur ɽ݋ root HϿ S R ] . αHϓ (root Ƈ ȝ~ڿ) oⰡɸ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lias CGI

Ưr 丮݋ CGI ] nU Ѹ[R ھb Ƶ 丮 ] . b scriptalias[ ʻ@ CGI ȮǞ [. Z, _ڸ[b ȝ~ڸ 丮 ] O, ڰ ؛ο CGI zrxh/α׷ I Ȼ A@ ȝ ~ư ٔR.

κ ȝhb scriptalias[ ʻ@ CGI Ҏe _ Ҏe@ ȝ~Ѵ.

top

~@ e[b ٸ Ҏ^

mod_php, mod_perl, mod_tcl, mod_python ݋L Ϻη ۸[b Ӻ zrxhb ݋L @ ȝ~ڷ (User C O) DZV얿, zrxh [b zrxhb Iڷ ݋L ȝ~ڰ ] b Ϳ ] . zrxh @ rn @ [, [ٽO r[ ʾb ͓ .

top

Cz r x[

r ݋L [R ȝ~ڰ .htaccess H@ ȝ~[ _ r ȱ@ [ ٶ @ ͓ƴ. ׵\ ٞ @ Ҏ^ .

݋L rHϿ ٞ@ ߰Ѵ

<Directory />
AllowOverride None
</Directory>

׵\R ȝ~ɸ[nU Cڷ A~ 丮 ܸ[Ob .htaccess H@ ȝ~ ] ^.

top

⺻ڷ ݋L b H x[

ȝ@ vv Hġ ⺻ ٿ ߽o ˽O. , ݋L ^ URL [ Ģ@ ȝ~[ H@ ã@ ] ٔR, Ư ġ [ ʾb Ŭƾh Hϓ ݋z ] .

齁, E @ :

# cd /; ln -s / public_html
http://localhost/~root/ Ѵ

׵\R Ŭƾhb ü HϳCz@ ƴٴ ] . Ƹ ݋Lr݋ ٞ @ ġ Ѵ:

<Directory />
Order Deny,Allow
Deny from all
</Directory>

׵\R HϳCz ġ ⺻ ٓ źεȴ. [b _ ] nU ٞ @ Directory U@ ߰Ѵ.

<Directory /usr/users/*/public_html>
Order Deny,Allow
Allow from all
</Directory>
<Directory /usr/local/httpd>
Order Deny,Allow
Allow from all
</Directory>

Location Directory C ȝ~[b Ư Ǹ ←. 齁, <Directory /> @ źθ[n <Location /> C Ƹ C ]

UserDir C ȝ~[b 쿡n Ǹ[. C "./" r[R root ȝ~ڿ ٷ @ TeѴ. Hġ 1.3 ƻ@ ȝ~ѴٔR ݋L rHϿ E R@ ߰[ Kž Ѵ:

UserDir disabled root

top

α 캸

݋L݋ ϓ O b ˷R αH@ Ѵ. αHϻ@ ƹ Ͻ ϸ@ O[, ݋L ݓ b ˷ֽO ʿ ŭ Ȯθ[ ش.

\ :

grep -c "/jsp/source.jsp?/jsp/ /jsp/source.jsp??" access_log
grep "client denied" error_log | tail -n 10

ù偓 b ߽o Source.JSP ]ڷ ݋Lr ˾Ɖm ] b Tomcat ƃ~[b Ƚ] ˷ֽO, 偓 b ٓ źε Ŭƾh 10 ٞ ش:

[Thu Jul 11 17:18:39 2002] [error] [client foo.bar.com] client denied by server configuration: /usr/local/apache/htdocs/.htpasswd

αHϻ@ ƹ Te ȝǸ@ OѴ. E݋ Ŭƾh .htpasswd HϿ ] ٔR α ٞ @ U @ ͓ƴ:

foo.bar.com - - [12/Jul/2002:01:59:13 +0200] "GET /.htpasswd HTTP/1.1"

, _@ ݋L rHϿ݋ ٞ κ@ ּQ@ ͓ƴ:

<Files ".ht*">
Order allow,deny
Deny from all
<Files>

:  en  |  fr  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.
С͸