LinuxÒÁµéÔ°ÂÛ̳'s Archiver

xhlxhl ·¢±íÓÚ 2008-3-1 16:52

apache2+php4+mysql²»ÄÜÕý³£·ÃÎÊÍøÒ³

apacheµÄÎĵµ¸ùĿ¼ÏµÄindex.htmlÎļþ,±¾µØÓÃä¯ÀÀÆ÷·ÃÎÊlocalhostʱ,ÏÔʾµÄÊÇÔ´´úÂëÎı¾¶ø²»ÊÇÍøÒ³£»Èç¹û½«ºó׺Ãû¸ÄΪphp¼´ÎļþÃû¸ÄΪindex.php£¬Ôò¿ÉÒÔÕý³£ÏÔÊ¾ÍøÒ³¡£ÍøÒ³ºÜ¼òµ¥£¬ÀàËÆÓÚ¡°Hello world¡±¡£ÊDz»ÅäÖÆÓдíÎó£¿Çë¸ßÊÖÖ¸µã¡£

bwb ·¢±íÓÚ 2008-3-1 18:38

ÐÞ¸Ä/etc/httpdĿ¼ÏµÄhttpd.conf£¨ÒÑredhatΪÀý£¬·¢Ðа治ͬ»áÓÐһЩ²»Í¬£©DirectoryIndex¶Î£º

[code]
<IfModule mod_dir.c>
    DirectoryIndex index.html
</IfModule>
[/code]
×¢£ºindex.htmlÊǺó¼ÓÉϵġ£
ÖØÆôhttpd¼´¿É¡£

xhlxhl ·¢±íÓÚ 2008-3-2 16:37

»Ø¸´ #2 bwb µÄÌû×Ó

°´ÕÕ°æÖ÷µÄ·½·¨Ò²²»ÐУ¬Êµ¼ÊÉÏÎÒµÄÎÊÌâÊÇAPACHE2·þÎñÆ÷£¨ÎÒÓõÄÊÇdebian£©²»ÄܶÔ.htmlºó׺µÄÎļþÕýÈ·½âÎö¡£ÎÒÔÚapache2.confÎļþÖмÓÁËÒ»ÐÐ
AddType application/x-httpd-php .html
Ôò·ÃÎÊlocalhostʱ£¬index.html¿ÉÒÔÏÔʾÕý³£µÄÍøÒ³£¬µ«ÕâÑù×÷ËÆºõÊǽ«²»º¬½Å±¾µÄÆÕÍ¨ÍøÒ³Ò²½»¸øÁËphpÈ¥½âÎö£¬²»ÖªÊÇ·ñÓиüºÃµÄ·½·¨£¿

Roc.Ken ·¢±íÓÚ 2008-3-3 09:43

bwbûעÒâÂ¥Ö÷µÄÎÊÌâ, ËûÏë°Ñindex.html µ±³É php ÎļþʹÓÃ, ÓÐÁ½¸ö½â¾ö·½·¨, ÐÞ¸Ä
DirectoryIndex index.php
»òÕßÌí¼Ó
AddType application/x-httpd-php .html

xhlxhl ·¢±íÓÚ 2008-3-3 10:50

ÎÒ²»ÊÇÏë°Ñindex.html µ±³É php ÎļþʹÓÃ,¶øÊÇAPACHE2·þÎñÆ÷²»ÄܽâÎöºó׺ÃûΪ.htmlµÄÆÕÍ¨ÍøÒ³£¬±¾µØÓÃä¯ÀÀÆ÷·ÃÎÊlocalhostʱÏÔʾµÄÊÇÕû¸öÔ´´úÂëÎı¾¶ø²»ÊÇÍøÒ³¡£ÏÔʾÈçÏ£º
<html>
<head>
<title>test</title>
</head>
<body>
<center>
hello world!
</center>
</body>
</html>
Õý³£ÍøÒ³Ó¦¸ÃÖ»ÏÔʾ¡°hello world!¡±.

Roc.Ken ·¢±íÓÚ 2008-3-3 11:32

apache ÅäÖÃʱ, ĬÈϵÄÎļþÀàÐÍÊÇ text, ²»ÊÇ html, ÕâÑù¾Í»á°Ñ html Ò²µ±³É text ÏÔʾÁË, ²Î¿¼Ò»ÏÂÏà¹ØµÄÅäÖÃ:

[cax@monitor apache]$ grep mime.types conf/httpd.conf
TypesConfig conf/mime.types

[cax@monitor apache]$ grep html conf/mime.types
application/vnd.pwg-xhtml-print+xml
application/xhtml+xml           xhtml xht
text/html                       html htm

xhlxhl ·¢±íÓÚ 2008-3-3 22:13

лл°æÖ÷£¬ÎÊÌâÒѽâ¾ö£¬ÔÚmime.typesÎļþÖмÓÈë ¡°text/html                       html htm¡±ÕâÒ»Ðм´¿É¡£

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.