Debian如何安装宝塔面板及配置v2ray服务器

2022-11-17

宝塔面板+V2RAY

切换到root账号

1

sudo -i

设置root密码

1

passwd

Debian安装宝塔面板

BT面板官方安装脚本:(Debian系统)

1

wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh

Centos安装

1

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

如下图就安装成功了。

Debian如何安装宝塔面板及配置v2ray服务器

Linux系统运维及项目正式上线:进入学习

Debian如何安装宝塔面板及配置v2ray服务器 

根据上面提示的地址和密码登录你的宝塔面板
安装Nginx/Sql/或是其他你需要的运行环境软件

Debian如何安装宝塔面板及配置v2ray服务器Debian如何安装宝塔面板及配置v2ray服务器Debian如何安装宝塔面板及配置v2ray服务器

因为有时候debian不能急速安装,一般是编译安装,所以速度慢的奇葩!!若是真心是建站需求的话,推荐使用CENTOS7以上的系统,那样安装运行环境很急速的!一般10分钟内全部搞定

开启DEBIAN9 BBR

1

2

3

4

5

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服务器:官方脚本

1

bash <(curl -L -s https://install.direct/go.sh)

如果提示 curl: command not found ,那是因为你的 VPS 没装 Curl
ubuntu/debian系统安装 Curl 方法

1

apt-get update -y && apt-get install curl -y

centos系统安装 Curl 方法

1

yum update -y && yum install curl -y

vi /etc/v2ray/config.json V2RAY服务器的配置文件如下:(下面代码可以直接覆盖源文件代码)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

{

 "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"

 }

 ]

 }

}

设置为开机自动启动

  1. systemctl enable v2ray

启动v2ray服务

  1. systemctl start v2ray

自动签发SSL证书,并强制开启HTTPS
Debian如何安装宝塔面板及配置v2ray服务器Debian如何安装宝塔面板及配置v2ray服务器Debian如何安装宝塔面板及配置v2ray服务器

配置站点的nginx

1

2

3

4

5

6

7

8

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;

}

  • 宝塔配置文件

Debian如何安装宝塔面板及配置v2ray服务器

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

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;

    }

}

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

免责声明 1、本站所发布的全部内容源于互联网搬运,(包括源代码、软件、学习资料等)本站提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的23个小时之内,从您的电脑或手机中彻底删除上述内容。
2、访问本站的用户必须明白,本站对所提供下载的软件和程序代码不拥有任何权利,其版权归该软件和程序代码的合法拥有者所有,如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如本站不慎侵犯您的版权请联系我们,我们将及时处理,并撤下相关内容!敬请谅解! 侵删请致信E-mail:messi0808@qq.com
3、如下载的压缩包需要解压密码,若无特殊说明,那么文件的解压密码则为www.xmy7.com
4、如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

小蚂蚁资源网 技术文章 Debian如何安装宝塔面板及配置v2ray服务器 https://www.xmy7.com/zh/jishu/21358.html

相关文章