wiki_settings
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
wiki_settings [2019/07/14 06:37] – duangw | wiki_settings [2024/08/19 08:47] (当前版本) – duangw | ||
---|---|---|---|
行 3: | 行 3: | ||
本文是该wiki的安装配置说明,[[http:// | 本文是该wiki的安装配置说明,[[http:// | ||
- | 当前操作系统是[[http://www.centos.org/|CentOS 7]],Web服务器为[[http://www.apache.org|Apache 2.4]],Dokuwiki版本为2018-04-22b "Greebo"。 | + | 当前操作系统是[[https://ubuntu.com/|Ubuntu 24.04]],Web服务器为[[https:// |
+ | |||
+ | ===== 升级说明 2024-08-19 ===== | ||
+ | |||
+ | 操作系统升级到[[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 ===== | ===== 升级说明 2019-07-13 ===== |
wiki_settings.1563086221.txt.gz · 最后更改: 2019/07/14 06:37 由 duangw