media wiki run on nginx
1. 环境安装:
nginx安装 nginx-1.5.7
php安装 PHP 5.4.10 (cli) (built: Jul 30 2014 16:45:08)
mysql安装 Ver 14.14 Distrib 5.5.30
icu安装 yum install icu
automake 安装 yum install automake
icu lib安装
wget http://download.icu-project.org/files/icu4c/53.1/icu4c-53_1-src.tgz
tar -zxvf icu4c-53_1-src.tgz
cd icu/source
./configure --prefix=/usr/local/icu
make && make install
yum install autoconf
pecl install intl
icu位置填 /usr/local/icu
2. 在php.ini中添加
extension=intl.so
3. 安装WYSIWYG
解压后,将WYSIWYG目录复制到/data/webroot/mediawiki/extensions/
4. 权限控制:LocalSettings.php
$wgGroupPermissions['*']['edit'] = false;#匿名用户不可写 $wgGroupPermissions['*']['read'] = false;#匿名用户不可读 $wgWhitelistRead = array( "Main Page", "Special:Userlogin" );#指定非登录用户可见页面 $wgGroupPermissions['*']['createaccount'] = false;#限制新用户注册
链接在新窗口中打开
LocalSettings.php中设置:
$wgExternalLinkTarget = ‘_blank’;
外链不包括interwiki链接
/mediawiki/includes/DefaultSetting.php
$wgEnableUserEmail = true; $wgEnableEmail = true; /mediawiki/LocalSetting.php $wgEnableEmail = true; $wgEnableUserEmail = true; # UPO $wgEmergencyContact = "forilen@dawx.com"; $wgPasswordSender = "cdn@dawx.com"; $wgSMTP = array( 'host' => 'smtp.qq.com', 'IDHost' => 'qq.com', 'port' => '25', 'auth' => true, 'username' => 'forilen@dawx.com', 'password' => 'mypassword', );
root@192.168.100.252:/data/release/htdocs/mediawiki/includes# pear install MAIL Net_SMTP WARNING: "pear/Auth_SASL" is deprecated in favor of "pear/Auth_SASL2" Did not download optional dependencies: pear/Auth_SASL, use --alldeps to download automatically pear/Net_SMTP can optionally use package "pear/Auth_SASL" (version >= 1.0.5) downloading Mail-1.2.0.tar ... Starting to download Mail-1.2.0.tar (Unknown size) ..........................done: 119,296 bytes downloading Net_SMTP-1.6.2.tar ... Starting to download Net_SMTP-1.6.2.tar (Unknown size) ...done: 65,536 bytes downloading Net_Socket-1.0.14.tar ... Starting to download Net_Socket-1.0.14.tar (Unknown size) ...done: 24,576 bytes install ok: channel://pear.php.net/Mail-1.2.0 install ok: channel://pear.php.net/Net_Socket-1.0.14 install ok: channel://pear.php.net/Net_SMTP-1.6.2 root@192.168.100.252:/data/release/htdocs/mediawiki/includes# pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.7 stable Console_Getopt 1.3.0 stable Mail 1.2.0 stable Net_SMTP 1.6.2 stable Net_Socket 1.0.14 stable PEAR 1.9.4 stable Structures_Graph 1.0.4 stable XML_Util 1.2.1 stable
nignx配置
#user nobody ; user root root; #ALL=(ALL) NOPASSWD: /data/forilen/Kikyou/script/svn.sh; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 192.168.100.252:80; server_name localhost; location / { root /data/release/htdocs; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root /data/release/htdocs; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/release/htdocs$fastcgi_script_name; include fastcgi_params; } } }