最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】在Centos 7中安装自己的维基百科MediaWiki

MediaWiki crifan 7591浏览 0评论

【背景】

很早之前就想要去折腾,弄一个类似于

https://www.wikipedia.org/

一样的,自己的维基百科。

 

【折腾过程】

1.搜:

centos 7 mediawiki

参考相关资料:

centos安装mediawiki – 夜空

MediaWiki

Manual:Installation guide – MediaWiki

Manual:Installation requirements – MediaWiki

Download – MediaWiki

Manual:Installing MediaWiki – MediaWiki

How To Install MediaWiki on CentOS 7 | DigitalOcean

2.去安装一堆的php的库,并重启apache:

1
2
3
4
5
6
sudo yum install php-xml
sudo yum install php-intl
sudo yum install php-gd
sudo yum install texlive
sudo yum install php-xcache
sudo systemctl restart httpd

安装之后,php的模块有:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
crifan@crifan:~$ php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
libxml
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
XCache
XCache Cacher
XCache Coverager
XCache Optimizer
xml
xmlreader
xmlwriter
xsl
zip
zlib
 
[Zend Modules]
XCache
XCache Cacher
XCache Coverager
XCache Optimizer
 
crifan@crifan:~$

 

下载MediaWiki

3.接着去下载最新版本的MediaWiki:

Download – MediaWiki

MediaWiki 1.25.1 (download) – stable

结果遇到了个问题:

【未解决】Firefox下载文件出错:无法保存,因为无法读取源文件

然后用迅雷下载好的。

