[Ubuntu系统] 新装服务器设置Tips(不定期更新)

327 0
Honkers 2026-5-27 17:49:55 来自手机 | 显示全部楼层 |阅读模式

目录

++++++++++ 有用的命令 +++++++++++

++++++++++ 必要项目 +++++++++++

系统准备:

配置国内源

sshd:

 用户和用户组登录限定

postfix & dovecot:

firewall相关命令:

++++++++++ 可选项目 +++++++++++

nginx:

mysql:

php:

toolbox:

docker:

sftp:  # 配置自带的sftp,要求该用户只能sftp登录,指定目录访问

vsftpd:

frp:

       git:

Jenkins Installation In Docker

Gitlab  Installation In Docker

MariaDb 数据库存储路径修改

VNC

SVN

Upgrade to python3

Vi 键盘上下键错位修复 

BookStack PDF导出中文乱码


+++++++++ 说明 +++++++++++

适用于 centos7, ubuntu18, 注意安装工具区别 yum(centos) apt(ubuntu) 

++++++++++ 有用的命令 +++++++++++

  • lsb_release -a,列出系统版本信息
  • tail -f /var/log/auth.log or secure  # 查看登陆日志
  • service --status-all # 查看running的服务
  • id user #查看用户id与组信息
  • 查硬件 lscpu, lsmem, free

++++++++++ 必要项目 +++++++++++

系统准备:

  useradd  -s /bin/bash -m ben
  usermod -aG wheel ben #添加到 sudoer以便可以变身root, 需查看/etc/sudoers是哪个被允许的group: "%wheel  ALL=(ALL)       NOPASSWD: ALL"

# 安装 lsb_release
yum install redhat-lsb -y

# 检查并关闭 SELINUX,不然会导致许多目录访问权限不足的问题 (vi /etc/selinux/config, SELINUX=disabled)

# 挂接存储块与mount
fdisk -l
mkfs -t ext4 /dev/xvdb
mkdir /data0
mount /dev/xvdb /data0

持久化mount: (vi /etc/fstab,  添加 /dev/xvdb /data0 ext4 defaults 0 0)

配置国内源

文件位置

版本代号命令
Ubuntu 24.04Noblevim /etc/apt/sources.list.d/ubuntu.sources
  1. Types: deb deb-src
  2. URIs: https://mirrors.aliyun.com/ubuntu/
  3. Suites: noble noble-updates noble-backports noble-security noble-proposed
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  6. Types: deb deb-src
  7. URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
  8. Suites: noble noble-updates noble-backports noble-security noble-proposed
  9. Components: main restricted universe multiverse
  10. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码

Ubuntu 22.04Jammyvim /etc/apt/sources.list
  1. deb http://mirrors.cloud.tencent.com/ubuntu/ jammy main restricted
  2. deb-src http://mirrors.cloud.tencent.com/ubuntu/ jammy main restricted
  3. deb http://mirrors.cloud.tencent.com/ubuntu/ jammy-updates main restricted
  4. deb-src http://mirrors.cloud.tencent.com/ubuntu/ jammy-updates main restricted
  5. deb http://mirrors.cloud.tencent.com/ubuntu/ jammy-security main restricted
  6. deb-src http://mirrors.cloud.tencent.com/ubuntu/ jammy-security main restricted
  7. deb http://mirrors.cloud.tencent.com/ubuntu/ jammy-security universe
  8. deb-src http://mirrors.cloud.tencent.com/ubuntu/ jammy-security universe
  9. deb http://mirrors.cloud.tencent.com/ubuntu/ jammy-security multiverse
  10. deb-src http://mirrors.cloud.tencent.com/ubuntu/ jammy-security multiverse
  11. deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
  12. deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
  13. deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
  14. deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
  15. deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
  16. deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
  17. deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
  18. deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
  19. deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
  20. deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
复制代码


# 更新yum
yum install net-tools
yum update

