提醒:在整个移植的过程中注意各软件包的版本
本文中Sqlite使用的是Sqlite2.8.17.tar.gz,Apache使用的是1.3.39,PHP使用的5.2.13
一:Sqlite数据库移植
1)下载sqlite2.8.17.tar.gz,(版本号至少应该保存前两位对应)
2)把这个压缩包放到/home/chen的目录下,并且解压。再建立一个sqlite目录,作为安装目录。
3)进入到sqlite2.8.17目录下,执行如下命令
CC=arm-linux-gcc ./configure --prefix=/home/chen/sqlite --host=arm-linux
4)make 5)make install 。安装成功后,在sqlite这个目录下有三个文件夹:bin、lib、include
6)进入lib目录中,arm-linux-strip libsqlite.so.0.8.6
7)将bin目录下的sqlite拷贝到目标板的/usr/bin目录下。
8)将lib目录下的libsqlite.so.0.8.6拷贝到/usr/lib目录下。
9)登录到开发板中,进入/usr/lib目录,创建一个符号链接ln -s libsqlite.so.8.6 libsqlite.so.0
到此sqlite数据库就算是移植完毕了。在开发板上面运行sqlite看到如下画面,则sqlite安装成功
二:Apache服务器移植
1)下载apache1.3.39的软件包。apache1.3.39.tar.gz,注意版本的移植性。
2)在/home/chen/目录下建立两个文件夹:arm和source
3)把软件包分别拷贝到arm与source这两个文件夹中,并使用tar -xzvf apache1.3.39.tar.gz进行解压。
4)进入/home/chen/source/apache1.3.39/src这个文件目录中。执行./Configure。生成一个Makefile文件。
5)返回到/home/chen/source/apache1.3.39这个目录中,执行./configure。再执行make。这时可能有两种情况
(①)成功运行出make,无需额外的操作。
(②)make出错,错误如下:
[html]
view plain
copy
- <spanstyle="font-size:18px;">Ifyoudon'tdothis,theinstallationwillfailbecauSEOfthefollowingerror:
- htpasswd.c:101:error:conflictingtypesfor'getline'
- /usr/include/stdio.h:651:note:previousdeclarationof'getline'washere
- make[2]:***[htpasswd.o]Error1
- make[2]:Leavingdirectory`/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41/src/support'
- make[1]:***[build-support]Error1
- make[1]:Leavingdirectory`/home/ISPConfig-2.2.stable/install_ispconfig/compile_aps/apache_1.3.41'
- make:***[build]Error2
- ERROR:CouldnotmakeApache
- </span>
这时打开错误提示的文件/usr/include/stdio.h,找到对应的行,把getline改成parseline(记住在编译完成所有工作时,把他修改回去。)
6)观察/home/chen/source/apache1.3.39/src/main这个目录下是否有gen_test_char和gen_uri_delims这个两个可执行文件。如果上述步骤没有遗漏,应该会出现这两个可执行文件
7)进入/home/chen/arm/apache1.3.39/src中,执行
1)exprort CC="arm-linux-gcc"
2)./Configure生成Makefile文件。会出现Syntax error:word unexpected(expecting")")这种错误。
8)修改arm/apache1.3.39/src/main目录下的Makefile文件。把
./gen_uri_delims >uri_delims.h
改为:
uri_delims.h: gen_uri_delims
/home/chen/source/apache_1.3.39/src/main/gen_uri_delims >uri_delims.h
把test_char.h: gen_test_char
./gen_test_char >test_char.h
test_char.h: gen_test_char
/home/chen/source/apache_1.3.39/src/main/gen_test_char >test_char.h
9)进入到/home/chen/arm/apache1.3.39目录下。执行
(1)export CC="arm-linux-gcc"
(2) ./configure---->make------->make install
看到如下信息
+--------------------------------------------------------+
| You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /usr/local/apache/conf/httpd.conf
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| /usr/local/apache/bin/apachectl start
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+--------------------------------------------------------+
10)进入/usr/local目录中,可以看到多了一个apache的目录,现在把这个目录打包,使用如下命令
tar -czvf apache.tar.gz apache/,在使用ftp等方式把apache解压出来,放入到开发板的/usr/local中。
11)下面须在开发板中/etc的目录中修改两个配置文件,passwd和group文件,如果没有这两个文件就自己建立;
文件一:passwd (如果这个文件中已经有内容了,只需要添加缺少的项就行)
root::0:0:root:/:/bin/ash
nobody::65534:65533:nobody:/:/bin/ash
文件二:group(如果这个文件中已经有内容了,只需要添加缺少的项就行)
nobody::65533:
nogroup::65534:nobody
root::0:
users::100
三:PHP5.2.13的移植
在安装PHP之前需要进行libxml与zlib的安装。所以我们分为3部进行安装PHP,
一:libxml的安装
1)把libxml2-2.8.0解压到/usr/src目录中。在进入libxml2-2.8.0这个目录中去。
2)运行 CC=arm-linux-gcc ./configure --host=arm-linux --target=arm --prefix=/opt/libxml
3)make 再 make install
4)把libxml2.so.2.8.0传到板子的/usr/lib中,并且建立两个符号链接名字分别为libxml2.so和libxml2.so.2
二:zlib的安装
1)把zlib-1.2.7解压到/usr/src目录中,在进入到zlib-1.2.7这个目录中去。
2)运行CC=arm-linux-gcc ./configure --prefix=/opt/zlib
4)把libz.so.1.2.7传到板子的/usr/lib中,并且建立两个符号链接名字分别为libz.so和libz.so.1
三:php的安装
1)把php-5.2.13.tar.gz拷贝到/usr/src目录下。并且在此目录中建立一个temp文件夹。(在把php-5.2.13.tar.gz拷贝到temp文件中,这个里面主要是放PC体系结构的PHP的一个可执行文件,后面交叉编译php的时候回用到)
2)首先进入到temp目录中,解压php,再进入/usr/src/temp/php-5.2.13目录中,直接./configure即可。
再 make 接着make install
3)进入到/usr/src目录,解压php,进入到/usr/src/php-5.2.13目录中。
4)export CC=arm-linux-gcc 再./configure --host=arm-linux--prefix=/opt/php5 --enable-pdo --enable-sockets--with-sqlite --with-pdo-sqlite --with-zlib-dir=/opt/zlib --with-libxml-dir=/opt/libxml --without-iconv
5)首先修改php的Makefile.在开始出添加LDFLAGS += -ldl,这里是为了链接dlopen库然后修改main/php.h 在开始处添加#define HAVE_LIBDL 1,这个宏是为了交叉编译时强制使用dlopen。紧接着修改ext/standard/dl.c ,这段代码中添加#include <dlfcn.h> ,这个是dlopen的头文件。如下
- #ifdefined(HAVE_LIBDL)||HAVE_MACH_O_DYLD_H
- #include<stdlib.h>
- #include<stdio.h>
- #include<dlfcn.h>
6)修改Makefile另外一处。
copy
spanstyle="font-size:14px;">install-pear-installer:$(SAPI_CLI_PATH)
- @$(top_builddir)/sapi/cli/php$(PEAR_INSTALL_FLAGS)pear/install-pear-nozlib.phar-d"$(peardir)"-b"$(bindir)"${PEAR_PREFIX}${PEAR_SUFFIX}
-
-
改为如下
copy
spanxmlns="http://www.w3.org/1999/xhtml"> /usr/src/temp/php-5.2.13/sapi/cli/php$(PEAR_INSTALL_FLAGS)pear/install-pear-nozlib.phar-d"$(peardir)"-b"$(bindir)"${PEAR_PREFIX}${PEAR_SUFFIX}>
7)make 再 make install
8)把当前目录下的php.ini-dist拷贝到/opt/php5/lib中去。
9)进入/opt中,把其中的php5这个文件夹传递到/usr/local中去。
在移植结束apache与php后,需要修改板子中/usr/local/apach/conf中的http.conf文件这里为了把apache以及php联合在一起。改成如下内容:
也可以重新建立一个http.conf文件,内容为下面。
copy
##
- ##httpd.conf--ApacheHTTPserverconfigurationfile
- ##
-
- #
- #BasedupontheNCSAserverconfigurationfilesoriginallybyRobMcCool.
- #ThisisthemainApacheserverconfigurationfile.Itcontainsthe
- #configurationdirectivesthatgivetheserveritsinstructions.
- #SeeURL:http://httpd.apache.org/docs/>fordetailedinformationabout
- #thedirectives.
- #
- #DoNOTsimplyreadtheinstructionsinherewithoutunderstanding
- #whattheydo.They'rehereonlyashintsorreminders.Ifyouareunsure
- #consulttheonlinedocs.Youhavebeenwarned.
- #Afterthisfileisprocessed,theserverwilllookforandprocess
- #/usr/local/apache/conf/srm.confandthen/usr/local/apache/conf/access.conf
- #unlessyouhaveoverriddenthesewithResourceConfigand/or
- #AccessConfigdirectiveshere.
- #Theconfigurationdirectivesaregroupedintothreebasicsections:
- #1.DirectivesthatcontroltheoperationoftheApacheserverprocessasa
- #whole(the'globalenvironment').
- #2.Directivesthatdefinetheparametersofthe'main'or'default'server,
- #whichrespondstorequeststhataren'thandledbyavirtualhost.
- #Thesedirectivesalsoprovidedefaultvaluesforthesettings
- #ofallvirtualhosts.
- #3.Settingsforvirtualhosts,whichallowWebrequeststobesentto
- #differentIPaddressesorhostnamesandhavethemhandledbythe
- #sameApacheserverprocess.
- #Configurationandlogfilenames:Ifthefilenamesyouspecifyformany
- #oftheserver'scontrolfilesbeginwith"/"(or"drive:/"forWin32),the
- #serverwillusethatexplicitpath.Ifthefilenamesdo*not*begin
- #with"/",thevalueofServerRootisprepended--so"logs/foo.log"
- #withServerRootsetto"/usr/local/apache"willbeinterpretedbythe
- #serveras"/usr/local/apache/logs/foo.log".
- ###Section1:GlobalEnvironment
- #ThedirectivesinthissectionaffecttheoveralloperationofApache,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #suchasthenumberofconcurrentrequestsitcanhandleorwhereit
- #canfinditsconfigurationfiles.
- #ServerTypeiseitherinetd,orstandalone.Inetdmodeisonlysupportedon
- #Unixplatforms.
- ServerTypestandalone
- #ServerRoot:Thetopofthedirectorytreeunderwhichtheserver's
- #configuration,error,andlogfilesarekept.
- #NOTE!IfyouintendtoplacethisonanNFS(orotherwisenetwork)
- #mountedfilesystemthenpleasereadtheLockFiledocumentation
- #(availableatURL:http://www.apache.org/docs/mod/core.html#lockfile>);
- #youwillsaveyourselfalotoftrouble.
- ServerRoot"/usr/local/apache"
- #TheLockFiledirectivesetsthepathtothelockfileusedwhenApache
- #iscompiledwitheitherUSE_FCNTL_SERIALIZED_ACCEPTor
- #USE_FLOCK_SERIALIZED_ACCEPT.Thisdirectiveshouldnormallybeleftat
- #itsdefaultvalue.Themainreasonforchangingitisifthelogs
- #directoryisNFSmounted,sincethelockfileMUSTBESTOREDONALOCAL
- #DISK.ThePIDofthemainserverprocessisautomaticallyappendedto
- #thefilename.
- #LockFile/usr/local/apache/logs/httpd.lock
- #PidFile:Thefileinwhichtheservershouldrecorditsprocess
- #identificationnumberwhenitstarts.
- PidFile/usr/local/apache/logs/httpd.pid
- #ScoreBoardFile:Fileusedtostoreinternalserverprocessinformation.
- #Notallarchitecturesrequirethis.Butifyoursdoes(you'llknowbecause
- #thisfilewillbecreatedwhenyourunApache)thenyou*must*ensurethat
- #notwoinvocationsofApachesharethesamescoreboardfile.
- ScoreBoardFile/usr/local/apache/logs/httpd.scoreboard
- #Inthestandardconfiguration,theserverwillprocesshttpd.conf(this
- #file,specifiedbythe-fcommandlineoption),srm.conf,andaccess.conf
- #inthatorder.Thelattertwofilesarenowdistributedempty,asitis
- #recommendedthatalldirectivesbekeptinasinglefileforsimplicity.
- #Thecommented-outvaluesbelowarethebuilt-indefaults.Youcanhavethe
- #serverignorethesefilesaltogetherbyusing"/dev/null"(forUnix)or
- #"nul"(forWin32)fortheargumentstothedirectives.
- #ResourceConfig/usr/local/apache/conf/srm.conf
- #AccessConfig/usr/local/apache/conf/access.conf
- #Timeout:Thenumberofsecondsbeforereceivesandsendstimeout.
- Timeout300
- #KeepAlive:Whetherornottoallowpersistentconnections(morethan
- #onerequestperconnection).Setto"Off"todeactivate.
- KeepAliveOn
- #MaxKeepAliveRequests:Themaximumnumberofrequeststoallow
- #duringapersistentconnection.Setto0toallowanunlimitedamount.
- #Werecommendyouleavethisnumberhigh,formaximumperformance.
- MaxKeepAliveRequests100
- #KeepAliveTimeout:Numberofsecondstowaitforthenextrequestfromthe
- #sameclientonthesameconnection.
- KeepAliveTimeout15
- #Server-poolsizeregulation.Ratherthanmakingyouguesshowmany
- #serverprocessesyouneed,Apachedynamicallyadaptstotheloadit
- #sees---thatis,ittriestomaintainenoughserverprocessesto
- #handlethecurrentload,plusafewspareserverstohandletransient
- #loadspikes(e.g.,multiplesimultaneousrequestsfromasingle
- #Netscapebrowser).
- #Itdoesthisbyperiodicallycheckinghowmanyserversarewaiting
- #forarequest.IftherearefewerthanMinSpareServers,itcreates
- #anewspare.IftherearemorethanMaxSpareServers,someofthe
- #sparesdieoff.ThedefaultvaluesareprobablyOKformostsites.
- MinSpareServers5
- MaxSpareServers10
- #Numberofserverstostartinitially---shouldbeareasonableballpark
- #figure.
- StartServers5
- #Limitontotalnumberofserversrunning,i.e.,limitonthenumber
- #ofclientswhocansimultaneouslyconnect---ifthislimitisever
- #reached,clientswillbeLOCKEDOUT,soitshouldNOTBESETTOOLOW.
- #Itisintendedmainlyasabraketokeeparunawayserverfromtaking
- #thesystemwithitasitspiralsdown...
- MaxClients150
- #MaxRequestsPerChild:thenumberofrequestseachchildprocessis
- #allowedtoprocessbeforethechilddies.Thechildwillexitso
- #astoavoidproblemsafterprolongedusewhenApache(andmaybethe
- #librariesituses)leakmemoryorotherresources.Onmostsystems,this
- #isn'treallyneeded,butafew(suchasSolaris)dohavenotableleaks
- #inthelibraries.Fortheseplatforms,settosomethinglike10000
- #orso;asettingof0meansunlimited.
- #NOTE:Thisvaluedoesnotincludekeepaliverequestsaftertheinitial
- #requestperconnection.Forexample,ifachildprocesshandles
- #aninitialrequestand10subsequent"keptalive"requests,it
- #wouldonlycountas1requesttowardsthislimit.
- MaxRequestsPerChild0
- #Listen:AllowsyoutobindApachetospecificIPaddressesand/or
- #ports,insteadofthedefault.SeealsotheVirtualHost>
- #directive.
- #Listen3000
- #Listen12.34.56.78:80
- #BindAddress:Youcansupportvirtualhostswiththisoption.Thisdirective
- #isusedtotelltheserverwhichIPaddresstolistento.Itcaneither
- #contain"*",anIPaddress,orafullyqualifiedInternetdomainname.
- #Seealsothe>andListendirectives.
- #BindAddress*
- #DynamicSharedObject(DSO)Support
- #TobeabletousethefunctionalityofamodulewhichwasbuiltasaDSOyou
- #havetoplacecorresponding`LoadModule'linesatthislocationsothe
- #directivescontainedinitareactuallyavailable_before_theyareused.
- #Pleasereadthefilehttp://httpd.apache.org/docs/dso.htmlformore
- #detailsabouttheDSOmechanismandrun`httpd-l'forthelistofalready
- #built-in(staticallylinkedandthusalwaysavailable)modulesinyourhttpd
- #binary.
- #Note:Theorderinwhichmodulesareloadedisimportant.Don'tchange
- #theorderbelowwithoutexpertadvice.
- #Example:
- #LoadModulefoo_modulelibexec/mod_foo.so
- #ExtendedStatuscontrolswhetherApachewillgenerate"full"status
- #information(ExtendedStatusOn)orjustbasicinformation(ExtendedStatus
- #Off)whenthe"server-status"handleriscalled.ThedefaultisOff.
- #ExtendedStatusOn
- ###Section2:'Main'serverconfiguration
- #Thedirectivesinthissectionsetupthevaluesusedbythe'main'
- #server,whichrespondstoanyrequeststhataren'thandledbya
- #>definition.Thesevaluesalsoprovidedefaultsfor
- #any>containersyoumaydefinelaterinthefile.
- #Allofthesedirectivesmayappearinside>containers,
- #inwhichcasethesedefaultsettingswillbeoverriddenforthe
- #virtualhostbeingdefined.
- #IfyourServerTypedirective(setearlierinthe'GlobalEnvironment'
- #section)issetto"inetd",thenextfewdirectivesdon'thaveany
- #effectsincetheirsettingsaredefinedbytheinetdconfiguration.
- #SkipaheadtotheServerAdmindirective.
- #Port:Theporttowhichthestandaloneserverlistens.For
- #ports<1023,youwillneedhttpdtoberunasrootinitially.
- Port8080
- #Ifyouwishhttpdtorunasadifferentuserorgroup,youmustrun
- #httpdasrootinitiallyanditwillswitch.
- #User/Group:Thename(or#number)oftheuser/grouptorunhttpdas.
- #.OnSCO(ODT3)use"Usernouser"and"Groupnogroup".
- #.OnHPUXyoumaynotbeabletousesharedmemoryasnobody,andthe
- #suggestedworkaroundistocreateauserwwwandusethatuser.
- #NOTEthatsomekernelsrefusetosetgid(Group)orsemctl(IPC_SET)
- #whenthevalueof(unsigned)Groupisabove60000;
- #don'tuseGroup"#-1"onthesesystems!
- Usernobody
- Groupnogroup
- #ServerAdmin:Youraddress,whereproblemswiththeservershouldbe
- #e-mailed.Thisaddressappearsonsomeserver-generatedpages,such
- #aserrordocuments.
- ServerAdminchen@chen-virtual-machine.
- #ServerNameallowsyoutosetahostnamewhichissentbacktoclientsfor
- #yourserverifit'sdifferentthantheonetheprogramwouldget(i.e.,use
- #"www"insteadofthehost'srealname).
- #Note:Youcannotjustinventhostnamesandhopetheywork.Thenameyou
- #defineheremustbeavalidDNSnameforyourhost.Ifyoudon'tunderstand
- #this,askyournetworkadministrator.
- #Ifyourhostdoesn'thavearegisteredDNSname,enteritsIPaddresshere.
- #Youwillhavetoaccessitbyitsaddress(e.g.,http://123.45.67.89/)
- #anyway,andthiswillmakeredirectionsworkinasensibleway.
- #127.0.0.1istheTCP/IPlocalloop-backaddress,oftennamedlocalhost.Your
- #machinealwaysknowsitselfbythisaddress.IfyouuseApachestrictlyfor
- #localtestinganddevelopment,youmayuse127.0.0.1astheservername.
- #ServerNamewww.example.com
- #DocumentRoot:Thedirectoryoutofwhichyouwillserveyour
- #documents.Bydefault,allrequestsaretakenfromthisdirectory,but
- #symboliclinksandaliasesmaybeusedtopointtootherlocations.
- DocumentRoot"/usr/local/apache/htdocs"
- #EachdirectorytowhichApachehasaccess,canbeconfiguredwithrespect
- #towhichservicesandfeaturesareallowedand/ordisabledinthat
- #directory(anditssubdirectories).
- #First,weconfigurethe"default"tobeaveryrestrictivesetof
- #permissions.
- Directory/>
- OptionsFollowSymLinks
- AllowOverrideNone
- Directory>
- #Notethatfromthispointforwardyoumustspecificallyallow
- #particularfeaturestobeenabled-soifsomething'snotworkingas
- #youmightexpect,makesurethatyouhavespecificallyenabledit
- #below.
- #ThisshouldbechangedtowhateveryousetDocumentRootto.
- Directory"/usr/local/apache/htdocs" #Thismayalsobe"None","All",oranycombinationof"Indexes",248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #"Includes","FollowSymLinks","ExecCGI",or"MultiViews".
- #Notethat"MultiViews"mustbenamed*explicitly*---"OptionsAll"
- #doesn'tgiveittoyou.
- OptionsIndexesFollowSymLinksMultiViews
- #Thiscontrolswhichoptionsthe.htaccessfilesindirectoriescan
- #override.Canalsobe"All",oranycombinationof"Options","FileInfo",248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #"AuthConfig",and"Limit"
- AllowOverrideNone
- #Controlswhocangetstufffromthisserver.
- Orderallow,deny
- Allowfromall
- #UserDir:Thenameofthedirectorywhichisappendedontoauser'shome
- #directoryifa~userrequestisreceived.
- IfModulemod_userdir.c UserDirpublic_html
- IfModule #ControlaccesstoUserDirdirectories.Thefollowingisanexample
- #forasitewherethesedirectoriesarerestrictedtoread-only.
- Directory/home/*/public_html #AllowOverrideFileInfoAuthConfigLimit
- #OptionsMultiViewsIndexesSymLinksIfOwnerMatchIncludesNoExec
- #LimitGETPOSTOPTIONSPROPFIND #Orderallow,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #Allowfromall
- LimitLimitExceptGETPOSTOPTIONSPROPFIND #Orderdeny,allow
- #Denyfromall
- LimitExcept #DirectoryIndex:Nameofthefileorfilestouseasapre-writtenHTML
- #directoryindex.Separatemultipleentrieswithspaces.
- IfModulemod_dir.c DirectoryIndexindex.html
- DirectoryIndexindex.php
- DirectoryIndexindex.php3
- DirectoryIndexindex.phtml
- #AccessFileName:Thenameofthefiletolookforineachdirectory
- #foraccesscontrolinformation.
- AccessFileName.htaccess
- #Thefollowinglinesprevent.htaccessfilesfrombeingviewedby
- #Webclients.Since.htaccessfilesoftencontainauthorization
- #information,accessisdisallowedforsecurityreasons.Comment
- #theselinesoutifyouwantWebvisitorstoseethecontentsof
- #.htaccessfiles.IfyouchangetheAccessFileNamedirectiveabove,
- #besuretomakethecorrespondingchangeshere.
- #Also,folkstendtousenamessuchas.htpasswdforpassword
- #files,sothiswillprotectthoseaswell.
- Files~"^.ht" Denyfromall
- SatisfyAll
- Files #CacheNegotiatedDocs:Bydefault,Apachesends"Pragma:no-cache"witheach
- #documentthatwasnegotiatedonthebasisofcontent.Thisasksproxy
- #serversnottocachethedocument.Uncommentingthefollowinglinedisables
- #thisbehavior,andproxieswillbeallowedtocachethedocuments.
- #CacheNegotiatedDocs
- #UseCanonicalName:(newfor1.3)Withthissettingturnedon,whenever
- #Apacheneedstoconstructaself-referencingURL(aURLthatrefersback
- #totheservertheresponseiscomingfrom)itwilluseServerNameand
- #Porttoforma"canonical"name.Withthissettingoff,Apachewill
- #usethehostname:portthattheclientsupplied,whenpossible.This
- #alsoaffectsSERVER_NAMEandSERVER_PORTinCGIscripts.
- UseCanonicalNameOn
- #TypesConfigdescribeswherethemime.typesfile(orequivalent)is
- #tobefound.
- IfModulemod_mime.c TypesConfig/usr/local/apache/conf/mime.types
- #DefaultTypeisthedefaultMIMEtypetheserverwilluseforadocument
- #ifitcannototherwisedetermineone,suchasfromfilenameextensions.
- #IfyourservercontainsmostlytextorHTMLdocuments,"text/plain"is
- #agoodvalue.Ifmostofyourcontentisbinary,suchasapplications
- #orimages,youmaywanttouse"application/octet-stream"insteadto
- #keepbrowsersfromtryingtodisplaybinaryfilesasthoughtheyare
- #text.
- DefaultTypetext/plain
- #Themod_mime_magicmoduleallowstheservertousevarioushintsfromthe
- #contentsofthefileitselftodetermineitstype.TheMIMEMagicFile
- #directivetellsthemodulewherethehintdefinitionsarelocated.
- #mod_mime_magicisnotpartofthedefaultserver(youhavetoadd
- #ityourselfwithaLoadModule[seetheDSOparagraphinthe'Global
- #Environment'section],orrecompiletheserverandincludemod_mime_magic
- #aspartoftheconfiguration),soit'senclosedinan>container.
- #ThismeansthattheMIMEMagicFiledirectivewillonlybeprocessedifthe
- #moduleispartoftheserver.
- IfModulemod_mime_magic.c MIMEMagicFile/usr/local/apache/conf/magic
- #HostnameLookups:LogthenamesofclientsorjusttheirIPaddresses
- #e.g.,www.apache.org(on)or204.62.129.132(off).
- #Thedefaultisoffbecauseit'dbeoverallbetterforthenetifpeople
- #hadtoknowinglyturnthisfeatureon,sinceenablingitmeansthat
- #eachclientrequestwillresultinATLEASTonelookuprequesttothe
- #nameserver.
- HostnameLookupsOff
- #ErrorLog:Thelocationoftheerrorlogfile.
- #IfyoudonotspecifyanErrorLogdirectivewithina #container,errormessagesrelatingtothatvirtualhostwillbe
- #loggedhere.Ifyou*do*defineanerrorlogfilefora ErrorLog/usr/local/apache/logs/error_log
- #LogLevel:Controlthenumberofmessagesloggedtotheerror_log.
- #Possiblevaluesinclude:debug,info,notice,warn,crit,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #alert,emerg.
- LogLevelwarn
- #Thefollowingdirectivesdefinesomeformatnicknamesforusewith
- #aCustomLogdirective(seebelow).
- LogFormat"%h%l%u%t"%r"%>s%b"%{Referer}i""%{User-Agent}i""combined
- LogFormat"%h%l%u%t"%r"%>s%b"common
- LogFormat"%{Referer}i->%U"referer
- LogFormat"%{User-agent}i"agent
- #Thelocationandformatoftheaccesslogfile(CommonLogfileFormat).
- #Ifyoudonotdefineanyaccesslogfileswithina #container,theywillbeloggedhere.Contrariwise,ifyou*do*
- #defineper->accesslogfiles,transactionswillbe
- #loggedthereinand*not*inthisfile.
- CustomLog/usr/local/apache/logs/access_logcommon
- #Ifyouwouldliketohaveagentandrefererlogfiles,uncommentthe
- #followingdirectives.
- #CustomLog/usr/local/apache/logs/referer_logreferer
- #CustomLog/usr/local/apache/logs/agent_logagent
- #Ifyoupreferasinglelogfilewithaccess,agent,andrefererinformation
- #(CombinedLogfileFormat)youcanusethefollowingdirective.
- #CustomLog/usr/local/apache/logs/access_logcombined
- #Optionallyaddalinecontainingtheserverversionandvirtualhost
- #nametoserver-generatedpages(errordocuments,FTPdirectorylistings,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #mod_statusandmod_infooutputetc.,butnotCGIgenerateddocuments).
- #Setto"EMail"toalsoincludeamailto:linktotheServerAdmin.
- #Settooneof:On|Off|EMail
- ServerSignatureOn
- #EBCDICconfiguration:
- #(onlyformainframesusingtheEBCDICcodeset,currentlyoneof:
- #Fujitsu-Siemens'BS2000/OSD,IBM'sOS/390andIBM'sTPF)!!
- #Thefollowingdefaultconfigurationassumesthat"textfiles"
- #arestoredinEBCDIC(sothatyoucanoperateonthemusingthe
- #normalPOSIXtoolslikegrepandsort)while"binaryfiles"are
- #storedwithidenticaloctetsasonanASCIImachine.
- #Thedirectivesareevaluatedinconfigurationfileorder,with
- #theEBCDICConvertdirectivesappliedbeforeEBCDICConvertByType.
- #IfyouwanttohaveASCIIHTMLdocumentsandEBCDICHTMLdocuments
- #atthesametime,youcanusethefileextensiontoforce
- #conversionofffortheASCIIdocuments:
- >AddTypetext/html.ahtml
- >EBCDICConvertOff=InOut.ahtml
- #EBCDICConvertByTypeOn=InOuttext/*message/*multipart/*
- #EBCDICConvertByTypeOn=Inapplication/x-www-form-urlencoded
- #EBCDICConvertByTypeOn=InOutapplication/postscriptmodel/vrml
- #EBCDICConvertByTypeOff=InOut*/*
- #Aliases:Addhereasmanyaliasesasyouneed(withnolimit).Theformatis
- #Aliasfakenamerealname
- IfModulemod_alias.c #Notethatifyouincludeatrailing/onfakenamethentheserverwill
- #requireittobepresentintheURL.So"/icons"isn'taliasedinthis
- #example,only"/icons/".Ifthefakenameisslash-terminated,thenthe
- #realnamemustalsobeslashterminated,andifthefakenameomitsthe
- #trailingslash,therealnamemustalsoomitit.
- Alias/icons/"/usr/local/apache/icons/"
- Directory"/usr/local/apache/icons" OptionsIndexesMultiViews
- #ThisAliaswillprojecttheon-linedocumentationtreeunder/manual/
- #evenifyouchangetheDocumentRoot.Commentitifyoudon'twantto
- #provideaccesstotheon-linedocumentation.
- Alias/manual/"/usr/local/apache/htdocs/manual/"
- Directory"/usr/local/apache/htdocs/manual" OptionsIndexesFollowSymlinksMultiViews
- Orderallow,deny
- Allowfromall
- #ScriptAlias:Thiscontrolswhichdirectoriescontainserverscripts.
- #ScriptAliasesareessentiallythesameasAliases,exceptthat
- #documentsintherealnamedirectoryaretreatedasapplicationsand
- #runbytheserverwhenrequestedratherthanasdocumentssenttotheclient.
- #Thesamerulesabouttrailing"/"applytoScriptAliasdirectivesasto
- #Alias.
- ScriptAlias/cgi-bin/"/usr/local/apache/cgi-bin/"
- ScriptAlias/php5/"/usr/local/php5/bin/"
- #"/usr/local/apache/cgi-bin"shouldbechangedtowhateveryourScriptAliased
- #CGIdirectoryexists,ifyouhavethatconfigured.
- Directory"/usr/local/apache/cgi-bin" OptionsNone
- #Endofaliases.
- #Redirectallowsyoutotellclientsaboutdocumentswhichusedtoexistin
- #yourserver'snamespace,butdonotanymore.Thisallowsyoutotellthe
- #clientswheretolookfortherelocateddocument.
- #Format:Redirectold-URInew-URL
- #Directivescontrollingthedisplayofserver-generateddirectorylistings.
- IfModulemod_autoindex.c #FancyIndexingiswhetheryouwantfancydirectoryindexingorstandard
- IndexOptionsFancyIndexing
- #AddIcon*directivestelltheserverwhichicontoshowfordifferent
- #filesorfilenameextensions.Theseareonlydisplayedfor
- #FancyIndexeddirectories.
- AddIconByEncoding(CMP,/icons/compressed.gif)x-compressx-gzip
- AddIconByType(TXT,/icons/text.gif)text/*
- AddIconByType(IMG,/icons/image2.gif)image/*
- AddIconByType(SND,/icons/sound2.gif)audio/*
- AddIconByType(VID,/icons/movie.gif)video/*
- AddIcon/icons/binary.gif.bin.exe
- AddIcon/icons/binhex.gif.hqx
- AddIcon/icons/tar.gif.tar
- AddIcon/icons/world2.gif.wrl.wrl.gz.vrml.vrm.iv
- AddIcon/icons/compressed.gif.Z.z.tgz.gz.zip
- AddIcon/icons/a.gif.ps.ai.eps
- AddIcon/icons/layout.gif.html.shtml.htm.pdf
- AddIcon/icons/text.gif.txt
- AddIcon/icons/c.gif.c
- AddIcon/icons/p.gif.pl.py
- AddIcon/icons/f.gif.for
- AddIcon/icons/dvi.gif.dvi
- AddIcon/icons/uuencoded.gif.uu
- AddIcon/icons/script.gif.conf.sh.shar.csh.ksh.tcl
- AddIcon/icons/tex.gif.tex
- AddIcon/icons/bomb.gifcore
- AddIcon/icons/back.gif..
- AddIcon/icons/hand.right.gifREADME
- AddIcon/icons/folder.gif^^DIRECTORY^^
- AddIcon/icons/blank.gif^^BLANKICON^^
- #DefaultIconiswhichicontoshowforfileswhichdonothaveanicon
- #explicitlyset.
- DefaultIcon/icons/unknown.gif
- #AddDescriptionallowsyoutoplaceashortdescriptionafterafilein
- #server-generatedindexes.TheseareonlydisplayedforFancyIndexed
- #directories.
- #Format:AddDescription"description"filename
- #AddDescription"GZIPcompresseddocument".gz
- #AddDescription"tararchive".tar
- #AddDescription"GZIPcompressedtararchive".tgz
- #ReadmeNameisthenameoftheREADMEfiletheserverwilllookforby
- #default,andappendtodirectorylistings.
- #HeaderNameisthenameofafilewhichshouldbeprependedto
- #directoryindexes.
- ReadmeNameREADME.html
- HeaderNameHEADER.html
- #IndexIgnoreisasetoffilenameswhichdirectoryindexingshouldignore
- #andnotincludeinthelisting.Shell-stylewildcardingispermitted.
- IndexIgnore.??**~*#HEADER*README*RCSCVS*,v*,t
- #Endofindexingdirectives.
- #Documenttypes.
- #AddLanguageallowsyoutospecifythelanguageofadocument.Youcan
- #thenusecontentnegotiationtogiveabrowserafileinalanguage
- #itcanunderstand.
- #Note1:Thesuffixdoesnothavetobethesameasthelanguage
- #keyword---thosewithdocumentsinPolish(whosenet-standard
- #languagecodeispl)maywishtouse"AddLanguagepl.po"to
- #avoidtheambiguitywiththecommonsuffixforperlscripts.
- #Note2:Theexampleentriesbelowillustratethatinquite
- #somecasesthetwocharacter'Language'abbreviationisnot
- #identicaltothetwocharacter'Country'codeforitscountry,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #E.g.'Danmark/dk'versus'Danish/da'.
- #Note3:InthecaSEOf'ltz'weviolatetheRFCbyusingathreechar
- #specifier.Butthereis'workinprogress'tofixthisandget
- #thereferencedataforrfc1766cleanedup.
- #Danish(da)-Dutch(nl)-English(en)-Estonian(ee)
- #French(fr)-German(de)-Greek-Modern(el)
- #Italian(it)-Korean(kr)-Norwegian(no)-NorwegianNynorsk(nn)
- #Portugese(pt)-Luxembourgeois*(ltz)
- #Spanish(es)-Swedish(sv)-Catalan(ca)-Czech(cs)
- #Polish(pl)-BrazilianPortuguese(pt-br)-Japanese(ja)
- #Russian(ru)
- AddLanguageda.dk
- AddLanguagenl.nl
- AddLanguageen.en
- AddLanguageet.ee
- AddLanguagefr.fr
- AddLanguagede.de
- AddLanguageel.el
- AddLanguagehe.he
- AddCharsetISO-8859-8.iso8859-8
- AddLanguageit.it
- AddLanguageja.ja
- AddCharsetISO-2022-JP.jis
- AddLanguagekr.kr
- AddCharsetISO-2022-KR.iso-kr
- AddLanguagenn.nn
- AddLanguageno.no
- AddLanguagepl.po
- AddCharsetISO-8859-2.iso-pl
- AddLanguagept.pt
- AddLanguagept-br.pt-br
- AddLanguageltz.lu
- AddLanguageca.ca
- AddLanguagees.es
- AddLanguagesv.sv
- AddLanguagecs.cz.cs
- AddLanguageru.ru
- AddLanguagezh-TW.zh-tw
- AddCharsetBig5.Big5.big5
- AddCharsetWINDOWS-1251.cp-1251
- AddCharsetCP866.cp866
- AddCharsetISO-8859-5.iso-ru
- AddCharsetKOI8-R.koi8-r
- AddCharsetUCS-2.ucs2
- AddCharsetUCS-4.ucs4
- AddCharsetUTF-8.utf8
- #LanguagePriorityallowsyoutogiveprecedencetosomelanguages
- #incaSEOfatieduringcontentnegotiation.
- #Justlistthelanguagesindecreasingorderofpreference.Wehave
- #moreorlessalphabetizedthemhere.Youprobablywanttochangethis.
- IfModulemod_negotiation.c LanguagePriorityendanletfrdeelitjakrnoplptpt-brrultzcaessvtw
- #AddTypeallowsyoutotweakmime.typeswithoutactuallyeditingit,orto
- #makecertainfilestobecertaintypes.
- AddTypeapplication/x-tar.tgz
- AddTypeapplication/x-httpd-php.php3
- AddTypeapplication/x-httpd-php.php
- AddTypeapplication/x-httpd-php.phtml
- #AddEncodingallowsyoutohavecertainbrowsersuncompress
- #informationonthefly.Note:Notallbrowserssupportthis.
- #Despitethenamesimilarity,thefollowingAdd*directiveshavenothing
- #todowiththeFancyIndexingcustomizationdirectivesabove.
- AddEncodingx-compress.Z
- AddEncodingx-gzip.gz.tgz
- #IftheAddEncodingdirectivesabovearecommented-out,thenyou
- #probablyshoulddefinethoseextensionstoindicatemediatypes:
- #AddTypeapplication/x-compress.Z
- #AddTypeapplication/x-gzip.gz.tgz
- #AddHandlerallowsyoutomapcertainfileextensionsto"handlers",108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #actionsunrelatedtofiletype.Thesecanbeeitherbuiltintotheserver
- #oraddedwiththeActioncommand(seebelow)
- #Ifyouwanttouseserversideincludes,orCGIoutside
- #ScriptAliaseddirectories,uncommentthefollowinglines.
- #TouseCGIscripts:
- #AddHandlercgi-script.cgi
- #Touseserver-parsedHTMLfiles
- #AddTypetext/html.shtml
- #AddHandlerserver-parsed.shtml
- #UncommentthefollowinglinetoenableApache'ssend-asisHTTPfile
- #feature
- #AddHandlersend-as-isasis
- #Ifyouwishtouseserver-parsedimagemapfiles,248); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> #AddHandlerimap-filemap
- #Toenabletypemaps,youmightwanttouse
- #AddHandlertype-mapvar
- Actionapplication/x-httpd-php"/php5/php"
- #Endofdocumenttypes.
- #Actionletsyoudefinemediatypesthatwillexecuteascriptwhenever
- #amatchingfileiscalled.ThiseliminatestheneedforrepeatedURL
- #pathnamesforoft-usedCGIfileprocessors.
- #Format:Actionmedia/type/cgi-script/location
- #Format:Actionhandler-name/cgi-script/location
- #MetaDir:specifiesthenameofthedirectoryinwhichApachecanfind
- #metainformationfiles.ThesefilescontainadditionalHTTPheaders
- #toincludewhensendingthedocument
- #MetaDir.web
- #MetaSuffix:specifiesthefilenamesuffixforthefilecontainingthe
- #metainformation.
- #MetaSuffix.meta
- #Customizableerrorresponse(Apachestyle)
- #thesecomeinthreeflavors
- #1)plaintext
- #ErrorDocument500"Theservermadeabooboo.
- #n.b.thesingleleading(")marksitastext,itdoesnotgetoutput
- #2)localredirects
- #ErrorDocument404/missing.html
- #toredirecttolocalURL/missing.html
- #ErrorDocument404/cgi-bin/missing_handler.pl
- #N.B.:Youcanredirecttoascriptoradocumentusingserver-side-includes.
- #3)externalredirects
- #ErrorDocument402http://www.example.com/subscription_info.html
- #N.B.:Manyoftheenvironmentvariablesassociatedwiththeoriginal
- #requestwill*not*beavailabletosuchascript.
- #Customizebehaviourbasedonthebrowser
- IfModulemod_setenvif.c #ThefollowingdirectivesmodifynormalHTTPresponsebehavior.
- #ThefirstdirectivedisableskeepaliveforNetscape2.xandbrowsersthat
- #spoofit.Thereareknownproblemswiththesebrowserimplementations.
- #TheseconddirectiveisforMicrosoftInternetExplorer4.0b2
- #whichhasabrokenHTTP/1.1implementationanddoesnotproperly
- #supportkeepalivewhenitisusedon301or302(redirect)responses.
- BrowserMatch"Mozilla/2"nokeepalive
- BrowserMatch"MSIE4.0b2;"nokeepalivedowngrade-1.0force-response-1.0
- #ThefollowingdirectivedisablesHTTP/1.1responsestobrowserswhich
- #areinviolationoftheHTTP/1.0specbynotbeingabletogroka
- #basic1.1response.
- BrowserMatch"RealPlayer4.0"force-response-1.0
- BrowserMatch"Java/1.0"force-response-1.0
- BrowserMatch"JDK/1.0"force-response-1.0
- #Endofbrowsercustomizationdirectives
- #Allowserverstatusreports,withtheURLofhttp://servername/server-status
- #Changethe".example.com"tomatchyourdomaintoenable.
- Location/server-status #SetHandlerserver-status
- #Allowfrom.example.com
- Location #Allowremoteserverconfigurationreports,withtheURLof
- #http://servername/server-info(requiresthatmod_info.cbeloaded).
- Location/server-info #SetHandlerserver-info
- #Therehavebeenreportsofpeopletryingtoabuseanoldbugfrompre-1.1
- #days.ThisbuginvolvedaCGIscriptdistributedasapartofApache.
- #Byuncommentingtheselinesyoucanredirecttheseattackstoalogging
- #scriptonphf.apache.org.Or,youcanrecordthemyourself,usingthescript
- #support/phf_abuse_log.cgi.
- Location/cgi-bin/phf* #ErrorDocument403http://phf.apache.org/phf_abuse_log.cgi
- ###Section3:VirtualHosts
- #VirtualHost:Ifyouwanttomaintainmultipledomains/hostnamesonyour
- #machineyoucansetupVirtualHostcontainersforthem.Mostconfigurations
- #uSEOnlyname-basedvirtualhostssotheserverdoesn'tneedtoworryabout
- #IPaddresses.Thisisindicatedbytheasterisksinthedirectivesbelow.
- #PleaseseethedocumentationatURL:http://www.apache.org/docs/vhosts #forfurtherdetailsbeforeyoutrytosetupvirtualhosts.
- #Youmayusethecommandlineoption'-S'toverifyyourvirtualhost
- #configuration.
- #Usename-basedvirtualhosting.
- #NameVirtualHost*:80
- #VirtualHostexample:
- #AlmostanyApachedirectivemaygointoaVirtualHostcontainer.
- #ThefirstVirtualHostsectionisusedforrequestswithoutaknown
- #servername.
- VirtualHost*:80 #ServerAdminwebmaster@dummy-host.example.com
- #DocumentRoot/www/docs/dummy-host.example.com
- #ServerNamedummy-host.example.com
- #ErrorLoglogs/dummy-host.example.com-error_log
- #CustomLoglogs/dummy-host.example.com-access_logcommon
- >
在进行上诉步骤后即可移植成功。以上作为参考,我会把编译成功的打包上传到资源中。如下链接
apache:http://download.csdn.net/detail/cangencong/4553164
php:http://download.csdn.net/detail/cangencong/4553169
sqlite2:http://download.csdn.net/detail/cangencong/4553173
zlib:http://download.csdn.net/detail/cangencong/4553175
libxml:http://download.csdn.net/detail/cangencong/4553177
HTTP.CONF配置文件下载http://download.csdn.net/detail/cangencong/5596839
转载:http://blog.csdn.net/cangencong/article/details/7924315 (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|