Linux安装Aria2和AriaNg

安装Aria2

使用逗比大佬的一键安装脚本

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/aria2.sh && chmod +x aria2.sh 

最好在/opt/目录下新建一个aria2文件夹

mkdir /opt/aria2
mv aria2.sh /opt/aria2/ && cd /opt/aria2/
bash aria2.sh

然后根据提示安装

安装AriaNg

由于预先安装了LNMP环境,因此直接添加一个虚拟主机即可,再下载AriaNg安装

cd /home/wwwroot/
wget https://github.com/mayswind/AriaNg/releases/download/1.0.3/AriaNg-1.0.3.zip
unzip AriaNg-1.0.3.zip && rm -rf AriaNg-1.0.3.zip

然后通过域名即可访问

启用https

编辑 /root/.aria2/aria2.conf

主要修改三个地方

# 启用加密后 RPC 服务需要使用 https 或者 wss 协议连接
rpc-secure=true
# 在 RPC 服务中启用 SSL/TLS 加密时的证书文件(.pem/.crt)
rpc-certificate=/usr/local/nginx/conf/ssl/aria2.hiak.cn/aria2.920.ai.cer
# 在 RPC 服务中启用 SSL/TLS 加密时的私钥文件(.key)
rpc-private-key=/usr/local/nginx/conf/ssl/aria2.hiak.cn/aria2.920.ai.key

设置301跳转

将http重定向为https,其中aria2.920.ai.conf配置文件如下

server
    {
        listen 80;
        listen [::]:80;
        server_name aria2.920.ai ;
        return 301 https://aria2.920.ai$request_uri;
    }

server
    {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name aria2.920.ai ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/aria2.920.ai;
        ssl on;
        ssl_certificate /usr/local/nginx/conf/ssl/aria2.920.ai/fullchain.cer;
        ssl_certificate_key /usr/local/nginx/conf/ssl/aria2.920.ai/aria2.920.ai.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

        include enable-php-pathinfo.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }

保存并重启nginx

service nginx restart

2019.04.27 17:54

添加新评论

๑òωó๑