搭建DokuWiki

安装nginx

1
yum install nginx

设置开机启动

1
chkconfig nginx on

启动服务

1
service nginx start

安装php

1
yum install php

安装php组件

1
2
3
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear 
php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
libmcrypt-devel php-fpm

开机启动

1
chkconfig php-fpm on

打开nginx的配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
server {
listen 80;
server_name 域名;

location / {
root php文件主目录;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root php文件主目录;
}

location ~ \.php$ {
root php文件主目录;// /usr/share/nginx/html
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

重启或者reload nginx

访问

1
2
ip/dokuwiki/install.php
根据提示安装

安全

1
2
按照提示设置,完成安装,中文选择右上角
删除install.php

nginx 配置

1
2
3
4
location ~ /(data|conf|bin|inc)/ 
{
deny all;
}