# 更新ubuntu

  1. apt-get update && apt-get install -y apt-utils && apt-get install -y curl
复制代码

sshd:

  #编辑 /etc/ssh/sshd_config, 配置无需ppk密匙登陆, (注:方便完后关闭该项,服务器是黑森林世界)
  PasswordAuthentication yes

  # 在本地生成一对公匙与私匙, 部署公匙到远程服务器,私匙用来登陆  

  1. #安装工具
  2. apt-get install putty-tools
  3. # 生成密钥
  4. ssh-keygen -t rsa  -f {path}/id_rsa
  5. # 生成ppk格式私钥
  6. puttygen {path}/id_rsa -o {path}/id_rsa.ppk
复制代码

  # 法1: 远程部署   

  1. cat ./git/id_rsa.pub | ssh git@localhost "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
  2. ssh-copy-id -i path/id_rsa.pub ben@服务器ip 
  3. sshpass -p $TMP_PASS ssh-copy-id root@"${SERVER}"
复制代码

  # 法2:手动append    

  1. echo id_rsa.pub >> 用户目录/.ssh/authorized_keys
复制代码

  # 检查用户目录:
    chmod 755 /home/ben  #注: home/user目录必须755,如果其他比如775, 都会报认证失败
  # 设置只允许key登陆,服务器的世界是黑森林
    PasswordAuthentication no

注意:Ubuntu 22.04无法使用RSA密钥登录

登录失败,提示: refuse our key

/var/log/auth.log 错误:userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] 

法一: 用新的算法产生keys, 典型地, 在wsl2或linux下执行

  1. ssh-keygen -t ed25519 -f ./id_rsa
复制代码

法二: 如需继续用旧rsa密钥对登录,需在/etc/ssh/sshd_config设置,重启sshd

  1. PubkeyAcceptedAlgorithms=+ssh-rsa
复制代码
 用户和用户组登录限定
  1. AllowUsers root xxx1 xxx2
  2. Match Group zx-user
  3. AllowUsers *
复制代码

postfix & dovecot:

说明:邮件服务器,支持系统用户收发邮件,比如jenkins

  1. sudo yum install postfix dovecot system-switch-mail system-switch-mail-gnome
  2. # 打开相关防火墙端口:
  3. firewall-cmd --add-port=25/tcp --permanent
  4. firewall-cmd --add-port=110/tcp --permanent
  5. firewall-cmd --add-port=143/tcp --permanent
  6. firewall-cmd --query-port={port}/tcp --permanent
复制代码

 编辑 /etc/postfix/main.cf, 在末尾加:

  1. myhostname = mail.{domain}
  2. mydomain = {domain}
  3. myorigin = $mydomain
  4. inet_interfaces = all
  5. inet_protocols = all
  6. mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
  7. mynetworks = 192.168.0.0/24, 127.0.0.0/8
  8. relay_domains = iot-age.com, rx-print.com
  9. home_mailbox = Maildir/
  10. # SMTP认证
  11. smtpd_sasl_type = dovecot
  12. smtpd_sasl_path = private/auth
  13. smtpd_sasl_auth_enable = yes
  14. broken_sasl_auth_clients = yes
  15. smtpd_sasl_security_options = noanonymous
  16. smtpd_sasl_local_domain = $myhostname
  17. smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated
复制代码
  1. sudo systemctl start postfix
  2. sudo systemctl enable postfix
复制代码

编辑/etc/dovecot/dovecot.conf

  1. protocols = imap pop3 lmtp
  2. mail_location = maildir:~/Maildir
  3. login_trusted_networks = 0.0.0.0/0
  4. auth default {
  5. mechanisms = plain login
  6. passdb pam {
  7. }
  8. userdb passwd {
  9. }
  10. user = root
  11. socket listen {
  12. client {
  13. path = /var/spool/postfix/private/auth
  14. mode = 0660
  15. user = postfix
  16. group = postfix
  17. }
  18. }
  19. }
