搭建MediaWiki服务器

系统信息:
# cat /etc/redhat-release
CentOS release 6.4 (Final)

MediaWiki官网:
http://www.mediawiki.org/wiki/MediaWiki

1.安装所需软件
yum install httpd php php-mysql php-gd mysql-server php-xml mysql

service mysqld start
mysql_secure_installation

2.数据库授权
mysql -u root -p

CREATE DATABASE wikidatabase;
grant all privileges on wikidatabase.* to 'wiki'@'localhost' identified by 'wiki';
flush privileges;

mysql -u wiki -p
SHOW DATABASES;

3.开机自启动
chkconfig httpd on
chkconfig mysqld on

4.拷贝安装文件
cd /var/www/html
tar -zxf /soft/mediawiki-1.23.1.tar.gz
ln -s mediawiki-1.23.1/ mediawiki
chown -R apache:apache /var/www/mediawiki*

5.添加虚拟主机
vim /etc/httpd/conf/httpd.conf
--------------------------------------
DirectoryIndex index.html index.html.var index.php
--------------------------------------

vim /etc/httpd/conf.d/virtual.conf
--------------------------------------

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/var/www/html/mediawiki"
    ServerName  wiki.ncg.com
    ErrorLog "logs/wiki-error_log"
    CustomLog "logs/wiki-access_log" common
</VirtualHost>

--------------------------------------

6.添加主机名
vim /etc/hosts
--------------------------------------

192.168.16.249   wiki.ncg.com

--------------------------------------

7.重启并访问
service httpd restart
http://wiki.ncg.com

8.在浏览器中安装配置

参考:

http://www.mediawiki.org/wiki/Manual:Installation_guide/zh-hans
http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Red_Hat_Linux
http://wiki.linuxdeepin.com/index.php?title=MediaWiki%E5%85%A5%E9%97%A8


你可能感兴趣的:(apache,mysql,centos,mediawiki)