本文由宝塔面板教程栏目给大家介绍debian如何安装宝塔面板、如何开启debian9 bbr以及如何安装v2ray服务器,希望对需要的你有所帮助!
宝塔面板+v2ray
切换到root账号sudo -i
设置root密码passwd
debian安装宝塔面板bt面板官方安装脚本:(debian系统)
wget -o install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
centos安装
yum install -y wget && wget -o install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
如下图就安装成功了。
根据上面提示的地址和密码登录你的宝塔面板
安装nginx/sql/或是其他你需要的运行环境软件
因为有时候debian不能急速安装,一般是编译安装,所以速度慢的奇葩!!若是真心是建站需求的话,推荐使用centos7以上的系统,那样安装运行环境很急速的!一般10分钟内全部搞定
开启debian9 bbr echo net.core.default_qdisc=fq >> /etc/sysctl.conf echo net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.conf sysctl -p sysctl net.ipv4.tcp_available_congestion_control lsmod | grep bbr
安装v2ray服务器:官方脚本bash <(curl -l -s https://install.direct/go.sh)
如果提示 curl: command not found ,那是因为你的 vps 没装 curl
ubuntu/debian系统安装 curl 方法
apt-get update -y && apt-get install curl -y
centos系统安装 curl 方法
yum update -y && yum install curl -y
vi /etc/v2ray/config.json v2ray服务器的配置文件如下:(下面代码可以直接覆盖源文件代码)
{ inbounds: [{ port: 65432, //此处为安装时生成的端口,可修改随意,但是保证和下面提到的端口号相同 listen:127.0.0.1, protocol: vmess, settings: { clients: [ { id: xxxxxxxxx, //此处为安装时生成的id level: 1, alterid: 64 //此处为安装时生成的alterid } ] }, streamsettings: { network: ws, wssettings: { path: /softdown //此处为路径,需要和下面nginx上面的路径配置一样 } } }], outbounds: [{ protocol: freedom, settings: {} },{ protocol: blackhole, settings: {}, tag: blocked }], routing: { rules: [ { type: field, ip: [geoip:private], outboundtag: blocked } ] } }
设置为开机自动启动
systemctl enable v2ray启动v2ray服务
systemctl start v2ray自动签发ssl证书,并强制开启https
配置站点的nginx
location /softdown { proxy_redirect off; proxy_pass http://127.0.0.1:65432; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection upgrade; proxy_set_header host $http_host; }
宝塔配置文件
server{ listen 80; listen 443 ssl http2; server_name v-hk.yuezl.top; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/v-hk.yuezl.top; #ssl-start ssl相关配置,请勿删除或修改下一行带注释的404规则 #error_page 404/404.html; #http_to_https_start if ($server_port !~ 443){ rewrite ^(/.*)$ https://$host$1 permanent; } #http_to_https_end ssl_certificate /www/server/panel/vhost/cert/v-hk.yuezl.top/fullchain.pem; ssl_certificate_key /www/server/panel/vhost/cert/v-hk.yuezl.top/privkey.pem; ssl_protocols tlsv1.1 tlsv1.2 tlsv1.3; ssl_ciphers ecdhe-rsa-aes128-gcm-sha256:high:!anull:!md5:!rc4:!dhe; ssl_prefer_server_ciphers on; ssl_session_cache shared:ssl:10m; ssl_session_timeout 10m; error_page 497 https://$host$request_uri; #ssl-end #error-page-start 错误页配置,可以注释、删除或修改 error_page 404 /404.html; #error_page 502 /502.html; #error-page-end #php-info-start php引用配置,可以注释或修改 include enable-php-74.conf; #php-info-end #rewrite-start url重写规则引用,修改后将导致面板设置的伪静态规则失效 include /www/server/panel/vhost/rewrite/v-hk.yuezl.net.conf; #rewrite-end #禁止访问的文件或目录 location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|license|readme.md) { return 404; } #一键申请ssl证书验证目录相关设置 location ~ \.well-known{ allow all; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; error_log off; access_log /dev/null; } location ~ .*\.(js|css)?$ { expires 12h; error_log off; access_log /dev/null; } access_log /www/wwwlogs/v-hk.yuezl.top.log; error_log /www/wwwlogs/v-hk.yuezl.top.error.log; location / { proxy_redirect off; proxy_pass http://127.0.0.1:56629; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection upgrade; proxy_set_header host $http_host; # show realip in v2ray access.log proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; }}
更多宝塔面板相关知识,请访问宝塔面板教程栏目!
以上就是debian如何安装宝塔面板及配置v2ray服务器的详细内容。