复制代码

编辑 /etc/dovecot/conf.d/10-auth.conf 

  1. auth_mechanisms = plain login
复制代码
  1. sudo systemctl start dovecot
  2. sudo systemctl enable dovecot
复制代码

邮件测试:
      echo "jenkins test postfix "|mail somewhere

参考:HowTos/postfix - CentOS Wiki

firewall相关命令:

  1. firewall-cmd --permanent --query-port=2222/tcp # 查询是否开了端口
  2. firewall-cmd --permanent --add-port=2222/tcp # 加端口
  3. firewall-cmd --permanent --remove-port=2222/tcp # 禁止端口
  4. firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="{ip}" port protocol="tcp" port="3000" accept" # 仅允许指定ip访问端口
  5. firewall-cmd --reload # 重载应用
复制代码


++++++++++ 可选项目 +++++++++++

nginx:

  apt install nginx (centos: yum install nginx)
  # 配置vhosts:
  # - 拷贝准备好的 vhost配置文件到 /etc/nginx/sites-availables, 建软链 ln -s /etc/nginx/sites-availables/xxx.conf /etc/nginx/sites-availables
  service nginx restart

mysql:

  1. # 导出数据库,指定mysql.sock位置
  2. mysqldump --socket=/tmp/mysql.sock -u{user} -p{pwd} --databases target_db> /data0/Server/Backup/target_db.sql
  3. # 导出多个数据库
  4. mysqldump -u{username} -p{pwd} --databases db1 db2 db3 > /data0/Server/Backup/target_db.sql
  5. # 导入
  6. mysql -u{username} -p{pwd} {db}< /mnt/Backups/target_db.sql
复制代码

php:

  1. # php 安装, 增加 ondrej/php PPA,提供了多个 PHP 版本
  2. sudo add-apt-repository ppa:ondrej/php
  3. # 再次更新
  4. sudo apt update
  5. # 仅安装php7.4 cli及扩展
  6. apt --no-install-recommends install php7.4 php7.4-common php7.4-zip php7.4-opcache php7.4-cli php7.4-gd php7.4-curl php7.4-mysql php7.4-intl php7.4-bcmath php7.4-rdkafka php7.4-redis
  7. # 设置默认 PHP 版本
  8. update-alternatives --set php /usr/bin/php7.4
  9. # 安装php7.4-fpm
  10. apt install php7.4-fpm
  11. 配置文件路径
  12. 主配置文件:/etc/php/7.4/fpm/php-fpm.conf
  13. 默认池配置:/etc/php/7.4/fpm/pool.d/www.conf
  14. 你可以通过编辑 www.conf 来修改监听方式(如 socket 或端口),默认监听为 /run/php/php7.4-fpm.sock
复制代码
  1. # 安装对应的composer
  2. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  3. php -d allow_url_fopen=On composer-setup.php --install-dir=/usr/local/bin --filename=composer
  4. php -r "unlink('composer-setup.php');"
复制代码
  1. # 安装pecl
  2. apt install php-pear
复制代码

(centos: yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm)
  # 修复phpfpm监听tcp 9000端口: 
    vi /etc/php/7.2/fpm/pool.d/www.conf
      listen=127.0.0.1:9000
    service php7.2-fpm restart

