Linux安装MediaWiki

参照:http://blog.csdn.net/hualichenxi123/article/details/7709547

上面的文章是手动编译安装,比较麻烦,易出现不兼容问题,所以决定使用yum安装。

查看linux系统版本,确定版本后安装相应的yum库

[root@test-1 ~]# cat /etc/issueRed Hat Enterprise Linux Server release 5.9 (Tikanga)2.6.18-348.el5[root@test-1 ~]# lsb_release -aLSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarchDistributor ID: RedHatEnterpriseServerDescription:    Red Hat Enterprise Linux Server release 5.9 (Tikanga)Release:        5.9[root@test-1 ~]# uname -a #系统位数Linux test-1 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
安装对应系统的依赖库 从上得知 linux版本 Red Hat Enterprise Linux Server release 5.9 64位访问:http://packages.sw.be/rpmforge-release/,找到相应的安装包。
[root@test-1 ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm[root@test-1 ~]# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

安装libxml2 由于使用的是red hat 企业版 ,所以已经安装,但还是列出安装方法。yum 安装如下:

[root@test-1 ~]#yum -y install libxml2

手动安装基本操作类似如下:

[root@slave1 ~]# wget http://xmlsoft.org/sources/old/libxml2-2.6.26.tar.gz[root@slave1 opt]# tar xvf libxml2-2.6.26.tar.gz[root@slave1 opt]# cd libxml2-2.6.26[root@slave1 libxml2-2.6.26]# ./configure --prefix=/usr/local/libxml2/[root@slave1 libxml2-2.6.26]# make[root@slave1 libxml2-2.6.26]# make install如果安装失败使用命令[root@slave1 libxml2-2.6.26]# make uninstall

安装apache 由于使用的是red hat 企业版 ,所以已经安装,但还是列出手动安装方法。

http://httpd.apache.org/download.cgi[root@slave1 opt]# tar xvf httpd-2.0.64.tar.gz[root@slave1 opt]# cd httpd-2.0.64[root@slave1 httpd-2.0.64]# ./configure --prefix=/usr/local/apache2[root@slave1 httpd-2.0.64]# make[root@slave1 httpd-2.0.64]#  make install启动apache:  [root@slave1 httpd-2.0.64]# /usr/local/apache2/bin/apachectl startIE访问http://ip/,出现”It works!”,apache安装成功。如果安装失败使用命令[root@slave1 libxml2-2.6.26]# make uninstall

mysql 安装参看文章,下载rpm包,解压后安装

http://blog.csdn.net/huoyunshen88/article/details/18702405[root@slave1 opt]# tar xvf MySQL-5.6.15-1.linux_glibc2.5.i386.rpm-bundle.tarMySQL-shared-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-test-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-shared-compat-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-embedded-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-server-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-client-5.6.15-1.linux_glibc2.5.i386.rpmMySQL-devel-5.6.15-1.linux_glibc2.5.i386.rpm

安装配置PHP,之前手动安装出现好多问题,为了简单安装使用yum安装,高效,找个可以直接使用的yum库下载安装,如果实在不行就得手动配置yum库。参考:http://wanglu132.iteye.com/blog/1671955 下面是有php安装包的库:

[root@test-1 ~]# rpm -qa | grep php[root@test-1 ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm[root@test-1 ~]# rpm -ivh epel-release-5-4.noarch.rpm[root@test-1 ~]# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm[root@test-1 ~]# rpm -ivh remi-release-5.rpm 

如果找不到yum 库的rpm包,可以找个可以下载php安装包的地址,http://nl.repo.webtatic.com/yum/el5/x86_64/ 配置yum 库,

[root@test-1 yum.repos.d]# cat /etc/yum.repos.d/rhel-rpm.repo添加如下内容:[dmap-yum]name=bsdmap-yumbaseurl=http://us-east.repo.webtatic.com/yum/el5/x86_64/enabled=1gpgcheck=0gpgkey=

配置php:修改apache配置文件httpd.conf

# vi /etc/httpd/conf/httpd.conf  在#AddType application/x-tar.tgz下加一行:  AddType application/x-httpd-php .php  在#LoadModule foo_module modules/mod_foo.so下加一行: 如果原来有就去掉#号  LoadModule php5_module  modules/libphp5.so  找到DirectoryIndex index.html在后面添加 index.php  保存httpd.conf文件.  [root@test-1 yum.repos.d]# yum list | grep phpyum -y install php54w-common.x86_64 php54w.x86_64 php54w-cli.x86_64 php54w-devel.x86_64 php54w-gd.x86_64 php54w-embedded.x86_64 php54w-mysql.x86_64 php54w-pear.noarch php54w-xml.x86_64

下载安装wiki:

[root@test-1 html]# wget http://dumps.wikimedia.org/mediawiki/1.9/mediawiki-1.9.6.tar.gztar -xzvf mediawiki-1.9.6.tar.gz[root@test-1 wiki]# mv mediawiki-1.9.6 wiki[root@test-1 wiki]# service httpd restart

解压,进入wiki目录修改权限。

[root@test-1 wiki]# chmod 777 config/

配置wiki时发现了错误,是php页面中使用了php的关键字,这是php版本过高导致的结果:参考:http://jesus.tw/Fixing_Mediawiki_1.6_when_upgrading_PHP_from_5.2_to_5.3替换 keyword Namespace Replace with MWNamespace结果替换后还是有问题,分析是不是httpd的问题,并重新安装了php,从php5.9 换成了 php5.4。结果还是不行,最终还是换wiki的版本试试,结果好了。

[root@test-1 html]# wget http://dumps.wikimedia.org/mediawiki/1.17/mediawiki-1.17.5.tar.gz[root@test-1 html]# tar -xvf mediawiki-1.17.5.tar.gz

比天才难得,许多天赋差的人经过过勤学苦练也取得了很大的成功。

Linux安装MediaWiki

相关文章:

你感兴趣的文章:

标签云: