前言:
mediawiki运行环境要求:MediaWiki requires PHP 5.5.9+ and either MySQL 5.0.2+, MariaDB,
一、环境搭建
CentOS7 开始。mysql替换成了mariadb,并删除了安装源
mysql安装见::entOS7 安装 MySQL
CentOS7 自带的php版本为5.4,低于mediawiki要求的5.6,
PHP升级:CentOS7 升级 PHP7
至此,centos7.0的lamp环境搭建完毕
二、配置环境
1.systemctl enable httpd
1.systemctl start httpd
1.[root@localhost ~]# mysql -u root -p
2.Enter password:
3.Welcome to the MySQL monitor. Commands end with ; or \g.
4.Your MySQL connection id is 7
5.Server version: 5.7.19 MySQL Community Server (GPL)
6.Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
7.Oracle is a registered trademark of Oracle Corporation and/or its
8.affiliates. Other names may be trademarks of their respective
9.owners.
10.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
11.mysql> create database wiki; 创建数据库wiki
12.Query OK, 1 row affected (0.00 sec)
13.mysql> create user wikiuser@'localhost' identified by '775120@Lai'; 创建账户wikiuser并设置账号:775120@Lai
14.Query OK, 0 rows affected (0.00 sec)
15.mysql> grant index, create, select, insert, update, delete, alter, lock tables on wiki.* to wikiuser@localhost; 为wikiuser授权
16.Query OK, 0 rows affected (0.00 sec)
17.
三、下载部署mediawiki
1.wget https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz
2.[lcr@centos-2 ~]$ wget https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz
3.--2017-09-05 21:07:35-- https://releases.wikimedia.org/mediawiki/1.29/mediawiki-1.29.0.tar.gz
4.正在解析主机 releases.wikimedia.org (releases.wikimedia.org)... 208.80.153.248, 2620:0:860:ed1a::3:d
5.正在连接 releases.wikimedia.org (releases.wikimedia.org)|208.80.153.248|:443... 已连接。
6.已发出 HTTP 请求,正在等待回应... 200 OK
7.长度:39597052 (38M) [application/x-gzip]
8.正在保存至: “mediawiki-1.29.0.tar.gz”
9.100%[======================================>] 39,597,052 965KB/s 用时 46s
10.2017-09-05 21:08:23 (835 KB/s) - 已保存 “mediawiki-1.29.0.tar.gz” [39597052/39597052])
1.tar -xzvf mediawiki-1.29.0.tar.gz
1.[root@centos-2 lcr]# mv mediawiki-1.29.0 /var/www//html/
2.[root@centos-2 lcr]# cd /var/www/html/
3.[root@centos-2 html]# ls
4.info.php mediawiki-1.29.0
5.[root@centos-2 html]# mv mediawiki-1.29.0/ mediawiki
四、配置mediawiki
可以根据提示,查看缺少的组件
此处不显示mysql
说明缺少php-mysql
补充安装
1.[root@localhost lcr]# yum install php70w-mysql
安装完成之后重启mysql,httpd
1.[root@localhost lcr]# service mysqld restart
2.Redirecting to /bin/systemctl restart mysqld.service
3.[root@localhost lcr]# service httpd restart
4.Redirecting to /bin/systemctl restart httpd.service
刷新网页
选择mysql,填写创建的
数据库名:wiki;
用户名:wikiuser;
密码:775120@Lai
选择数据库引擎innoDB,
字符集选择utf-8
1.[root@localhost lcr]# mv LocalSettings.php /var/www/html/mediawiki/
至此,centos7 LAMP mediawiki安装完毕
点击回到fatcat的主页