toolbox:

  说明: 设置服务器工具箱访问,包括phpmyadmin / info / phpredisadmin 等
  - 安装httpd-tools: yum install httpd-tools -y
  - 建立账号文件: htpasswd -c /data/auth/htpasswd ben
  - 设置虚拟机: toolbox.xxx.com, /nginx/vhost/toolbox.conf,内容:
 

  1. server {
  2.         listen       80;
  3.         listen       443;
  4.         listen       [::]:80;
  5.         server_name  toolbox.xxx.com;
  6.         
  7.         set $host_path "/data/tools/toolbox";
  8.         access_log   /data/logs/toolbox.log main;
  9.         error_log    /data/logs/toolbox.error.log;
  10.         
  11.         charset utf-8;
  12.         
  13.         root   $host_path;
  14.         index  index.html index.htm index.php;
  15.         
  16.         location / {
  17.             auth_basic  "Authorize Site";
  18.             auth_basic_user_file /data/auth/htpasswd;
  19.             autoindex on;
  20.         }
  21.         
  22.         location ~ \.php$ {
  23.             try_files $uri =404;
  24.             #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  25.             fastcgi_pass 127.0.0.1:9000;
  26.             fastcgi_index index.php;
  27.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  28.             include fastcgi_params;
  29.         }
  30.      
  31.         #include agent_deny.def;
  32.   }
复制代码

  

docker:

安装必要的软件包以允许apt通过HTTPS使用仓库:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

法一 在阿里云上的centos7安装docker

  1. #更新软件包:
  2. yum update
  3. #安装Docker依赖的软件包:
  4. yum install -y yum-utils device-mapper-persistent-data lvm2
  5. #设置Docker仓库:
  6. # yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo (已墙)
  7. yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  8. #安装Docker CE (社区版):
  9. yum install docker-ce docker-ce-cli containerd.io
  10. #启动Docker服务:
  11. systemctl start docker
  12. #设置Docker开机自启:
  13. systemctl enable docker
复制代码

ubuntu

  1. # 添加Docker的官方GPG密钥:
  2. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  3. # 添加Docker的稳定仓库:
  4. add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  5. # 再次更新软件包索引:
  6. apt-get update
  7. apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
复制代码

法二

  # 使用官方脚本自动安装
    curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
  # 常用命令
    docker ps  // 列出运行中的容器服务
    docker stop {container id}  // 停止容器服务
    docker image ls  // 列出已安装的镜像包
  # 镜像制作与发布例子
      前置动作:
        - 申请 dockerhub 账号      

     例一:
       发布服务器:
         1 去项目发布目录, 整理出Dockerfile
         2 docker build -t bennybi/php-hello .
         3 docker run -d -p 8080:8080 bennybi/php-hello # 创建一个新容器,并后台运行,映射宿主端口 8080 => 容器端口 8080
         4 docker push bennybi/php-hello
       部署服务器:
         docker pull bennybi/php-hello
         docker run -d -p 8080:8080 bennybi/php-hello

      例二:
       发布服务器:
         1 去项目发布目录, 整理出Dockerfile
         2 docker build -t bennybi/python-hello .
         3 docker run bennybi/python-hello # 直接运行
         4 docker push bennybi/python-hello
       部署服务器:
         docker pull bennybi/python-hello
         docker run bennybi/python-hello # 直接运行

sftp:  # 配置自带的sftp,要求该用户只能sftp登录,指定目录访问

  groupadd sftp
  useradd -g sftp -d / -s /sbin/nologin user1
  
  #sftp需要
  mkdir /sftp
  mkdir /sftp/user1
  
  # 编辑 /etc/ssh/sshd_config, 配置用户只能在指定目录寻觅

  1. #Subsystem sftp /usr/libexec/openssh/sftp-server
  2. Subsystem sftp internal-sftp
  3. Match Group sftp
  4. ChrootDirectory /sftp/%u
  5. ForceCommand internal-sftp
复制代码

