mediawiki
一、安装mediawiki(apache/php/mysql/mediawiki)
1.安装apache,
Server Infomation分别填写:
<hostname>.localdomain
<hostname>.localdomain
admin@<hostname>.localdomain
测试http://localhost,如果显示It Works,说明apache安装正常
2.安装php,
Web Server Setup选择Apache 2.2.x module
Apache Configuration Directory选择apache的安装路径
重启apache,在apache的htdocs目录下新建hello.php文件,内容为
<?php phpinfo(); ?>
测试http://localhost/hello.php,如果显示很多php的信息,说明php安装成功
3.安装mysql,创建用户
4.解压缩mediawiki,文件夹改名为wiki,然后复制到apache的htdocs目录下
http://localhost/wiki/mw-config/index.php,进行mediawiki的配置,配置完成后会得到一个LocalSettings.php,将它复制到mediawiki的目录下
修改LocalSetting.php文件的以下变量
$wgServer改为实际ip地址
$wgLogo改为实际的logo图片位置
$wgEnableUploads改为true
修改左侧导航栏:在搜索位置输入mediawiki:sidebar,然后编辑
默认是
* navigation
** mainpage|mainpage-description
** portal-url|portal
** currentevents-url|currentevents
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help
* SEARCH
* TOOLBOX
* LANGUAGES
In your LocalSettings.php, look to see if $wgServer is set to something.
二、WikiEditor
http://www.mediawiki.org/wiki/Extension:WikiEditor
LocalSettings.php添加以下内容:
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
# Enables use of WikiEditor by default but still allow users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;
三、mediawiki语法
<pre>code</pre>
四、目录显示在右侧
编辑commonContent.css,添加一行
#toc { float: right; border: 1px solid #aaa; BACKGROUND-COLOR: #aaa };
五、管理
Special:ListUsers,列出所有的用户
========================!!!!!!!!!!安装步骤!!!!!!!!!=========================
1. yum install httpd php pcre php-mysql php-pear php-pecl-apc mysql-server ImageMagick sendmail php-intl wget system-config-firewall-tui
2. service mysqld start
3./usr/bin/mysql_secure_installation
4.登陆mysql,建立用户和密码如下:
insert into mysql.user(Host,User,Password) values("localhost","mediawiki",password("1234"));
5. 建立数据库并赋权:
create database wikidb;
grant index, create, select, insert, update, delete, alter, lock tables on wikidb.* to 'mediawiki'@'localhost' identified by '1234';
exit;
远程访问赋权:
grant all privileges on *.* to 'mediawiki'@'192.168.1.111' identified by '1234';
FLUSH PRIVILEGES;
6.cd /var/www/html
7.wget http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.2.tar.gz
8.tar xzpf mediawiki-1.18.2.tar.gz
9.mv mediawiki-1.18.2 wiki
10.chown -R apache:apache wiki
11.vi /etc/httpd/conf/httpd.conf 添加:
<Directory "/var/www/html/wiki/p_w_picpaths">
Options -Indexes
# Ignore .htaccess files
AllowOverride None
# Serve HTML as plaintext, don't execute SHTML
AddType text/plain .html .htm .shtml .php
# Don't run arbitrary PHP code.
php_admin_flag engine off
# If you've other scripting languages, disable them too.
</Directory>
11. /etc/httpd/conf/httpd.conf 设置serverName
12.chmod 775 /var/www/html/wiki/p_w_picpaths
13. vi /etc/php.ini 设置上传文件大小
post_max_size = 128M
upload_max_filesize = 128M
14. 打开系统的 80和443 端口
15.service httpd restart
16. 登陆 http://IP:端口/wiki
设置:database name:wikidb, database username: mediawiki 等(设置时有前面第4步创建的一致)
并选择PHP object caching
17.下载LocalSettings.php并放到/var/www/html/wiki 目录
18.vi /var/www/html/wiki/LocalSettings.php
$wgEnableUploads = true; # Set this to true
# 添加如下:
$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg','exe');
$wgFileBlacklist = array_diff( $wgFileBlacklist, array ('exe') );
19.chkconfig httpd on
20.chkconfig mysqld on
21.service sendmail restart
22. chkconfig sendmail on
23. 安装完毕, 开始你的wiki之旅。
问题1:##linux 下apche无法监听端口解决办法
[root@localhost html]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.termwikidev for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:81
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:81
no listening sockets available, shutting down
Unable to open logs
解决办法:
semanage port -l|grep http
semanage port -a -t http_port_t -p tcp 81
问题2:### CentOS 打开端口 如打开3306端口,操作如下:
/sbin/iptables -I INPUT -p tcp --dport 3036 -j ACCEPT
保存我们的操作,命令如下:
/etc/rc.d/init.d/iptables save
查看端口的状态,命令如下:
/etc/init.d/iptables status