Wiki引擎mediawiki
作者:【吳業亮】云計算開發工程師
博客:http://blog.csdn.net/wylfengyujiancheng
MediaWiki是一套基于網絡的Wiki引擎,維基媒體基金會的所有項目乃至眾多wiki網站皆采用了這一軟件。MediaWiki軟件最初是為自由內容百科全書維基百科所開發的,今日已被一些公司機構部署為內部的知識管理和內容管理系統。Novell甚而還在多個高流量的網站中使用了該軟件。MediaWiki采用PHP編程語言寫成,并可使用MySQL、MariaDB、PostgreSQL或SQLite之一作為其關系數據庫管理系統。MediaWiki在GNU通用公共許可證第2版及其后續版本的條款下分發,其文檔則按知識共享-署名-相同方式共享3.0版協議釋出,部分文檔還被釋入了公有領域,這使其成為了自由軟件。出于服務維基百科的需求,軟件的第一個版本于2002年被部署,后來,維基百科和其他維基項目繼續定義了MediaWiki的大部分功能。為了有效地處理大型項目,MediaWiki得到了很好的優化,使其可以承載萬億字節的內容和每秒數十萬次的訪問請求。因為維基百科是全球最大的網站之一,需要MediaWiki能為開發者實現通過多層次的實現可伸縮性緩存和數據庫響應,對開發者來說,這一直是一個讓他們很頭疼的大問題,而MediaWiki很好的解決了這一問題。MediaWiki有700多個配置設置和超過1800個擴展,可以使各種特性被添加或更改。在維基百科上,超過1000個自動化和半自動化的機器人和其他工具用于協助編輯。它也被一些公司部署為一個內部知識管理系統,一些教育機構也讓學生使用MediaWiki來進行小組項目的管理和維護。
一、安裝http
1、安裝軟件包
2、刪除歡迎詞
# rm -f /etc/httpd/conf.d/welcome.conf3、修改配置文件/etc/httpd/conf/httpd.conf
第86行定義管理員郵箱 ServerAdmin root@srv.world 第95行定義服務器名稱 ServerName www.srv.world:80 # line 151: change 151行定義權限 AllowOverride All 164行添加只能使用目錄名稱訪問的文件名 DirectoryIndex index.html index.cgi index.php # 在后面新增 # server's response header ServerTokens Prod # keepalive is ON KeepAlive On4、啟動服務并設置開機啟動
# systemctl start httpd # systemctl enable httpd5、設置防火墻
# firewall-cmd --add-service=http --permanent success # firewall-cmd --reload Success6、寫入測試文件
# vi /var/www/html/index.html<html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Test Page </div> </body> </html>7、測試
二、安裝PHP
1、安裝軟件包
修改配置文件
# vi /etc/php.ini # line 878: 修改時區 date.timezone = "Asia/Shanghai"2、重啟http服務
# systemctl restart httpd3、創建測試文件
# vi /var/www/html/index.php<html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> <?phpprint Date("Y/m/d"); ?> </div> </body> </html>4、測試
三、安裝數據庫
1、安裝軟件包
2、修改配置文件/etc/my.cnf
# add follows within [mysqld] section [mysqld] character-set-server=utf83、啟動服務并設置開機啟動
# systemctl start mariadb # systemctl enable mariadb4、初始化數據庫
# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.Enter current password for root (enter for none): OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.# set root password Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables..... Success!By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. # remove anonymous users Remove anonymous users? [Y/n] y... Success!Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.# disallow root login remotely Disallow root login remotely? [Y/n] y... Success!By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.# remove test database Remove test database and access to it? [Y/n] y- Dropping test database...... Success!- Removing privileges on test database...... Success!Reloading the privilege tables will ensure that all changes made so far will take effect immediately.# reload privilege tables Reload privilege tables now? [Y/n] y... Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDB installation should now be secure.Thanks for using MariaDB!5、連接數據庫
# mysql -u root -p Enter password: # MariaDB root password you set Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 5.5.37-MariaDB MariaDB ServerCopyright (c) 2000, 2014, Oracle, Monty Program Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.6、查看用戶
MariaDB [(none)]> select user,host,password from mysql.user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | root | 127.0.0.1 | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | root | ::1 | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | +------+-----------+-------------------------------------------+ 3 rows in set (0.00 sec)7、顯示數據庫
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec)MariaDB [(none)]> exit Bye8、配置防火墻
[root@dlp ~]# firewall-cmd --add-service=mysql --permanent success [root@dlp ~]# firewall-cmd --reload Success四、創建mediawiki數據庫
# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # create "mediawiki" databse (set any password for "password" section) MariaDB [(none)]> create database mediawiki; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on mediawiki.* to mediawiki@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye五、安裝mediawiki
1、下載軟件包
2、解壓軟件包
# tar zxvf mediawiki-1.26.4.tar.gz3、拷貝到/var/www/html/mediawiki
# mv mediawiki-1.26.4 /var/www/html/mediawiki4、設置權限
# chown -R apache. /var/www/html/mediawiki5、重啟httpd服務
# systemctl restart httpd6、配置seLinux
# chcon -R -t httpd_sys_rw_content_t /var/www/html/mediawiki # semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/mediawiki六、通過界面配置mediawiki
http://(server’s hostname or IP address)/mediawiki/mw-config/
1、設置語言
點擊繼續
2、配置數據庫
3、創建管理員用戶
4、下載配置文件,并將LocalSettings.php通過ftp工具上傳到后臺/var/www/html/mediawiki下,注意目錄權限
5、開始使用
參考:
https://zh.wikipedia.org/wiki/MediaWiki
總結
以上是生活随笔為你收集整理的Wiki引擎mediawiki的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DT时代,大数据如何服务产业经济?
- 下一篇: electron 自定义右键菜单