还剩10页未读,继续阅读
本资源只提供10页预览,全部文档请下载后查看!喜欢就下载吧,查找使用更方便
文本内容:
站点支持面向社群的协作式写作,每个人都可以发表自己的见解,或者对共同维护的主题Wiki进行扩展同时也包括一组支持这种写作的辅助工具,可以在的基础上对页面Wiki WebW iki的文本进行创建,更改和发布,比做网页和更新网页简单方便得多下面我们来配置服务器W iki
一、安装系统Linux要配置服务器我们首先要安装一个系统,在系统中配置环境,这里我Wiki LinuxLAMP们使系统,装系统我们就不多说了,简单安装一个系统,但是要把编译环境安装好Ce ntOS
二、配置环境LAMP主要软件包,
1.h11p d-2o2o17o t ar.gz这个版本是已编译好的压缩包,解压后稍做配置即可使用2o mysql-5o
0.20aotar gzo3o ph p—
5.
2.17o tarr gz安装所需的软件包其中是安装必须的php libxml2php51o libxml2-vers ion.tar.gz
1.1i bx sit—versi on.tar.gz一3o curlver s i o n.tar g z库所需要软件包有人说源码包里自带了和,只要安装GD PHPG D
2.
0.28zl i b的三个支持包和,但是我们还是下载GD jpg,P ngf reet y pe一1o gd versi on t a rgzo
2.fr eetype-versi0n.tar.gz30j peg src.v6bo targz一
4.lib pn gversio ntar.g zo5o zlib-1o2o3o tar.gz以上软件的版本自行决定,不一定是越高越好将下载好的软件都传到服务器上LINUXlibpng-l.
2.
38.tar.Izma、安装解压原码包1MyS QLMySQLEroot@Wikitest LAMP+wiki]^tar xvpfmysql-
5.
0.20a.tar.gz|解压后进入到解压出的文件夹中cd mysql-
5.
0.20a1LrootfWikitest mysql_
5.
0.20a]ft Isaclocal.m4configure READMEconfigure.in EXCEPTIONS-CLIENT install-sh missingconfig,guess COPYINGINSTALL-SOURCE Itmain.shChangeLog config.h.in INSTALL-WIN-SOURCE Makefile.amconfig,sub depcompMakefile,in为保证数据安全我们在安装系统时做一个分区专门用来存储数据r^otWikitestmysql-5T0r20aj4df-h文件系统容量己用可用己用%挂载点/dev/sda
25.7G
3.2G
2.3G59%//dev/sda541G3439G1%/data/dev/sdal190M12169M7%/boottmpfs506M0506M0%/dev/shm上图中的就是专门用来存放数据的,我样把数据库也安装到该分区中/d a ta
1.$wgE n ableUploads设置为t rue.这样就启用了的图片上传功能Med ia WikiAMed iaWiki上传图片和使用图片aMedi aWiki上传图片上传页面的地址是,也可以先进入特殊页面,然后进入上传文件页面Sp eci al:Uplo a d在该页面中上传图片,设置好文件名和描述,上传成功以后就可以在文章中使用了^MediaWiki使用图片在要插入图片的位置输入
2.[[Image:f i1e jpg]]o就可以显示对应的图片了.Media Wiki限制上传文件大小在增加下面一行1ocalsettingSo p hp
3.$wgM axUploa dSize=5020;单位为字节,这个在新(versions
1.93到
1.12)版本中已经不起作用啦,要在p hP环境中进行限制,那么还有个警告大文件上传的警示大小是在中的,默认为Def au1t Se tting.php150k,如果嫌烦,可以调大些(建议不用调)处4e diaWiki引用外部图片4在增加下面一行即可(可能引起安全问题)localset t ings.p hp
1.$wgAllowEx t e r nal Image s=true;通过图片进行上传(使用可被公开访问的图片链接进行远程图片上传(这个功能很URL酷,5不过只有操作员才可以用,嘿嘿,安全考虑,这样很有必要呢))在@41增加下面一行(可能引起安全问题)Isettings.php♦
2.$wgA11o wCo py Uploads=tr ue;开启其他文件上传开启其他文件上传,比如d oc,p df,pp t,doc x,ppt x打开根目录中的,修改,此变量默w ik i includes/D e faults e tt i ngs.p hp$w gFileExt ensio ns认仅支持‘png,,gif,jpg,jpeg四种,修改为•$w gFi1eE xtens ions=arra y(J png,gif,jpg,jpeg,doc,ppt,pdf);上传过程出现错误提示“该文件包含或具有一个不正确的扩展名.请检查此文件并重新上传”,比如,已经在中设置了允许上传类型为什么还是上传不了,打开wgFileExte nsions p pt,wi k根目录中的将$修改为;一了iinclude s/D efau ItS etti ngs php,wg VerifyMimeT ypefalseo百了,但会把当处理,都是正常的p ptx zipwor d,ppt取消类别的文件格式限制MIME applica tion/zip”当上传p df的时候没有问题,但是上传dC X或者z ip格式的文件时就会提示不可以上传这个文件,因为e rn会将它侦测为t p”,它是一种不容许以及有潜Int et Explorer“applica ion/zi在危险性之文件类型同上面找到s/a ti gs默认配置文件修改i ey ci的值“i nclude DefultSet nphp”$wgM mT peBlakl stoc1t=r an anac rd web$wgMimeTypeBla kis ary A#HTML mayco ti cookie-ste lingJavaS iptan bus tat\e sc sgAtext/html,tex/jav scriptext/x—javascript,Application/x-sh IIripf A#PHP criptsmaye ei c o t sx cutearb trary ode nhe ervera1c n/x hb ited ss rppi atio-php\*text/x-p hp*,a#Other typest atma ye nterpreby omee vers1t t hon1,e一e*teb shtsh一iext/x-py txt/x prP,xt/x-a ext/x—*text/x cshQ#CIa r o ItExp1oent-side hza dsn nternererr e p xd df e,c nt—side na itext/sc iptlt*,a plication/-ms ownloadq#Win owsmeta illie vuler bIi tyon some systemsA,appli c ation/x—ms metafile1,A eadn1h x1o#ZIP filemay ba vli Javaarchive containig anapp etw ich epits theernyocoo i#sam-o igipolic tsteal kesa pplicat ion/z ip,//by baicailin;在can/z,前面加#号(注释掉这行)app1i tioip所以在做原码编译时要配置一下导原码的安装目录用来配置的安装路径o/con f i gure-pref ix=/d ata/loc a1/mysql MySQL#./configure-prefix=/data/local/mysql|开始配置安装文件,等一会,当配置完成后会出现如下界面MySQL has a Website at.mysql.com/which carriesdetails onthe latestrelease,upcoming features,and otherinformation tomake yourwork orplay withMySQL moreproductive.There youcan alsofindinformation aboutmailing listsfor MySQLdiscussion.Remember tocheck theplatform specificpart ofthe referencemanual forhints aboutinstalling MySQLonyour platform.Also havea lookat thefiles inthe Docsdirectory.Thank youfor choosingMySQL!接下来开始编译原代码,使用命令,编译过程是通过来编译的,所以在安装系统时make gc c记得要把编译环境安装好lex.Tpo^-c-o sql_lex.o sql_lex.cc;\then mv-f deps/sql_lex.Tpo^”・deps/sql_lex・Po”;else rmif g++-DMYSQL_SERVER-DDEFAULT-M\rSQL_HOME=\/data/local/mysql\I..-I../innobase/include-I../include-I../include-I../regex-I.sql_handler.Tpo^-c-osql_handler.o sql_handler.cc;\then mv-f deps/sql_handler.Tpo^”・deps/sql_handler.Po;if g++-DMYSQL_SERVER-DDEFAULT„M\rSQL_HOME=\/data/local/mysql\L.-I../innobase/include-I../include-I../include-I../regex-I.o-c-o item,o item,cc;\then mv-f deps/item.Tpo^deps/item.Po^;else rm-f ifg++-DMYSQL_SERVER-DDEFAULT_M\rSQL_HOME=^\/data/local/mysql\编译过程一堆我们看不懂的东东,不管他,这个时间会长点,等吧编译完成后用“make insta11”命令进行安装井cp support-files.my-medium.cnf etc/my.cnf安装完成后将配置文件复制过#make install.来新建一个用户和组my sql井groupadd mysql#useradd-g mysql mysql切换至的安装目录,并修改目录权限lj my s qldrwxr-xr-x11mysqlmysql409602-1810:22启动MySQL#bin/mysql_install_db-user=mysql4bin/mysqld_safe-user=mysql l到这里就算安装并启动完毕了,但是还有一些工作也是必须要做的,比如设置密码、让mysql r开机自启动mysql设置的密码mysq1root井bin/mysqladmin-u rootpassword ztel23设置开机自启动My SQL#cp/data/LAMP+wiki/mysql-
5.
0.20a/support-files/mysql.server/etc/rc.d/init.d/mysql#chmod+x/etc/rc.d/init.d/mysql#chkconfig——add mysql、安装2Apache井tar-xvpf httpd-
2.
2.
17.tar.gz一一Eroot@Wikitest httpd-
2.
2.171^./configure prefix=/data/local/apache\-with-mysql=/data/locail/niysql-enable-module=so-enable-share=max,make安装完成后,启动服务井/data/local/apache/bin/httpd-k start启动后在浏览器中输入http//IP地址出现下图则表示服务安装成功It works!打开找到找到/da ta/local/apache/con f/httpd.c onf,Add Typeon/x-g zipo a pp1i cati(第行),在它的下面添加tgz294A ddTypeapplicati on/x-http d-php phpAddType applic ation/x-ht t pd-php-s ou rce.phpsAddType application/x-compress.ZAddType app1ication/x-gzip.gz.tgzAddType app1i cation/x-httpd-php.phpAddTypeapp1i cation/x-httpd-php-source.phps|找至!在前添加J”Di rec to ryl ndex index.html”inde xh tm1i ndoex.p hpIfModule dir_moduleDirectoryindex index,php index,html、安装支持库,3PHP,安装包让支持a jpegPHP GIF,PNG,J PEG井tar xvfjpegsrc.v
7.tar.gz#cd jpeg-7井./configure-prefix=/data/local/jpeg-enable-shared-enable-static#make#make install安装bo1i bxm12井./configure-prefix=/data/local/1ibxml2#make井make install安装c.PHPEroot@Wikitest php-
5.
2.17]#./configure-prefix=/data/local/php5\-with-mysql=/data/local/mysql-with-jpeg-dir=/data/local/jpeg7\-with-apxs2=/data/local/apache/bin/apxs配置完成后会出现如下图Thank youfor usingPHP.井makeBuild complete.按要求运行土make test|Dont forget to runmake test.运行完后会问你要不要发送报告Do youwant tosend thisreport nowLYns」也安装完成了PHP修改的配置文件PHP#cp php.ini-dist/data/local/php5/1ib/php.ini#vi/data/local/php5/1ib/php.ini新建一个页面ph pLroot@Wikitest php-
5.
2.171^vi/data/local/apache/htdocs/index,php[rootQWikitestphp-
5.
2.17Z^cat/data/local/apache/htdocs/index,php phpphpinfoO;保存好后,重启服务ap ache井,,data/locaL apachebin/httpd-k start重启后在浏览器中输入http//X.X X X/index.phpSystem LinuxWikitest
2.
6.18-194,el5#1SMP FriApr214:58:35EDT2010i686Build DateFeb18201112:17:33Configure Command./configure prefix=/data/local/php5with-mysql=/data/local/mysqr-with-jpeg-dir=/data/local/jpeg7with-apxs2=/data/local/apache/bin/apxsServer APIApache
2.0Handler如出现的相信息则说明安装成功P HP PHP
三、安装Wiki解压出并将解压出的文件重命名并复制到/目录中media wiki,d ata#tar xvfmediawiki-
1.
16.
2.tar.gz#mv mediawiki-
1.
16.2Wiki井mv Wiki/data/1进入My sq1local/mysq1/bin/mysq1-uroot-pztel23创建数据库w ikimysql createdatabase wiki;Query OK,1row affected
0.02secmysql showdatabases;Databaseinformation_schemamysql|test|wiki4rows inset
0.00sec将建立的权限给帐号,并且设定密码wiki w i kigranta IIo nwi ki*towiki@loc aIhost identif ied by zte123omysql grantall onwiki.*to wiki@localhost identifiedbyztel23;Query OK,0rows affected
0.00sec建好用户和数据库后退出数据库,进入到目录中准备安装,并给Wiki config文件赋权R cd/data/Wiki/R chmoda+w config同时修改的配置文件ap ache httpd.con f井vi/data/local/apache/conf/httpd.conf将主目录改为目录wiki#DocumentRoot/data/local/apache/htdocs DocumentRoot/data/Wiki”修改完成后重启服务apach e打开浏览器输入http〃X.XX.X,如下图,点击setup thewikiPlease setup thewiki first.进入到的安装界面wikiMediaWiki
1.
16.2Installation■Dontforgetsecurityupdates!Keepaneyeonthelow-trafficreleaseannouncementsmailinglistChecking environment...Pleaseincludeallofthelinesbelowwhenreportinginstallationproblems.■Readme■Releasenotes■PHP
5.217installed■Documentation■FounddatabasedriversforMySQLSQLite■UsersGuide■PHPserverAPIisapache2handler;ok,usingprettyURLsindex.php/Page_Title■HaveXML/Latin1-UTF-8conversionsupport.■Administrators■Warning:Avalueforsession.save_pathhasnotbeensetinPHP.inl.Ifthedefaultvaluecausesproblemswithsavingsessiondata,setIttoavallcunder.GuidePHP,sxnemory_liinlcis128Mbytes.■FAQ■CouldntfindeAccelerator,APCorXCactie;cannotusetheseforobjectcaching.MediaWikiisCopyright©■FoundGNUdiff3:/usr/bin/diff
3.2001-2009byMagnus■FoundImageMagick:/usr/bxn/convert;imagethumbnailingwillbeenabledifyouenableuploads.Manske,BrionVibber,Lee■Installationdirectory:/data/WikiDanielCrocker.TimStaring.■ScriptURIpath:■InstallingMediaWikiwithphpfileextensionsErikMOIer.GabrielWicke,■Environmentchecked.YoucaninstallMediaWiki.^varAmfjdrdBjarmason.NiklasLaxstrom.DomasF.Htuzas.RobChurch,Yuri Site configAstrakhan,AryehGregor.AaronSchulzandothersWikiname:MustnotbeblankorMediaWikiandmaynotcontain#、Preferablyashortwordwithoutpunctuation,i.e.WUpediaWilappearasthenamespacenamefor-metapages,andthroughouttheinterface.在中填入服务器的相关信息准备安装si teconfig填写系统信息填写内容说明站点设置Site config站点别名Site name:Cjh系统管理员电子邮件Admin mailaddressLanguage zh-cn简体中文语言设定GNU Free遵守的版权协议Copyright/license metadataDocumentationLicense
1.2Wikipedia-compatible管理员用户名称名称建议英文Sysop accountname:xxxxxxxx管理员的密码passwordxxxxxxxx再次输入管理员的密码again:Shared memorycaching MemcachedPhp加速服务器类型主机别名Memcached serverslocalhostDatabase configMYSQL数据库设定数据库主机名称MySQL serverlocalhost数据库名称Database nameWiki数据库管理员帐号DB usernameWiki数据库管理员密码DB password xxxxxxxx再次输入数据库管理员密码again xxxxxxxx数据库表格字首Database tableprefix Wiki_DB rootpasswordxxxxxxx数据库「00领长号密码填写完成后点击最后面的按钮,进行安装,当出现如下图则表示安装“Install MediaWik i”W iki成功■・n J・J d•W・••99■■■■J■Created sysopaccount admin.■Creating LocalSettings.php...Installation successful!Move thefile to the pareconfig/Locaisettings.phpYou shouldchange filepermissions foras requiredto preventLocalSettings.php注意这段话在Installation successful!conMove theconfig/Locaisettings.php fileto theparent directory,then followthis linkto yourwiki.目录下会自动生成一个的本地配置文件把它移动f igL ocal Settings,p hp LocalSettings op hp到上级目录中.然后点击图中页面右下角处“链接就可以看到完成安装的首t hisLink”wiki页了页面—||讨论|「编辑]「历史一|Set SwgLogoo_________totheURLpath toyourown logo已成功安装MediaWikiimage.清查阅用户指南因以获取使用本wiki软件的信息!入门导航■首页■MediaWiki酉1置设置列表■社区人口臼■当前事件■MediaWiki常见问题团■最近更改■随机页面■帮助搜索进入搜索工具箱■链入页面■链出更改■特殊页面■可打印版■永久链接到此为止,我们初步建立网站wik iFAQ在打开页面时如果碰到以下问题phpForbiddenYou donthave permissionto access/phpMyAdmin/index.php onthis server.出现这种情况请将apache的httpd工onf打开,将Directory/Options FollowSymLinksAllowOverrideNoneOrder deny,allowDeny fromall/Directory修改为Directory/Options FollowSymLinksAllowOverrideNoneOrder deny,allow Denyfrom None/Directory就可以了安装之后,生成的文件中自动记录了部分本地配置信息,M edi aWiki Loc alSetting s.php多数的参数设置改变,需要手动修改该文件,对这个文件所做的手动修改需要记录me diawi ki一下,以便日后升级时重建这些设置,为安全起见,请留意设置访问权限以LocalSettin gs.php禁止他人查看内容,这里介绍的都是些基本的设置默认为,禁止通过浏览器界面上传文件如需上传图片,请•$wgD isab1eU ploads:tr ue改为同时(通过工具等方式)将上传目录设置为允许网络写入false,FTP(1o
5.x之后,该选项变为$wgEnab1eUp1o ad s先把前面的#去掉;和旧版本相反是允许上传,是禁止通过浏览器界面上传文件)tr uefa Ise•$wgU se ImageResi ze如果需要支持运行中改变图片大小(例如thumbnail缩略图功能),请设为t rue.:如果软件运行正常,请将本变量设为同时,•$w gUselmageMagic kIma g eMagick true,请确认变量指向服务器运行命令的正确$wglm ageM agickConve rtComma nd convert位置启用M ediawiki的图片上传功能设置文件夹为可写
1.images在配置文件中找到
2.Local Setti ngs.php。
个人认证
优秀文档
获得点赞 0