How to install mediawiki on centos 6

How to install mediawiki on centos 6

Links to below you maybe likes:
How to install php7 on centos 6
How to install and configure redmine on centos 6
How to owncloud 9 install ssl certificate centos 7
How To Install the BIND DNS Server on CentOS 6
KeepAlived IP Failover on CentOS & Red Hat

How to install mediawiki on centos 6
To require

  • nginx
  • php
  • MySQL

Step 1: To update and install epel repo, ntpd
#yum update -y
#yum install -y epel-release
#yum install -y ntp
#chkconfig ntpd on
#ntpdate pool.ntp.org
#service ntpd start

Step 2: To install the dependencies

#yum install gd sendmail gcc pcre yum-utils wget

Step 3: To install php7 for nginx remi centos 6

Step 4: To install ImageMagick

#yum install php-mbstring php-fpm php-devel php-mysql php-pear ImageMagick ImageMagick-devel --enablerepo=remi-php70
#pecl install imagick
#echo "extension=imagick.so" > /etc/php.d/imagick.in
Step 5: To enable module php-mbstring for nginx

#find / -name mbstring.so
The result
/opt/remi/php70/root/usr/lib64/php/modules/mbstring.so

#vim /etc/php.ini
The result
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
extension=/opt/remi/php70/root/usr/lib64/php/modules/mbstring.so
[mbstring]
mbstring.language = all
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = UTF-8
mbstring.substitute_character = none
mbstring.func_overload = 0
mbstring.strict_detection = Off

Step 6: To install and create account in mysql

#yum install mysql-server
mysql -u root -p
CREATE DATABASE wikidb;
GRANT ALL PRIVILEGES ON wikidb.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;
Step 7: To download mediawiki
#cd /usr/share/nginx
#wget -qO- https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.1.tar.gz | tar xvz

Step 8: To install and configure nginx for mediawiki

#yum install nginx 

To configure nginx for mediawiki

server {
    listen 8080;
    server_name wiki.nginx.org;
    root /usr/share/nginx/mediawiki;
    index index.php index.html index.htm;
    autoindex off;
    client_max_body_size 5m;
    client_body_timeout 60;
    location / {
        try_files $uri $uri/ =404;
    }
    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
    location ~ \.php$ {
        root /usr/share/nginx/mediawiki;
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }
    location ^~ /maintenance/ {
        return 403;
    }
        location /mw-config {
                return 403;
        }
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        try_files $uri /index.php;
        expires max;
        log_not_found off;
    }
  location = /_.gif {
        expires max;
        empty_gif;
    }
    location ^~ /cache/ {
        deny all;
    }
}
To restart services and auto startup the system.
#service nginx start
#chkconfig nginx on
#service mysql start
#chkconfig mysql on
#service php-fpm start

To iptables firewall allow port 80 and 443 on server mediawiki.
To type http://ip-address on brower
The after install the done, then you download  LocalSettings.php file to copy to  /mediawiki folder.

In some error during install, the solved problem:
No package imagemagick available.
  * Maybe you meant: ImageMagick
No package tex available.
No package scribunto available
LocalSettings.php not found.

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6