·í§A¤U¸ü¦øªA¾¹³nÅé®É¡A§A¦³¨âÓ¿ï¾Ü: ¨ú¥Îì©lµ{¦¡ÀɦA¦Û¤v¨Ó½sĶ¥¦¡A ©Î¬O¨ú¥Î¤w¸g½sĶ¦nªº¤G¶i¦ì°õ¦æÀÉ¡C ¤w½sĶ¦nªºµ¹ Linux (ELF ª©¥» ) ¥Îªº¤G¶i¦ìÀÉ¥i¥H¦b NCSA ¤W¨ú±o¡A¥¦Ì³£«Dªºª©¥»®@!
¦b NCSA ªº¦øªA¾¹·|¾É¤Þ§A°µ«Øºc¿ï¶µªº¨BÆJ¨Ã¬°§A®Æ²z³\¦hÀɮסC¦ý¦b±z À|¸Õn¤U¸ü HTTPd «e½Ð¥ý¦^µª¤U¦C°ÝÃD
º¥ý¡A§A¥²¶·¿ï¾Ü¬On¤U¸üì©lµ{¦¡ÀɮשO? ÁÙ¬O¤w½sĶ¦nªº³nÅé¡C¦pªG§A ªº¨t²Î¨Ã¨S¥X²{¦b¿ï³æ¤W¡A¨º»ò±z´N¥²¶·¨ú¦^¤º©wªºì©lÀɮסA¦A¦Û¤v½sĶ ¥¦¡C
nÀˬd§Aªº Linux ªºª©¥»¡A½Ð¦^¨ì§Aªº Linux ©R¥O¦C¤W¥´¤J
linux:~$ uname -a
¥¦·|¦^À³¹³¤U±ªº¤º®e
linux:~$ uname -a
Linux linux 2.0.29 #4 Tue Sep 13 04:05:51 CDT 1994 i586
linux:~$
¬O Linux is 2.0.29 ª©¥»¡C
¨ä¥Lªº°Ñ¼Æ¥i¥H¦b¤U¸ü«e¨Ó«ü©w¡A©Î¬O¥Hקï¦b /usr/local/etc/httpd/conf
¥Ø¿ý¤ºªº srm.conf
Àɮרӫغc¡C ¦bhttpd.conf
Àɮפº©Ò
¸ü©úªº¹ê»Ú¥Ø¿ý·|Åã¥Ü¦bùØÀY¡C°ß¤@ªº¨Ò¥~¬Osrm.conf
Àɮפºªºª½±µªºDocumentRoot¡C
³o¶µ¬O¨Ó«ü©w§Aªº¾÷¾¹·|«ç»ò¦a°õ¦æ§Aªº HTTPd ¦øªA¾¹¡C ³Ì¦nªº¤èªk¬O "standalone"¡C³o¼Ë¥iÅý HTTP ºëÆF¤@ª½¦a°õ¦æ¡C¦pªG±z¿ï¾Ü¸ü ¤J HTTPd ¦b "inetd" ¤º¡A¦øªA¾¹ªº¤G¶i¦ì½X·|¦b¨C¤@¦¸ªº»Ý¨D ®É³Q«¸ü¤J°O¾ÐÅ餺¡A³o¼Ë¥i¯à·|´îºC§Aªº¦øªA¾¹¡C
³o¶µ«ü©w±zªº¾÷¾¹ªºþ¤@Ó°ð·|³Q HTTPd ºëÆF¨Ï¥Î¨Ó bind to ¤Î²âÅ¥ HTTP ½Ð¨D¡C¦pªG§A¥i¥Hñ§@¦¨ "root"¡A½Ð¨Ï¥Î¤º©wÈ 80¡C ©Î ªÌ½Ð¦b 1025 ¨ì 65535 ¤§¶¡¬D¿ï¤@Ó¡C
³o¬O¦øªA¾¹¦bµªÂÐn¨D®É§ïÅܦ¨¬°ªº¤Î¹ê»Ú§@¥ÎªºÀɮ׮ɩһݪº¨Ï¥ÎªÌÃѧO¡C ¥u¦³§A±N¦øªA¾¹·í "¿W¥ß³æ¾÷"®É¤~»Ýn¦^µª³oÓ°ÝÃD¡C¦pªG§A ¨S¦³ root ªº±ÂÅv¡A¥u»Ý¨Ï¥Î§Aªº¾E¤J¦WºÙ§Y¥i¡C¦pªG§A¬O¨t²ÎºÞ²zû¡A §A¥i¯à·|·Q«Ø¥ß¤@Ó¯S§Oªº¨Ï¥ÎªÌ¨ÓÅý§A±±¨îÀɮרt²Îªº±ÂÅv¡C
³o¬O¸s²ÕÃѧO¦WºÙ¡A¦øªA¾¹·|¦b¦^À³»Ý¨D¤Î¦b³o¨ÇÀÉ®×°Ê¥ó®É§ïÅܦ¨¥¦Ì¡C ¥¦©M¦øªA¾¹¨Ï¥ÎªÌÃѧO¦WºÙ¦³ÂI¬Û¦P¡A¦Ó¥B¥u¦³¦b§A¿W¦Û°õ¦æ¦øªA¾¹®É¤~¥i ¥H¨Ï¥Î¡C
¦pªG§A¨S¦³ root ªºÅv¡A ½Ð¨Ï¥Î§Aªº¥Dn¸s²Õªº¦W¸q¡C §A¥i¥H¦b Linux ªº©R¥O¦C¤¤¥´¤J groups ±oª¾±zªº¸s²Õ¦WºÙ¡C
³o¬O·í¨Ï¥ÎªÌn³ø§i¦b¦øªA¾¹¤W¦³þ¨Ç°ÝÃD®Én±H¹q¤l¶l¥ó°µ³ø§iªº¦a§}¡C §A¥i¥H¶ñ¤W§AªºÓ¤Hªº e-mail¦a§}¡C
³o¬O«ü¦øªA¾¹¦ì©ó§Aªº¨t²ÎªºþÓ¦a¤è¡C¦pªG§A¦³ root ªºÅv¡A½ÐÅý¥¦´N
¨Ì·Ó¥¦©Ò«Øijªº¦aÂI /usr/local/etc/httpd
¤º¡C ¦pªG§AµLªk¥H
root ªº¨¥÷ñ¤J¡A½Ð¦b§Aªº home ¥Ø¿ý¤º¿ï¾Ü¤@Ó¦¸¥Ø¿ý¡C§A¥i¥H¨Ï¥Îind
out the path of your home directory with the pwd command.
³o¨à¬O³Q¦øªA¨Ï¥Îªº HTML Àɮ׳Q©ñ¸mªº¦aÂI¡C ¤º©wªº¦ì¸m¬O
/usr/local/etc/httpd/htdocs
¡CµM¦Ó§A¥i¥H§â¥¦³]©w¦¨§A¦b¦øªA
¾¹¨Ï¥ÎªÌÃѧO¦WºÙ¤ºªº¯S§Oªº¨Ï¥ÎªÌªº home ¥Ø¿ý¡A©Î¬O§Aªº home ¥Ø¿ý¤º
ªº¤@Ó¤l¥Ø¿ý (°²¦p§AµLªk¾E¤J¦¨¬° root ªº¸Ü¡^¡C
¦pªG¤£¾å±o¡A½Ð¨Ï¥Î¤º©wÈ¡C²{¦b§A¤w¸g¦³¤W±°ÝÃDªºµª®×¤F¡A§A´N¥i¥H
±q
http: //hoohoo.ncsa.uiuc.edu/docs/setup/OneStep.html ¤U¸ü NCSA HTTPd¡C
¦b¦w¸Ë«e§AÀ³¸Ó¾\Ū©ñ¦b
http: //hoohoo.ncsa.uiuc.edu/docs/
¤ºªº HTTPd ¤å¥ó¡C¦pªG§Apµe½sĶ°õ¦æ½X¡A¨º§A»Ýnקï¦bsupport, src, cgi-src
¤Tӥؿý¤ºªº¨C¤@Ó makefiles ÀÉ¡C¦pªG§Aªº Linux ª©¥»¤w¸g¤ä´©¤F¡A¨º»ò§A¥u»Ý
¦b³Ì¤WºÝªº¥Ø¿ý¤W°õ¦æmake linux¡C(¦p /usr/local/etc/httpd
)
³o«Ü²³æ¡A ¥un¦b¦øªA¾¹ªº root ¥Ø¿ý¤ºªº©R¥O¦C¤WÁä¤J make
linux
§Y¥i¡C µù: ¦b½sĶ«e¡Apre-ELF Linux ªº¨Ï¥ÎªÌ
(¨S¦³ ELF ¥\¯àªº Linux) ¶·±N portability.h
Àɮפºªº
#define NO_PASS
¦Cªºµù¸Ñ²Å¸¹®³±¼¨Ã¥B³]©w
Makefile
¤ºªº DBM_LIBS= -ldbm
¡C