不过才发现,原来是应该在CentOS上去下载的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
crifan@crifan:~$ curl --help
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only
     --anyauth       Pick "any" authentication method (H)
 -a, --append        Append to target file when uploading (F/SFTP)
     --basic         Use HTTP Basic Authentication (H)
     --cacert FILE   CA certificate to verify peer against (SSL)
     --capath DIR    CA directory to verify peer against (SSL)
 -E, --cert CERT[:PASSWD] Client certificate file and password (SSL)
     --cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)
     --ciphers LIST  SSL ciphers to use (SSL)
     --compressed    Request compressed response (using deflate or gzip)
 -K, --config FILE   Specify which config file to read
     --connect-timeout SECONDS  Maximum time allowed for connection
 -C, --continue-at OFFSET  Resumed transfer offset
 -b, --cookie STRING/FILE  String or file to read cookies from (H)
 -c, --cookie-jar FILE  Write cookies to this file after operation (H)
     --create-dirs   Create necessary local directory hierarchy
     --crlf          Convert LF to CRLF in upload
     --crlfile FILE  Get a CRL list in PEM format from the given file
 -d, --data DATA     HTTP POST data (H)
     --data-ascii DATA  HTTP POST ASCII data (H)
     --data-binary DATA  HTTP POST binary data (H)
     --data-urlencode DATA  HTTP POST data url encoded (H)
     --delegation STRING GSS-API delegation permission
     --digest        Use HTTP Digest Authentication (H)
     --disable-eprt  Inhibit using EPRT or LPRT (F)
     --disable-epsv  Inhibit using EPSV (F)
 -D, --dump-header FILE  Write the headers to this file
     --egd-file FILE  EGD socket path for random data (SSL)
     --engine ENGINGE  Crypto engine (SSL). "--engine list" for list
 -f, --fail          Fail silently (no output at all) on HTTP errors (H)
 -F, --form CONTENT  Specify HTTP multipart POST data (H)
     --form-string STRING  Specify HTTP multipart POST data (H)
     --ftp-account DATA  Account data string (F)
     --ftp-alternative-to-user COMMAND  String to replace "USER [name]" (F)
     --ftp-create-dirs  Create the remote dirs if not present (F)
     --ftp-method [MULTICWD/NOCWD/SINGLECWD] Control CWD usage (F)
     --ftp-pasv      Use PASV/EPSV instead of PORT (F)
 -P, --ftp-port ADR  Use PORT with given address instead of PASV (F)
     --ftp-skip-pasv-ip Skip the IP address for PASV (F)
     --ftp-pret      Send PRET before PASV (for drftpd) (F)
     --ftp-ssl-ccc   Send CCC after authenticating (F)
     --ftp-ssl-ccc-mode ACTIVE/PASSIVE  Set CCC mode (F)
     --ftp-ssl-control Require SSL/TLS for ftp login, clear for transfer (F)
 -G, --get           Send the -d data with a HTTP GET (H)
 -g, --globoff       Disable URL sequences and ranges using {} and []
 -H, --header LINE   Custom header to pass to server (H)
 -I, --head          Show document info only
 -h, --help          This help text
     --hostpubmd5 MD5  Hex encoded MD5 string of the host public key. (SSH)
 -0, --http1.0       Use HTTP 1.0 (H)
     --ignore-content-length  Ignore the HTTP Content-Length header
 -i, --include       Include protocol headers in the output (H/F)
 -k, --insecure      Allow connections to SSL sites without certs (H)
     --interface INTERFACE  Specify network interface/address to use
 -4, --ipv4          Resolve name to IPv4 address
 -6, --ipv6          Resolve name to IPv6 address
 -j, --junk-session-cookies Ignore session cookies read from file (H)
     --keepalive-time SECONDS  Interval between keepalive probes
     --key KEY       Private key file name (SSL/SSH)
     --key-type TYPE Private key file type (DER/PEM/ENG) (SSL)
     --krb LEVEL     Enable Kerberos with specified security level (F)
     --libcurl FILE  Dump libcurl equivalent code of this command line
     --limit-rate RATE  Limit transfer speed to this rate
 -l, --list-only     List only names of an FTP directory (F)
     --local-port RANGE  Force use of these local port numbers
 -L, --location      Follow redirects (H)
     --location-trusted like --location and send auth to other hosts (H)
 -M, --manual        Display the full manual
     --mail-from FROM  Mail from this address
     --mail-rcpt TO  Mail to this receiver(s)
     --mail-auth AUTH  Originator address of the original email
     --max-filesize BYTES  Maximum file size to download (H/F)
     --max-redirs NUM  Maximum number of redirects allowed (H)
 -m, --max-time SECONDS  Maximum time allowed for the transfer
     --metalink      Process given URLs as metalink XML file
     --negotiate     Use HTTP Negotiate Authentication (H)
 -n, --netrc         Must read .netrc for user name and password
     --netrc-optional Use either .netrc or URL; overrides -n
     --netrc-file FILE  Set up the netrc filename to use
 -N, --no-buffer     Disable buffering of the output stream
     --no-keepalive  Disable keepalive use on the connection
     --no-sessionid  Disable SSL session-ID reusing (SSL)
     --noproxy       List of hosts which do not use proxy
     --ntlm          Use HTTP NTLM authentication (H)
 -o, --output FILE   Write output to <file> instead of stdout
     --pass PASS     Pass phrase for the private key (SSL/SSH)
     --post301       Do not switch to GET after following a 301 redirect (H)
     --post302       Do not switch to GET after following a 302 redirect (H)
     --post303       Do not switch to GET after following a 303 redirect (H)
 -#, --progress-bar  Display transfer progress as a progress bar
     --proto PROTOCOLS  Enable/disable specified protocols
     --proto-redir PROTOCOLS  Enable/disable specified protocols on redirect
 -x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port
     --proxy-anyauth Pick "any" proxy authentication method (H)
     --proxy-basic   Use Basic authentication on the proxy (H)
     --proxy-digest  Use Digest authentication on the proxy (H)
     --proxy-negotiate Use Negotiate authentication on the proxy (H)
     --proxy-ntlm    Use NTLM authentication on the proxy (H)
 -U, --proxy-user USER[:PASSWORD]  Proxy user and password
     --proxy1.0 HOST[:PORT]  Use HTTP/1.0 proxy on given port
 -p, --proxytunnel   Operate through a HTTP proxy tunnel (using CONNECT)
     --pubkey KEY    Public key file name (SSH)
 -Q, --quote CMD     Send command(s) to server before transfer (F/SFTP)
     --random-file FILE  File for reading random data from (SSL)
 -r, --range RANGE   Retrieve only the bytes within a range
     --raw           Do HTTP "raw", without any transfer decoding (H)
 -e, --referer       Referer URL (H)
 -J, --remote-header-name Use the header-provided filename (H)
 -O, --remote-name   Write output to a file named as the remote file
     --remote-name-all Use the remote file name for all URLs
 -R, --remote-time   Set the remote file's time on the local output
 -X, --request COMMAND  Specify request command to use
     --resolve HOST:PORT:ADDRESS  Force resolve of HOST:PORT to ADDRESS
     --retry NUM   Retry request NUM times if transient problems occur
     --retry-delay SECONDS When retrying, wait this many seconds between each
     --retry-max-time SECONDS  Retry only within this period
 -S, --show-error    Show error. With -s, make curl show errors when they occur
 -s, --silent        Silent mode. Don't output anything
     --socks4 HOST[:PORT]  SOCKS4 proxy on given host + port
     --socks4a HOST[:PORT]  SOCKS4a proxy on given host + port
     --socks5 HOST[:PORT]  SOCKS5 proxy on given host + port
     --socks5-hostname HOST[:PORT] SOCKS5 proxy, pass host name to proxy
     --socks5-gssapi-service NAME  SOCKS5 proxy service name for gssapi
     --socks5-gssapi-nec  Compatibility with NEC SOCKS5 server
 -Y, --speed-limit RATE  Stop transfers below speed-limit for 'speed-time' secs
 -y, --speed-time SECONDS  Time for trig speed-limit abort. Defaults to 30
     --ssl           Try SSL/TLS (FTP, IMAP, POP3, SMTP)
     --ssl-reqd      Require SSL/TLS (FTP, IMAP, POP3, SMTP)
 -2, --sslv2         Use SSLv2 (SSL)
 -3, --sslv3         Use SSLv3 (SSL)
     --ssl-allow-beast Allow security flaw to improve interop (SSL)
     --stderr FILE   Where to redirect stderr. - means stdout
     --tcp-nodelay   Use the TCP_NODELAY option
 -t, --telnet-option OPT=VAL  Set telnet option
     --tftp-blksize VALUE  Set TFTP BLKSIZE option (must be >512)
 -z, --time-cond TIME  Transfer based on a time condition
 -1, --tlsv1         Use => TLSv1 (SSL)
     --tlsv1.0       Use TLSv1.0 (SSL)
     --tlsv1.1       Use TLSv1.1 (SSL)
     --tlsv1.2       Use TLSv1.2 (SSL)
     --trace FILE    Write a debug trace to the given file
     --trace-ascii FILE  Like --trace but without the hex output
     --trace-time    Add time stamps to trace/verbose output
     --tr-encoding   Request compressed transfer encoding (H)
 -T, --upload-file FILE  Transfer FILE to destination
     --url URL       URL to work with
 -B, --use-ascii     Use ASCII/text transfer
 -u, --user USER[:PASSWORD]  Server user and password
     --tlsuser USER  TLS username
     --tlspassword STRING TLS password
     --tlsauthtype STRING  TLS authentication type (default SRP)
 -A, --user-agent STRING  User-Agent to send to server (H)
 -v, --verbose       Make the operation more talkative
 -V, --version       Show version number and quit
 -w, --write-out FORMAT  What to output after completion
     --xattr        Store metadata in extended file attributes
 -q                 If used as the first parameter disables .curlrc