vsftpd:

   使用yum安装 vsftpd: yum install -y vsftpd 或者 apt-get install vsftpd

  #编辑 /etc/vsftpd/vsftpd.conf
    user_config_dir=/etc/vsftpd/vconf #用户配置
    virtual_use_local_privs=YES
    anonymous_enable=NO #禁用匿名用户 YES 改为NO,
    chroot_local_user=YES # 禁止切换根目录 删除或#
    allow_writeable_chroot=YES
    file_open_mode=0775
  #创建虚拟账号
    #创建宿主user
      useradd -g root -M -d /home/vsftpd -s /sbin/nologin ftpuser
      chown -R ftpuser.root /home/vsftpd
    #建立虚拟用户清单 (第一行账号,第二行密码,注意:不能使用root做用户名,系统保留)
       touch /etc/vsftpd/virtual_users
       #内容如:
         ftp1
         kljoeioouj
         ftp2
         092rjoiu08
    #生成数据文件
      db_load -T -t hash -f /etc/vsftpd/vuser_passwd /etc/vsftpd/virtual_users.db
      chmod 600 /etc/vsftpd/virtual_users.db
    #单独用户配置
      mkdir /etc/vsftpd/vconf  # 建立虚拟用户个人vsftp的配置文件
      cd /etc/vsftpd/vconf     # 进入目录
      touch ftp1 ftp2
     #内容
       local_root=/data/Projects/EShop/live/prj
       write_enable=YES
       anon_world_readable_only=NO
       anon_upload_enable=YES
       anon_mkdir_write_enable=YES
       anon_other_write_enable=YES
     #服务
       systemctl restart vsftpd.service  # 重启服务
       systemctl start vsftpd.service    # 启动服务
       systemctl status vsftpd.service   # 服务状态查看

frp:

请参考:内网穿透!如何配置frp新版0.56.0的配置文件.toml:提供web、samba、ssh远程连接示例_frp 配置-CSDN博客

配置附件:

       
git:

  服务器端:
    映射域名 git.xxx.com
    安装git:

  1.       $ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
  2.       $ yum install git
复制代码

    git用户:     

  1. $ groupadd git
  2. $ useradd -g git -m git
复制代码

 拷贝用户公匙到 /home/git/.ssh/authorized_keys

  1. cat {path}/id_rsa.pub >> /home/git/.ssh/authorized_keys
复制代码

  初始化git仓库 (git@git.xxx.com:/data0/gitrepo/t1.git):    

  1. $ mkdir /data0/gitrepo
  2. $ chown git:git /data0/gitrepo
  3. $ cd /data0/gitrepo
  4. $ git init --bare t1.git
  5. $ chown -R git:git t1.git
复制代码

  客户端 (TortoiseGit):
    - clone git@git.xxx.com:/mnt/gitrepo/t1.git
    - Settings->Git->Remote putty key 选择用户私匙
    - Settings->Network->SSH Client 选择TortoiseGit\bin\TortoiseGitPlink.exe, 否则拉取时不会自动load key登陆

客户端(命令行): 

  1. 法1:
  2. ssh-agent bash -c 'ssh-add /data0/Server/Auths/ssh/git/id_rsa;
  3. git clone git@xxx.com:/data0/gitrepo/mk-live-lemp-stack /data0/Server/Settings/lemp'
  4. ssh-agent bash -c 'ssh-add /data0/Server/Auths/ssh/git/id_rsa; git pull'
  5. 法2:
  6. # 配置git用户私钥
  7. git config --global core.sshCommand "ssh -i /data0/Server/Auths/ssh/{user}/id_rsa"
  8. git checkout dev 或 git switch dev
  9. git pull
复制代码

"Your configuration specifies to merge with the ref 'refs/heads/main'" 问题解决:

- 原因是旧版git初始化仓库时没有main分支(默认master),第一次需塞一个文件提交上去建立main分支,不然本地是main,服务器是master就报错。

Jenkins Installation In Docker

步骤1:建立容器间通信,建立相关的volumes以持久化应用数据 (将保存在/var/lib/docker/volumes)

  1. docker network create jenkins
  2. docker volume create jenkins_docker_certs
  3. docker volume create jenkins-data
复制代码

