wiki_settings
差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
wiki_settings [2014/09/05 07:07] – 创建 duangw | wiki_settings [2024/08/19 08:47] (当前版本) – duangw | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 本站的dokuwiki设置 ====== | + | ====== 本站的Dokuwiki设置 ====== |
- | 本文是该wiki的安装配置说明,[[http:// | + | 本文是该wiki的安装配置说明,[[http:// |
- | 操作系统基于[[http://www.centos.org/|CentOS 7]],Web服务器为[[http://www.apache.org|Apache]],dokuwiki版本为2014-05-05a "Ponder Stibbons"。 | + | 当前操作系统是[[https://ubuntu.com/|Ubuntu 24.04]],Web服务器为[[https://nginx.org/|Nginx 1.26]],Dokuwiki版本为2024-02-06b "Kaos"。 |
- | ===== web服务器配置 | + | ===== 升级说明 2024-08-19 |
- | 为了安全性,对dokuwiki的几个关键目录进行设置。 | + | 操作系统升级到[[https:// |
+ | |||
+ | ==== 安装Nginx和PHP ==== | ||
+ | |||
+ | <code bash> | ||
+ | aptitude install nginx | ||
+ | aptitude install php8.3-fpm | ||
+ | aptitude install php8.3-gd php8.3-mbstring php8.3-xml | ||
+ | </ | ||
+ | |||
+ | ==== 数据恢复 ==== | ||
+ | |||
+ | 将原来网站的文件从旧服务器复制到新机器的/ | ||
+ | |||
+ | 设置权限: | ||
+ | <code bash> | ||
+ | cd /var/www/ | ||
+ | chown -R root:root www.gwduan.com | ||
+ | chown -R www-data: | ||
+ | </ | ||
+ | |||
+ | ==== 配置Nginx ==== | ||
+ | |||
+ | 参照/ | ||
+ | |||
+ | 在index列表里添加index.php: | ||
+ | < | ||
+ | index index.html index.htm index.nginx-debian.html index.php; | ||
+ | </ | ||
+ | |||
+ | 打开php支持: | ||
+ | < | ||
+ | location ~ \.php$ { | ||
+ | include snippets/ | ||
+ | fastcgi_pass unix:/ | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | 禁止所有的.htaccess文件: | ||
+ | < | ||
+ | location ~ /\.ht { | ||
+ | deny all; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | 设置根目录和域名: | ||
+ | < | ||
+ | root / | ||
+ | server_name gwduan.com www.gwduan.com; | ||
+ | </ | ||
+ | |||
+ | 在server_name下面,添加dokuwiki的目录保护: | ||
+ | < | ||
+ | location ~ / | ||
+ | deny all; | ||
+ | } | ||
+ | |||
+ | location ~ /wiki/data/ { | ||
+ | internal; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | 设置https参数: | ||
+ | < | ||
+ | listen 443 ssl; | ||
+ | listen [::]:443; | ||
+ | |||
+ | ssl_certificate | ||
+ | ssl_certificate_key | ||
+ | </ | ||
+ | |||
+ | 将所有的http流量到定向到https: | ||
+ | < | ||
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | |||
+ | server_name gwduan.com www.gwduan.com; | ||
+ | |||
+ | return 301 https:// | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== 申请证书 ==== | ||
+ | |||
+ | 这里使用[[https:// | ||
+ | |||
+ | 安装acme.sh: | ||
+ | < | ||
+ | curl https:// | ||
+ | </ | ||
+ | |||
+ | 申请证书: | ||
+ | < | ||
+ | acme.sh --set-default-ca --server letsencrypt | ||
+ | acme.sh --issue -d gwduan.com -d www.gwduan.com -w / | ||
+ | </ | ||
+ | |||
+ | 安装证书到/ | ||
+ | < | ||
+ | mkdir /ssl | ||
+ | acme.sh --install-cert -d gwduan.com -d www.gwduan.com \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== 启动Nginx ==== | ||
+ | |||
+ | 配置完毕,检测是否正确: | ||
+ | < | ||
+ | cd / | ||
+ | ln -s / | ||
+ | nginx -t | ||
+ | </ | ||
+ | |||
+ | 一切无误,重启Nginx: | ||
+ | < | ||
+ | systemctl restart nginx | ||
+ | </ | ||
+ | |||
+ | ==== 升级Dokuwiki ==== | ||
+ | |||
+ | 下载安装包,当前最新版本是2024-02-06b " | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-a6b3119b5d16cfdee29a855275c5759f.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 完毕调整权限: | ||
+ | <code bash> | ||
+ | chown -R www-data: | ||
+ | </ | ||
+ | |||
+ | 在扩展管理器里更新插件。 | ||
+ | |||
+ | 目前使用的插件: | ||
+ | * Note, [[http:// | ||
+ | * Tag, [[http:// | ||
+ | * Cloud, [[http:// | ||
+ | * Pagelist, [[http:// | ||
+ | * Table Width, [[http:// | ||
+ | |||
+ | ===== 升级说明 2023-10-21 ===== | ||
+ | |||
+ | ==== Dokuwiki升级 ==== | ||
+ | |||
+ | 本次升级间隔了多个版本,需要依次进行。 | ||
+ | |||
+ | 升级到2020-07-29a " | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2020-07-29a.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 升级到2022-07-31b " | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2022-07-31b.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 升级到2023-04-04a "Jack Jackrum" | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2023-04-04a.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 完毕调整权限: | ||
+ | <code bash> | ||
+ | chown -R www-data: | ||
+ | </ | ||
+ | |||
+ | ==== 删除code插件 ==== | ||
+ | |||
+ | 此时打不开主页,原因是[[http:// | ||
+ | <code bash> | ||
+ | cd / | ||
+ | rm -rf code | ||
+ | </ | ||
+ | |||
+ | ==== 升级其他插件 ==== | ||
+ | |||
+ | 在扩展管理器里更新插件。 | ||
+ | |||
+ | 目前使用的插件: | ||
+ | * Note, [[http:// | ||
+ | * Tag, [[http:// | ||
+ | * Cloud, [[http:// | ||
+ | * Pagelist, [[http:// | ||
+ | * Table Width, [[http:// | ||
+ | |||
+ | ===== 升级说明 2021-11-19 ===== | ||
+ | |||
+ | 由于[[http:// | ||
+ | |||
+ | ==== 安装Apache和PHP ==== | ||
+ | |||
+ | <code bash> | ||
+ | aptitude install apache2 | ||
+ | aptitude install php7.4 php7.4-gd php7.4-mbstring php7.4-xml | ||
+ | </ | ||
+ | |||
+ | ==== 数据恢复 ==== | ||
+ | |||
+ | 将原来网站的文件从旧服务器复制到新机器的/ | ||
+ | |||
+ | 设置权限: | ||
+ | <code bash> | ||
+ | cd /var/www/ | ||
+ | chown -R root:root html | ||
+ | chown -R www-data: | ||
+ | </ | ||
+ | |||
+ | ==== 配置Apache ==== | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | < | ||
+ | |||
+ | ServerName gwduan.com | ||
+ | ServerAlias www.gwduan.com | ||
+ | |||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Order allow, | ||
+ | Deny from all | ||
+ | Satisfy All | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== 启用https ==== | ||
+ | |||
+ | 这里使用[[https:// | ||
+ | |||
+ | 首先安装certbot工具: | ||
+ | <code bash> | ||
+ | aptitude install certbot | ||
+ | </ | ||
+ | |||
+ | 生成证书: | ||
+ | <code bash> | ||
+ | systemctl stop apache2 | ||
+ | certbot certonly --standalone | ||
+ | </ | ||
+ | |||
+ | 根据提示为域名gwduan.com和www.gwduan.com申请证书。 | ||
+ | |||
+ | 启用mod_ssl: | ||
+ | <code bash> | ||
+ | a2enmod ssl | ||
+ | a2ensite default-ssl | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | SSLCertificateChainFile / | ||
+ | |||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Order allow, | ||
+ | Deny from all | ||
+ | Satisfy All | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | < | ||
+ | ... | ||
+ | Redirect permanent / https:// | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code bash> | ||
+ | certbot -q renew --pre-hook ' | ||
+ | </ | ||
+ | |||
+ | ===== 升级说明 2019-07-13 ===== | ||
+ | |||
+ | 由于更换了服务器,操作系统升级为[[http:// | ||
+ | |||
+ | ==== 安装Apache和PHP ==== | ||
+ | |||
+ | 启用scl源: | ||
+ | <code bash> | ||
+ | yum install centos-release-scl | ||
+ | </ | ||
+ | |||
+ | 安装Apache和PHP: | ||
+ | <code bash> | ||
+ | yum install httpd24 | ||
+ | yum install rh-php72 rh-php72-php rh-php72-php-gd \ | ||
+ | rh-php72-php-mbstring rh-php72-php-xml | ||
+ | </ | ||
+ | |||
+ | 启用服务: | ||
+ | <code bash> | ||
+ | systemctl enable httpd24-httpd | ||
+ | systemctl start httpd24-httpd | ||
+ | </ | ||
+ | |||
+ | ==== 数据恢复 ==== | ||
+ | |||
+ | 将原来网站的文件从旧服务器复制到新机器的/ | ||
+ | |||
+ | 设置权限: | ||
+ | <code bash> | ||
+ | cd / | ||
+ | chown -R root:root html | ||
+ | chown -R apache: | ||
+ | </ | ||
+ | |||
+ | ==== 配置Apache ==== | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Order allow, | ||
+ | Deny from all | ||
+ | Satisfy All | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | DocumentRoot "/ | ||
+ | ServerName gwduan.com | ||
+ | ServerAlias www.gwduan.com | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== 升级Dokuwiki ==== | ||
+ | |||
+ | 升级到2018-04-22b " | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-8a269cc015a64b40e4c918699f1e1142.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 设置权限: | ||
+ | <code bash> | ||
+ | chown -R apache: | ||
+ | chmod -R o-rwx wiki/ | ||
+ | </ | ||
+ | |||
+ | ==== Plugin插件升级 ==== | ||
+ | |||
+ | 在扩展管理器里更新各个插件。 | ||
+ | |||
+ | ==== 启用https ==== | ||
+ | |||
+ | 这里使用[[https:// | ||
+ | |||
+ | 首先安装certbot工具(需要EPEL源): | ||
+ | <code bash> | ||
+ | yum install certbot | ||
+ | </ | ||
+ | |||
+ | 由于Apache没有安装在标准位置上,所以不使用certbot的Apache插件,而只是生成证书: | ||
+ | <code bash> | ||
+ | systemctl stop httpd24-httpd | ||
+ | certbot certonly --standalone | ||
+ | </ | ||
+ | |||
+ | 根据提示为域名gwduan.com和www.gwduan.com申请证书。 | ||
+ | |||
+ | 安装mod_ssl: | ||
+ | <code bash> | ||
+ | yum install httpd24-mod_ssl | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | SSLCertificateFile / | ||
+ | SSLCertificateKeyFile / | ||
+ | SSLCertificateChainFile / | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | < | ||
+ | ... | ||
+ | Redirect permanent / https:// | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | 编辑/ | ||
+ | <code bash> | ||
+ | 0 0,12 * * * root python -c ' | ||
+ | </ | ||
+ | |||
+ | ===== 升级说明 2017-09-10 ===== | ||
+ | |||
+ | 操作系统依旧基于[[http:// | ||
+ | |||
+ | ==== 升级Apache和PHP ==== | ||
+ | |||
+ | 新的Dokuwiki要求PHP 5.6以上,所以需要先升级Apache和PHP。 | ||
+ | |||
+ | 启用scl源: | ||
+ | <code bash> | ||
+ | yum install centos-release-scl | ||
+ | </ | ||
+ | |||
+ | 安装新版本的Apache和PHP: | ||
+ | <code bash> | ||
+ | yum install httpd24 | ||
+ | yum install rh-php56 rh-php56-php | ||
+ | </ | ||
+ | |||
+ | 启用新服务: | ||
+ | <code bash> | ||
+ | chkconfig httpd off | ||
+ | chkconfig httpd24-httpd on | ||
+ | </ | ||
+ | |||
+ | ==== Apache配置调整 ==== | ||
+ | |||
+ | 新的Apache目录发生了改变,所以需要做相应调整。 | ||
+ | |||
+ | 编辑/ | ||
+ | <code apache> | ||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Order allow, | ||
+ | Deny from all | ||
+ | Satisfy All | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Dokuwiki升级 ==== | ||
+ | |||
+ | 首先将原来的wiki文件复制到新位置: | ||
+ | <code bash> | ||
+ | cd / | ||
+ | cp -pr / | ||
+ | </ | ||
+ | |||
+ | 由于间隔了多个版本,需要依次升级。 | ||
+ | |||
+ | 升级到2015-08-10a “Detritus”: | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2015-08-10.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 升级到2016-06-26e “Elenor of Tsort”: | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2016-06-26.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 升级到2017-02-19e “Frusterick Manners”: | ||
+ | <code bash> | ||
+ | tar xzvf dokuwiki-2017-02-19.tgz | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | 最后调整权限: | ||
+ | <code bash> | ||
+ | chown -R apache: | ||
+ | chmod -R o-rwx wiki/ | ||
+ | </ | ||
+ | |||
+ | ==== Plugin插件升级 ==== | ||
+ | |||
+ | 在扩展管理器里更新各个插件。 | ||
+ | |||
+ | ===== 初始安装 ===== | ||
+ | |||
+ | 操作系统基于[[http:// | ||
+ | |||
+ | ==== web服务器配置 ==== | ||
+ | |||
+ | 为了安全性,对Dokuwiki的几个关键目录进行设置。 | ||
在/ | 在/ | ||
行 23: | 行 517: | ||
</ | </ | ||
- | 有关dokuwiki安全方面的详细说明,可参阅[[http:// | + | 有关Dokuwiki安全方面的详细说明,可参阅[[http:// |
- | ===== dokuwiki安装 | + | ==== Dokuwiki安装 ==== |
- | ==== 解包 | + | === 解包 === |
wiki程序安装在web服务器目录/ | wiki程序安装在web服务器目录/ | ||
行 38: | 行 532: | ||
</ | </ | ||
- | 有关dokuwiki权限方面的详细说明,可参阅[[http:// | + | 有关Dokuwiki权限方面的详细说明,可参阅[[http:// |
- | ==== 初始配置 | + | === 初始配置 === |
通过浏览器运行install.php,进行初始配置,包括设置语言、wiki名称、管理员帐户、wiki类型、license等。 | 通过浏览器运行install.php,进行初始配置,包括设置语言、wiki名称、管理员帐户、wiki类型、license等。 | ||
行 46: | 行 540: | ||
完毕以管理员帐户登录,添加一个日常应用的普通帐户;设置目录权限为0750,文件权限为0640;由于是个人wiki,关闭注册功能。 | 完毕以管理员帐户登录,添加一个日常应用的普通帐户;设置目录权限为0750,文件权限为0640;由于是个人wiki,关闭注册功能。 | ||
- | ===== template模板设置 | + | ==== Template模板设置 ==== |
有关模板的详细说明,可参阅[[http:// | 有关模板的详细说明,可参阅[[http:// | ||
行 52: | 行 546: | ||
这里直接使用缺省的模板。 | 这里直接使用缺省的模板。 | ||
- | ===== plugin插件设置 | + | ==== Plugin插件设置 ==== |
- | dokuwiki提供了丰富的插件,有关插件的详细说明,可参阅[[http:// | + | Dokuwiki提供了丰富的插件,有关插件的详细说明,可参阅[[http:// |
插件通过扩展管理器直接安装。 | 插件通过扩展管理器直接安装。 |
wiki_settings.1409900862.txt.gz · 最后更改: 2014/11/01 02:02 (外部编辑)