crifan@crifan:~$ curl -O http://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.1.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.7M  100 19.7M    0     0   180k      0  0:01:51  0:01:51 --:--:--  746k

然后解压,移动到对应的位置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
tar xvzf mediawiki-1.24.1.tar.gz
 
crifan@crifan:~$ ls -l
total 20316
drwxrwxr-x  2 crifan crifan     4096 May 16 23:08 cpanel
-rw-r--r--  1 crifan crifan    11909 May 16 10:08 httpd.conf.backup
drwxr-xr-x 13 crifan crifan     4096 Dec 18  2014 mediawiki-1.24.1
-rw-rw-r--  1 crifan crifan 20725572 Jul 23 09:09 mediawiki-1.24.1.tar.gz
-rw-r--r--  1 crifan crifan      570 May 16 14:42 my.conf.backup-20150516
-rw-rw-r--  1 crifan crifan    47679 May 25 10:07 mysqltuner.pl
crifan@crifan:~$ cd mediawiki-1.24.1
crifan@crifan:mediawiki-1.24.1$ ls -l
total 928
-rw-r--r--  1 crifan crifan   4556 Dec 18  2014 api.php
-rw-r--r--  1 crifan crifan    933 Dec 18  2014 api.php5
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 cache
-rw-r--r--  1 crifan crifan    749 Dec 18  2014 composer.json
-rw-r--r--  1 crifan crifan  19419 Dec 18  2014 COPYING
-rw-r--r--  1 crifan crifan   4032 Dec 18  2014 CREDITS
drwxr-xr-x  8 crifan crifan   4096 Dec 18  2014 docs
drwxr-xr-x 17 crifan crifan   4096 Dec 18  2014 extensions
-rw-r--r--  1 crifan crifan     77 Dec 18  2014 FAQ
-rw-r--r--  1 crifan crifan 686760 Dec 18  2014 HISTORY
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 images
-rw-r--r--  1 crifan crifan   7528 Dec 18  2014 img_auth.php
-rw-r--r--  1 crifan crifan    943 Dec 18  2014 img_auth.php5
drwxr-xr-x 50 crifan crifan   4096 Dec 18  2014 includes
-rw-r--r--  1 crifan crifan   1754 Dec 18  2014 index.php
-rw-r--r--  1 crifan crifan    937 Dec 18  2014 index.php5
-rw-r--r--  1 crifan crifan   3635 Dec 18  2014 INSTALL
drwxr-xr-x  7 crifan crifan   4096 Dec 18  2014 languages
-rw-r--r--  1 crifan crifan   1825 Dec 18  2014 load.php
-rw-r--r--  1 crifan crifan    935 Dec 18  2014 load.php5
drwxr-xr-x 17 crifan crifan  12288 Dec 18  2014 maintenance
drwxr-xr-x  3 crifan crifan   4096 Dec 18  2014 mw-config
-rw-r--r--  1 crifan crifan   3852 Dec 18  2014 opensearch_desc.php
-rw-r--r--  1 crifan crifan    957 Dec 18  2014 opensearch_desc.php5
-rw-r--r--  1 crifan crifan  11726 Dec 18  2014 profileinfo.php
-rw-r--r--  1 crifan crifan    949 Dec 18  2014 profileinfo.php5
-rw-r--r--  1 crifan crifan   1482 Dec 18  2014 README
lrwxrwxrwx  1 crifan crifan      6 Dec 18  2014 README.mediawiki -> README
-rw-r--r--  1 crifan crifan  43328 Dec 18  2014 RELEASE-NOTES-1.24
drwxr-xr-x  5 crifan crifan   4096 Dec 18  2014 resources
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 serialized
drwxr-xr-x  6 crifan crifan   4096 Dec 18  2014 skins
-rw-r--r--  1 crifan crifan    734 Dec 18  2014 StartProfiler.sample
-rw-r--r--  1 crifan crifan   1087 Dec 18  2014 thumb_handler.php
-rw-r--r--  1 crifan crifan    971 Dec 18  2014 thumb_handler.php5
-rw-r--r--  1 crifan crifan  22024 Dec 18  2014 thumb.php
-rw-r--r--  1 crifan crifan    955 Dec 18  2014 thumb.php5
-rw-r--r--  1 crifan crifan  11827 Dec 18  2014 UPGRADE
-rw-r--r--  1 crifan crifan     98 Dec 18  2014 wiki.phtml
crifan@crifan:mediawiki-1.24.1$ cd ..
crifan@crifan:~$ ls /var/www/
backups/    cgi-bin/    crifan.com/ html/      
crifan@crifan:~$ ls /var/www/
backups/    cgi-bin/    crifan.com/ html/      
crifan@crifan:~$ ls /var/www/crifan.com/
.htaccess    .htpasswd    logs/        public_html/
crifan@crifan:~$ ls /var/www/crifan.com/public_html/
400.shtml                    files/                       sql/                         wp-links-opml.php
401.shtml                    google978bf639ea5c3645.html  uploads/                     wp-load.php
403.shtml                    .htaccess                    wp-activate.php              wp-login.php
404.shtml                    index.php                    wp-admin/                    wp-mail.php
500.php                      info.php                     wp-blog-header.php           wp-pass.php
500.shtml                    license.txt                  wp-comments-post.php         wp-register.php
adsense.txt                  php.ini                      wp-config.php                wp-settings.php
cgi-bin/                     readme.html                  wp-config-sample.php         wp-signup.php
crifan_com_20150513.zip      released/                    wp-content/                  wp-trackback.php
error_log                    sitemap.xml                  wp-cron.php                  xmlrpc.php
favicon.ico                  sitemap.xml.gz               wp-includes/                
crifan@crifan:~$ cd /var/www/crifan.com/public_html/
crifan@crifan:public_html$ ls -l
total 2520800
-rw-rw-rw-  1 crifan crifan        613 Oct 18  2014 400.shtml
-rw-rw-rw-  1 crifan crifan        162 Oct 18  2014 401.shtml
-rw-rw-rw-  1 crifan crifan        201 Oct 18  2014 403.shtml
-rw-rw-rw-  1 crifan crifan         83 Oct 18  2014 404.shtml
-rw-rw-rw-  1 crifan crifan        363 Oct 18  2014 500.php
-rw-rw-rw-  1 crifan crifan         71 Oct 18  2014 500.shtml
-rw-rw-rw-  1 crifan crifan        121 Oct 18  2014 adsense.txt
drwxrwxrwx  2 crifan crifan       4096 Jan  8  2015 cgi-bin
-rw-rw-rw-  1 www    www    2579333662 May 13 06:07 crifan_com_20150513.zip
-rw-rw-rw-  1 crifan crifan     835112 May  7 11:08 error_log
-rw-rw-rw-  1 crifan crifan       1057 Oct 18  2014 favicon.ico
drwxrwxrwx  9 crifan crifan       4096 Jan 30 20:48 files
-rw-rw-rw-  1 crifan crifan         53 Oct 18  2014 google978bf639ea5c3645.html
-rw-rw-rw-  1 crifan crifan        418 Feb  1 20:48 index.php
-rwxrwxrwx  1 www    root           24 May 16 15:56 info.php
-rw-rw-rw-  1 crifan crifan      19930 Feb 19 07:43 license.txt
-rw-rw-rw-  1 crifan crifan      40506 Oct 18  2014 php.ini
-rw-rw-rw-  1 crifan crifan       6575 May 24 14:00 readme.html
drwxrwxrwx  4 crifan crifan       4096 Dec 27  2014 released
-rw-rw-rw-  1 crifan crifan     642240 Jan 10  2015 sitemap.xml
-rw-rw-rw-  1 crifan crifan     184320 Jan 10  2015 sitemap.xml.gz
drwxrwxrwx  2 www    www          4096 May 23 08:47 sql
drwxrwxrwx  4 crifan crifan       4096 Oct 20  2014 uploads
-rw-rw-rw-  1 crifan crifan       4951 Feb  1 20:48 wp-activate.php
drwxrwxrwx 10 crifan crifan       4096 Jul 11 17:02 wp-admin
-rw-rw-rw-  1 crifan crifan        271 Feb  1 20:48 wp-blog-header.php
-rw-rw-rw-  1 crifan crifan       5007 Apr 25 00:57 wp-comments-post.php
-rw-rw-rw-  1 crifan crifan       3643 Jul 11 17:02 wp-config.php
-rw-rw-rw-  1 crifan crifan       2898 Feb  1 20:48 wp-config-sample.php
drwxrwxrwx 10 crifan crifan       4096 Jul 20 11:01 wp-content
-rw-rw-rw-  1 crifan crifan       3115 Apr 25 00:57 wp-cron.php
drwxrwxrwx 12 crifan crifan       4096 Feb  1 20:48 wp-includes
-rw-rw-rw-  1 crifan crifan       2380 Feb  1 20:48 wp-links-opml.php
-rw-rw-rw-  1 crifan crifan       3123 Apr 25 00:57 wp-load.php
-rw-rw-rw-  1 crifan crifan      34241 Apr 25 00:57 wp-login.php
-rw-rw-rw-  1 crifan crifan       8252 Feb  1 20:48 wp-mail.php
-rw-rw-rw-  1 crifan crifan        413 Oct 18  2014 wp-pass.php
-rw-rw-rw-  1 crifan crifan        334 Oct 18  2014 wp-register.php
-rw-rw-rw-  1 crifan crifan      11048 Apr 25 00:57 wp-settings.php
-rw-rw-rw-  1 crifan crifan      25152 Feb  1 20:48 wp-signup.php
-rw-rw-rw-  1 crifan crifan       4035 Feb  1 20:48 wp-trackback.php
-rw-rw-rw-  1 crifan crifan       3032 Feb  1 20:48 xmlrpc.php
crifan@crifan:public_html$ mkdir wiki
crifan@crifan:public_html$ mv /home/crifan/mediawiki-1.24.1/* wiki/
crifan@crifan:public_html$ ls /home/crifan/mediawiki-1.24.1 -l
total 0
crifan@crifan:public_html$ ls wiki/ -l
total 928
-rw-r--r--  1 crifan crifan   4556 Dec 18  2014 api.php
-rw-r--r--  1 crifan crifan    933 Dec 18  2014 api.php5
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 cache
-rw-r--r--  1 crifan crifan    749 Dec 18  2014 composer.json
-rw-r--r--  1 crifan crifan  19419 Dec 18  2014 COPYING
-rw-r--r--  1 crifan crifan   4032 Dec 18  2014 CREDITS
drwxr-xr-x  8 crifan crifan   4096 Dec 18  2014 docs
drwxr-xr-x 17 crifan crifan   4096 Dec 18  2014 extensions
-rw-r--r--  1 crifan crifan     77 Dec 18  2014 FAQ
-rw-r--r--  1 crifan crifan 686760 Dec 18  2014 HISTORY
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 images
-rw-r--r--  1 crifan crifan   7528 Dec 18  2014 img_auth.php
-rw-r--r--  1 crifan crifan    943 Dec 18  2014 img_auth.php5
drwxr-xr-x 50 crifan crifan   4096 Dec 18  2014 includes
-rw-r--r--  1 crifan crifan   1754 Dec 18  2014 index.php
-rw-r--r--  1 crifan crifan    937 Dec 18  2014 index.php5
-rw-r--r--  1 crifan crifan   3635 Dec 18  2014 INSTALL
drwxr-xr-x  7 crifan crifan   4096 Dec 18  2014 languages
-rw-r--r--  1 crifan crifan   1825 Dec 18  2014 load.php
-rw-r--r--  1 crifan crifan    935 Dec 18  2014 load.php5
drwxr-xr-x 17 crifan crifan  12288 Dec 18  2014 maintenance
drwxr-xr-x  3 crifan crifan   4096 Dec 18  2014 mw-config
-rw-r--r--  1 crifan crifan   3852 Dec 18  2014 opensearch_desc.php
-rw-r--r--  1 crifan crifan    957 Dec 18  2014 opensearch_desc.php5
-rw-r--r--  1 crifan crifan  11726 Dec 18  2014 profileinfo.php
-rw-r--r--  1 crifan crifan    949 Dec 18  2014 profileinfo.php5
-rw-r--r--  1 crifan crifan   1482 Dec 18  2014 README
lrwxrwxrwx  1 crifan crifan      6 Dec 18  2014 README.mediawiki -> README
-rw-r--r--  1 crifan crifan  43328 Dec 18  2014 RELEASE-NOTES-1.24
drwxr-xr-x  5 crifan crifan   4096 Dec 18  2014 resources
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 serialized
drwxr-xr-x  6 crifan crifan   4096 Dec 18  2014 skins
-rw-r--r--  1 crifan crifan    734 Dec 18  2014 StartProfiler.sample
-rw-r--r--  1 crifan crifan   1087 Dec 18  2014 thumb_handler.php
-rw-r--r--  1 crifan crifan    971 Dec 18  2014 thumb_handler.php5
-rw-r--r--  1 crifan crifan  22024 Dec 18  2014 thumb.php
-rw-r--r--  1 crifan crifan    955 Dec 18  2014 thumb.php5
-rw-r--r--  1 crifan crifan  11827 Dec 18  2014 UPGRADE
-rw-r--r--  1 crifan crifan     98 Dec 18  2014 wiki.phtml
crifan@crifan:public_html$

创建MediaWiki的数据库

4.再去创建对应的数据库:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
crifan@crifan:public_html$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 844170
Server version: 5.5.41-MariaDB-log MariaDB Server
 
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> CREATE DATABASE crifan_wiki;
Query OK, 1 row affected (0.00 sec)
 
MariaDB [(none)]> GRANT INDEX, CREATE, SELECT, INSERT, UPDATE, DELETE, ALTER, LOCK TABLES ON crifan_wiki.* TO 'wiki_user_name_xxx'@'localhost' IDENTIFIED BY 'wiki_user_pwd_xxx';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [(none)]> exit
Bye
crifan@crifan:public_html$

安装MediaWiki

5.然后去设置MediaWiki:

www.crifan.com/wiki/

crifan com wiki mediawiki 1.24.1 main setup page

点击 set up the wiki:

语言设置

mw-config index php config language

环境检查

welcom use mediawiki environment check

 

其中有:

Git版本控制软件未找到

->

难道mediawiki中的数据的版本管理是通过git的?

->

如果是,那么后续还是需要尽快去装git的。

 

连接到数据库

关于数据库的表前缀,参考其他帖子,也是留空的:

How to Install Mediawiki on a CentOS Server with Screenshots

 

mediawiki database mysql localhost name user pwd

 

数据库设置

mediawiki database settings innodb binary mode

名称设置+管理员账号

mediawiki name settings admin and pwd email

 

选项配置

mediawiki user authority license mail skin extension cache

 

 

其中关于扩展程序部分,去研究了每个扩展的功能:

 

开始安装Wiki

mediawiki 1.2.4.1 install continue

installing the mediawiki 1.24.1 done

安装完成:

complete install the mediawiki 1.24.1 tip download localsettings.php file

其中会自动下载对应的配置文件:

trigger auto download the localsettings php config file

 

配置文件LocalSettings.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
# This file was automatically generated by the MediaWiki 1.24.1
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
 
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
 
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
 
$wgSitename = "Crifan的维基百科";
 
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
$wgScriptPath = "/wiki";
$wgScriptExtension = ".php";
 
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://www.crifan.com";
 
## The relative URL path to the skins directory
$wgStylePath = "$wgScriptPath/skins";
 
## The relative URL path to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgScriptPath/resources/assets/wiki.png";
 
## UPO means: this is also a user preference option
 
$wgEnableEmail = false;
$wgEnableUserEmail = true; # UPO
 
$wgEmergencyContact = "apache@www.crifan.comwww.crifan.comwww.crifan.com";
$wgPasswordSender = "apache@www.crifan.comwww.crifan.comwww.crifan.com";
 
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
 
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "xxx";
$wgDBuser = "yyy";
$wgDBpassword = "zzz";
 
# MySQL specific settings
$wgDBprefix = "";
 
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
 
# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = true;
 
## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = array();
 
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
#$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = "/usr/bin/convert";
 
# InstantCommons allows wiki to use images from http://commons.wikimedia.org
$wgUseInstantCommons = false;
 
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.utf8";
 
## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
#$wgHashedUploadDirectory = false;
 
## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
#$wgCacheDirectory = "$IP/cache";
 
# Site language code, should be one of the list in ./languages/Names.php
$wgLanguageCode = "zh-cn";
 
$wgSecretKey = "aaaaaaaaaaaaaa";
 
# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "bbbbbbbbbbbbbbb";
 
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsText = "Attribution 4.0 International";
 
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
 
# The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
 
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
 
# Enabled skins.
# The following skins were automatically enabled:
require_once "$IP/skins/CologneBlue/CologneBlue.php";
require_once "$IP/skins/Modern/Modern.php";
require_once "$IP/skins/MonoBook/MonoBook.php";
require_once "$IP/skins/Vector/Vector.php";
 
 
# Enabled Extensions. Most extensions are enabled by including the base extension file here
# but check specific extension documentation for more details
# The following extensions were automatically enabled:
require_once "$IP/extensions/Cite/Cite.php";
require_once "$IP/extensions/ConfirmEdit/ConfirmEdit.php";
require_once "$IP/extensions/Gadgets/Gadgets.php";
require_once "$IP/extensions/ImageMap/ImageMap.php";
require_once "$IP/extensions/Interwiki/Interwiki.php";
require_once "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php";
require_once "$IP/extensions/Nuke/Nuke.php";
require_once "$IP/extensions/ParserFunctions/ParserFunctions.php";
require_once "$IP/extensions/Poem/Poem.php";
require_once "$IP/extensions/Renameuser/Renameuser.php";
require_once "$IP/extensions/SpamBlacklist/SpamBlacklist.php";
require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php";
require_once "$IP/extensions/TitleBlacklist/TitleBlacklist.php";
require_once "$IP/extensions/WikiEditor/WikiEditor.php";
 
 
# End of automatically generated settings.
# Add more configuration options below.

注:

有空可以去看看默认的配置:

includes/DefaultSettings.php

更多配置可参考:

Manual:Configuration settings – MediaWiki

 

然后上传到wiki根目录:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
crifan@crifan:wiki$ rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring LocalSettings.php...
  100%       5 KB    5 KB/s 00:00:01       0 Errors
 
?crifan@crifan:wiki$ ls -l
total 936
-rw-r--r--  1 crifan crifan   4556 Dec 18  2014 api.php
-rw-r--r--  1 crifan crifan    933 Dec 18  2014 api.php5
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 cache
-rw-r--r--  1 crifan crifan    749 Dec 18  2014 composer.json
-rw-r--r--  1 crifan crifan  19419 Dec 18  2014 COPYING
-rw-r--r--  1 crifan crifan   4032 Dec 18  2014 CREDITS
drwxr-xr-x  8 crifan crifan   4096 Dec 18  2014 docs
drwxr-xr-x 17 crifan crifan   4096 Dec 18  2014 extensions
-rw-r--r--  1 crifan crifan     77 Dec 18  2014 FAQ
-rw-r--r--  1 crifan crifan 686760 Dec 18  2014 HISTORY
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 images
-rw-r--r--  1 crifan crifan   7528 Dec 18  2014 img_auth.php
-rw-r--r--  1 crifan crifan    943 Dec 18  2014 img_auth.php5
drwxr-xr-x 50 crifan crifan   4096 Dec 18  2014 includes
-rw-r--r--  1 crifan crifan   1754 Dec 18  2014 index.php
-rw-r--r--  1 crifan crifan    937 Dec 18  2014 index.php5
-rw-r--r--  1 crifan crifan   3635 Dec 18  2014 INSTALL
drwxr-xr-x  7 crifan crifan   4096 Dec 18  2014 languages
-rw-r--r--  1 crifan crifan   1825 Dec 18  2014 load.php
-rw-r--r--  1 crifan crifan    935 Dec 18  2014 load.php5
-rw-r--r--  1 crifan crifan   5705 Jul 23 12:49 LocalSettings.php
drwxr-xr-x 17 crifan crifan  12288 Dec 18  2014 maintenance
drwxr-xr-x  3 crifan crifan   4096 Dec 18  2014 mw-config
-rw-r--r--  1 crifan crifan   3852 Dec 18  2014 opensearch_desc.php
-rw-r--r--  1 crifan crifan    957 Dec 18  2014 opensearch_desc.php5
-rw-r--r--  1 crifan crifan  11726 Dec 18  2014 profileinfo.php
-rw-r--r--  1 crifan crifan    949 Dec 18  2014 profileinfo.php5
-rw-r--r--  1 crifan crifan   1482 Dec 18  2014 README
lrwxrwxrwx  1 crifan crifan      6 Dec 18  2014 README.mediawiki -> README
-rw-r--r--  1 crifan crifan  43328 Dec 18  2014 RELEASE-NOTES-1.24
drwxr-xr-x  5 crifan crifan   4096 Dec 18  2014 resources
drwxr-xr-x  2 crifan crifan   4096 Dec 18  2014 serialized
drwxr-xr-x  6 crifan crifan   4096 Dec 18  2014 skins
-rw-r--r--  1 crifan crifan    734 Dec 18  2014 StartProfiler.sample
-rw-r--r--  1 crifan crifan   1087 Dec 18  2014 thumb_handler.php
-rw-r--r--  1 crifan crifan    971 Dec 18  2014 thumb_handler.php5
-rw-r--r--  1 crifan crifan  22024 Dec 18  2014 thumb.php
-rw-r--r--  1 crifan crifan    955 Dec 18  2014 thumb.php5
-rw-r--r--  1 crifan crifan  11827 Dec 18  2014 UPGRADE
-rw-r--r--  1 crifan crifan     98 Dec 18  2014 wiki.phtml
crifan@crifan:wiki$ pwd
/xxxxxxxx/wiki
crifan@crifan:wiki$

 

进入Wiki

然后进入wiki:

进入您的wiki

https://www.crifan.com/wiki/index.php

 

enter into installed mediawiki main page

 

 

【总结】

如此,就下载,配置,安装,成功了MediaWiki。

后续折腾,参见:

【记录】安装MediaWiki后去创建新页面和编辑已有页面

转载请注明:在路上 » 【记录】在Centos 7中安装自己的维基百科MediaWiki

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.291 seconds, using 22.12MB memory