步骤2: 分别安装与运行两个镜像 docker:dind 与 jenkinsci/blueocean

  1. docker container run \
  2. --name jenkins-docker \
  3. --detach \
  4. --privileged \
  5. --network jenkins \
  6. --network-alias docker \
  7. --env DOCKER_TLS_CERTDIR=/certs \
  8. --volume jenkins-data:/var/jenkins_home \
  9. --volume jenkins_docker_certs:/certs/client \
  10. --publish 2376:2376 \
  11. --restart=always \
  12. docker:dind
  13. docker container run \
  14. --name jenkins-blueocean \
  15. --detach \
  16. --network jenkins \
  17. --env DOCKER_HOST=tcp://docker:2376 \
  18. --env DOCKER_CERT_PATH=/certs/client \
  19. --env DOCKER_TLS_VERIFY=1 \
  20. --publish 8080:8080 \
  21. --publish 50000:50000 \
  22. --volume jenkins-data:/var/jenkins_home \
  23. --volume jenkins_docker_certs:/certs/client:ro \
  24. --mount type=bind,source=/mnt,target=/mnt \
  25. --restart=always \
  26. jenkinsci/blueocean
复制代码

参考:

Installing Jenkins

- 命令

  1. docker ps -a
  2. docker exec -it jenkins-blueocean bash
复制代码

Gitlab  Installation In Docker

  1. docker network create gitlab-net
  2. docker volume create gitlab-config
  3. docker volume create gitlab-data
  4. docker volume create gitlab-logs
  5. docker run -d \
  6. --hostname gitlab.rx-print.com \
  7. -p 8888:80 \
  8. -p 22:22 \
  9. --name gitlab \
  10. --restart always \
  11. -v gitlab-config:/etc/gitlab \
  12. -v gitlab-logs:/var/log/gitlab \
  13. -v gitlab-data:/var/opt/gitlab \
  14. --network gitlab-net \
  15. gitlab/gitlab-ce
复制代码

MariaDb 数据库存储路径修改

编辑 /etc/my.cnf,添加以下后,重启 service mysql restart

  1. [mysqld]
  2. datadir=/data0/Server/Db/mysql
  3. socket=/data0/Server/Db/mysql/mysql.sock
  4. [client]
  5. port=3306
  6. socket=/data0/Server/Db/mysql/mysql.sock
复制代码

VNC

How to setup VNC server on centos 8 / RHEL 8
Install and Configure VNC Server on CentOS 8 - kifarunix.com

  1. // 相关命令
  2. vncserver :1 //启动一个端口
  3. vncserver -list // 列出当前用户已启用端口
  4. vncserver -kill :n //关端口
复制代码

SVN

centos搭建svn,解决认证失败问题_wq3028的博客-CSDN博客

Centos

  1. 自启:
  2. - 编辑rc.local文件
  3. vi /etc/rc.d/rc.local
  4. - 加入如下启动命令
  5. /usr/bin/svnserve -d -r /home/svn
  6. 建库
  7. svnadmin create /ext/data/svndir/project
复制代码

Ubuntu

  1. apt-get install subversion
  2. svnadmin create /data0/svn/xxx # 建svn项目
  3. vi xxx/conf/svnserve.conf # 开启用户验证 (anon-access, auth-access, password-db前去掉#)
  4. vi xxx/conf/passwd #管理用密
  5. /usr/bin/svnserve -d -r /data0/svn
复制代码

Upgrade to python3

  1. sudo yum -y install python3
复制代码

Vi 键盘上下键错位修复 

编辑/etc/vim/vimrc.tiny

  1. set nocompatible
  2. set backspace=2
复制代码

安装后:
- 参考此文切换版本:https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux
- vi /usr/bin/yum, /usr/libexec/urlgrabber-ext-down 修改为 #!/usr/bin/python2

BookStack 要点

项目迁移

注意清除缓存目录,{Project}/bootstrap/cache

PDF导出中文乱码
  1. # 安装字体
  2. apt-get install -y fonts-wqy-zenhei fonts-wqy-microhei fonts-droid-fallback
  3. # 测试
  4. wkhtmltopdf input.html output.pdf
复制代码

当测试命令行正常后,如果是用宝塔,查看是否禁用了函数pcntl,导致不能调用脚本

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行