1、关闭防火墙和selinux,便于顺利测试
systemctl stop firewalld
setenforce 0
2、使用yum安装LAMP环境
安装httpd和mariadb数据库:
yum install httpd mariadb-server mariadb
编辑配置文件
vim /etc/httpd/conf/httpd.conf
DocumentRoot “/var/www”
<Directory “/var/www”>
<Directory “/var/www”>
如下图
3、启动httpd服务和mariadb服务永久生效
systemctl enable mariadb
systemctl enable httpd
systemctl start httpd
systemctl start mariadb
4、 .进入数据库创建数据库:mysql -u root –p
直接回车进入
MariaDB [(none)]> CREATE USER wiki
@‘’localhost‘IDENTIFIED BY ‘123’;
MariaDB [(none)]> CREATE DATABASE wikidatabase;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wikidatabase.* TO wiki
@localhost
;
MariaDB [(none)]> FLUSH PRIVILEGES;
5、安装PHP7.0以上版本
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install -y php71w-fpm php71w-opcache php71w-cli php71w-gd php71w-imap php71w-mysqlnd php71w-mbstring php71w-mcrypt php71w-pdo php71w-pecl-apcu php71w-pecl-mongodb php71w-pecl-redis php71w-pgsql php71w-xml php71w-xmlrpc php71w-devel mod_php71w php71w-ldap
6、 配置mediawiki
wget http://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.0.tar.gz
tar -zxvf mediawiki-1.31.0.tar.gz -C /var/www
cd /var/www
ln -s mediawiki-1.31.0/ mediawiki
chown -R apache:apache /var/www/mediawiki-1.31.0
systemctl restart httpd
7、打开浏览器输入http://自己ip/mediawiki/index.php 开始初始化设置
将下载好的文件放到mediawiki目录下,再次登录即可