2017年6月

需要的库

apt install gcc g++ libssl-dev libgcrypt-dev libexpat1-dev libssh2-1-dev libc-ares-dev zlib1g-dev libsqlite3-dev pkg-config

下载最新版 Aria2解压

wget https://github.com/aria2/aria2/releases/download/release-1.32.0/aria2-1.32.0.tar.gz
tar xzvf aria2-1.32.0.tar.gz
cd aria2-1.32.0

编译

./configure
make
make install

文件瘦身

strip -s /usr/local/bin/aria2c

配置文件

mkdir /etc/aria2/
vi /etc/aria2/aria2.conf
touch /路径/aria2.session

配置内容

dir=/home/www/
max-concurrent-downloads=3
input-file=/路径/aria2.session
save-session=/路径/aria2.session
save-session-interval=60
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-secret=设定访问rpc密码
#https设置
#rpc-secure=true
#rpc-certificate=crt文件位置
#rpc-private-key=key文件位置

启动脚本

vi /etc/init.d/aria2c
chmod +x /etc/init.d/aria2c
/etc/init.d/aria2c start

脚本内容

#!/bin/sh

PREFIX="/usr/local/bin"
NAME="aria2c"
FRIENDLY="Aria2"
CONFFILE="/etc/aria2/aria2.conf"

start() {
  if [ -f "$PIDFILE" ]; then
    echo "$FRIENDLY is already running."
    exit 1
  fi
  echo -n "Starting $FRIENDLY Services: "
  $PREFIX/$NAME --conf-path=$CONFFILE --daemon >/dev/null 2>&1
  if [ "$?" = "0" ]; then
    echo "succeeded."
  else
    echo "failed."
    exit 1
  fi
}

stop() {
  if [ ! -n "pidof $NAME" ]; then
    echo "$FRIENDLY is not running."
    exit 1
  fi
  echo -n "Shutting down $FRIENDLY Services: "
  killall "$NAME"
  if [ "$?" = "0" ]; then
    echo "succeeded."
  else
    echo "failed."
    exit 1
  fi
}

case "$1" in
  start)
    start
  ;;
  stop)
    stop
  ;;
  restart)
    "$0" stop
    sleep 1
    "$0" start
  ;;
  *)
    echo "Usage: $0 (start|stop|restart|usage)"
  ;;
esac
exit 0

第一步

进后台备份数据库,备份的时候,选择低版本数据库的方式备份

第二步

备份完数据库后,把所有文件包括备份出来的数据库转移到新空间

第三步

修改数据库配置文件/data/mysql_config.php为新空间的数据库帐号密码(根据配置文件新建一个一样的也行)

第四步

修改/admin/global.php查找“$ForceEnter=0;”改为“$ForceEnter=1;”即可强制登录后台,进行数据库还原

第五步

左侧菜单有数据库还原,之后,再把“$ForceEnter=1;”改回“$ForceEnter=0;”再输入密码进入后台,设置正确的访问网址即可

基本安装

curl https://getcaddy.com | bash -s personal

带插件安装

curl https://getcaddy.com | bash -s personal http.cache,http.filemanager,http.webdav

列目录

caddy browse