1使用yum安裝LAMP環境,關閉防火牆和selinux,便於順利測試:php
systemctl status firewalld systemctl stop firewalld systemctl disable firewalld
2配置MariaDB yum源安裝Http和MariaDB:
vim /etc/yum.repos.d/Mariadb.repo(空文件裏輸入)mysql
[mariadb] name = MariaDB baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64 gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1
3yum clean allyum makecache all
4安裝httpd和mariadb數據庫:yum install httpd mariadb-server mariadb
5vim /etc/httpd/conf/httpd.conf
linux
DocumentRoot "/var/www" <Directory "/var/www"> <Directory "/var/www">
6啓動httpd服務和mariadb服務web
systemctl enable mariadb systemctl enable httpd systemctl start httpd systemctl start mariadb
7進入數據庫建立數據庫:mysql -u root -predis
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; MariaDB [(none)]> show databases; MariaDB [(none)]> SHOW GRANTS FOR 'wiki'@'localhost';
8安裝PHP7.0sql
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
9配置mediawikimongodb
cd /home wget http://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.0.tar.gz cd /var/www tar -zxf /home/mediawiki-1.31.0.tar.gz ln -s mediawiki-1.31.0/ mediawiki chown -R apache:apache /var/www/mediawiki-1.31.0 systemctl restart htt ```pd # 安裝mediawiki 打開瀏覽器輸入http://ip地址/mediawiki/index.php 開始初始化設置 1選擇語言版本字庫版本 ![](https://s1.51cto.com/images/blog/201908/07/269fbba09f5e8a7dc65f6f369dbe399f.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 2選擇數據庫類型,這裏選擇MySQL ![](https://s1.51cto.com/images/blog/201908/07/b8b1eaede8274b8bb3a434c8b3c2e7d8.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 3設置數據庫名稱和資料庫名稱 ![](https://s1.51cto.com/images/blog/201908/07/7d731c063c4884aba02a97711811c2cc.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 4選擇數據庫引擎爲InnoDB ![](https://s1.51cto.com/images/blog/201908/07/75fbe2578e12b60f685df4a5260c11dc.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 5設置全局名稱和添加管理員 6開始安裝mediawiki