2020年12月25日星期五

Debian 9安装Haproxy 2.2.x新版

 

Instructions for latest release

You need to enable a dedicated repository:

# curl https://haproxy.debian.net/bernat.debian.org.gpg | \
      apt-key add -
# echo deb http://haproxy.debian.net stretch-backports-2.2 main | \
      tee /etc/apt/sources.list.d/haproxy.list

Then, use the following commands:

# apt-get update
# apt-get install haproxy=2.2.\*

You will get the latest release of HAProxy 2.2 (and stick to this branch).


来源

https://haproxy.debian.net/

HAProxy 让 Trojan-gfw 和 V2Ray 共存

参考来源 

https://lhy.life/20200909-haproxy/


HAProxy 配置

global

        log /dev/log local0

        log /dev/log local1 notice

        chroot /var/lib/haproxy

        user haproxy

        group haproxy

        daemon


defaults

        log global

        mode tcp

        option tcplog

        option dontlognull

        timeout connect 24h

        timeout client 24h

        timeout server 24h


frontend ssl

        mode tcp

        bind *:443

        

        tcp-request inspect-delay 3s

        tcp-request content accept if { req.ssl_hello_type 1 }


        use_backend trojan if { req_ssl_sni -i trojan.exp.com }

        use_backend naiveproxy if { req_ssl_sni -i naive.exp.com }       

        use_backend v2ray if { req_ssl_sni -i v2ray.exp.com }

        use_backend web1 if { req_ssl_sni -i web1.exp.com }

        use_backend web2 if { req_ssl_sni -i web2.exp.com }


backend trojan

        mode tcp

        server trojan 127.0.0.1:350


backend naiveproxy

        mode tcp

        server naiveproxy 127.0.0.1:352


backend v2ray

        mode tcp

        server v2ray 127.0.0.1:353


backend web1

        mode tcp

        server web1 127.0.0.1:356


backend web2

        mode tcp

        server web2 127.0.0.1:357


Trojan 服务端配置

{

    "run_type": "server",

    "local_addr": "0.0.0.0",

    "local_port": 350,

    "remote_addr": "127.0.0.1",

    "remote_port": 351,

    "password": [

        "passwd1",

        "passwd2"

    ],

    "log_level": 1,

    "ssl": {

        "cert": "/path/cert.pem",

        "key": "/path/key.pem",

        "key_password": "",

        "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",

        "prefer_server_cipher": true,

        "alpn": [

            "http/1.1"

        ],

        "alpn_port_override": {

            "h2": 81

        },

        "reuse_session": true,

        "session_ticket": false,

        "session_timeout": 600,

        "plain_http_response": "",

        "curves": "",

        "dhparam": ""

    },

    "tcp": {

        "prefer_ipv4": false,

        "no_delay": true,

        "keep_alive": true,

        "reuse_port": false,

        "fast_open": false,

        "fast_open_qlen": 20

    },

    "mysql": {

        "enabled": false,

        "server_addr": "127.0.0.1",

        "server_port": 3306,

        "database": "trojan",

        "username": "trojan",

        "password": "",

        "cafile": ""

    }

}


NaiveProxy 服务端 Caddy 配置

{

    "admin": {

          "disabled": true

    },

    "apps": {

       "http": {

         "servers": {

           "web1": {

             "listen": [":352"],

             "routes": [{

               "handle": [{

                 "handler": "forward_proxy",

                 "hide_ip": true,

                 "hide_via": true,

                 "auth_user": "你的账户",

                 "auth_pass": "你的密码",

                 "probe_resistance": {"domain": "your-secret-link.localhost"}

               }]

             }, {

               "match": [{"host": ["naive.exp.com"]}],

               "handle": [{

                 "handler": "file_server",

                 "root": "/path/naive.exp.com",

                 "index_names": ["index.html"]

               }],

               "terminal": true

             }],

             "tls_connection_policies": [{

               "match": {"sni": ["naive.exp.com"]}

             }],

             "automatic_https": {

               "disable": true

             }

           }

         }

       },

       "tls": {

         "certificates": {

           "load_files": [{

             "certificate": "/path/cert.pem",

             "key": "/path/key.pem"

           }]

         }

       }

    }

}


V2Ray 服务端配置

VLESS+TCP+TLS 和 VMess+WebSocket+TLS 配置


{

    "log": {

        "loglevel": "warning"

    },

    "inbounds": [

        {

            "port": 353,

            "protocol": "vless",

            "settings": {

                "clients": [

                    {

                        "id": "你的UUID",

                        "level": 0

                    }

                ],

                "decryption": "none",

                "fallbacks": [

                    {

                        "dest": 354

                    },

                    {

                        "path": "/yourpath",

                        "dest": 355

                    }

                ]

            },

            "streamSettings": {

                "network": "tcp",

                "security": "tls",

                "tlsSettings": {

                    "alpn": [

                        "http/1.1"

                    ],

                    "certificates": [

                        {

                            "certificateFile": "/path/to/fullchain.crt",

                            "keyFile": "/path/to/private.key"

                        }

                    ]

                }

            }

        },

        {

            "port": 355, 

            "listen": "127.0.0.1", 

            "protocol": "vmess", 

            "settings": {

                "clients": [

                    {

                        "id": "你的UUID", 

                        "level": 0,

                        "alterId": 4

                    }

                ]

            }, 

            "streamSettings": {

                "network": "ws", 

                "wsSettings": {

                    "path": "/yourpath 和上面一样"

                }

            }

        }

    ], 

    "outbounds": [

        {

            "protocol": "freedom"

        }

    ]

}


Nginx 配置

user root root

...

events {

    ...

}

http {

    ...


    ## Trojan 伪装站点配置

    server {

        listen 80;

        listen [::]:80;

        server_name trojan.exp.com;

        return 301 https://trojan.exp.com$request_uri;

    }

    server {

        listen 351;

        server_name trojan.exp.com;

        index index.php index.html;

        root /www/wwwroot/trojan.exp.com;

        ...

    }


    ## NaiveProxy 配置(只处理http重定向至https)

    server {

        listen 80;

        listen [::]:80;

        server_name naive.exp.com;

        return 301 https://naive.exp.com$request_uri;

    }


    ## VLESS 回落站点配置

    server {

        listen 80;

        listen [::]:80;

        server_name v2ray.exp.com;

        return 301 https://v2ray.exp.com$request_uri;

    }

    server {

        listen 354;

        server_name v2ray.exp.com;

        index index.php index.html;

        root /www/wwwroot/v2ray.exp.com;

        ...

    }


    ## web1 站点配置

    server {

        listen 80;

        listen [::]:80;

        server_name web1.exp.com;

        return 301 https://web1.exp.com$request_uri;

    }

    server {

        listen 356 ssl http2;

        server_name web1.exp.com;

        index index.php index.html;

        root /www/wwwroot/web1.exp.com;


        ssl_certificate /path/to/fullchain.crt;

        ssl_certificate_key /path/to/private.key;

        ...

    }


    ## web2 站点配置

    server {

        listen 80;

        listen [::]:80;

        server_name web2.exp.com;

        return 301 https://web2.exp.com$request_uri;

    }

    server {

        listen 357 ssl http2;

        server_name web2.exp.com;

        index index.php index.html;

        root /www/wwwroot/web2.exp.com;


        ssl_certificate /path/to/fullchain.crt;

        ssl_certificate_key /path/to/private.key;

        ...

    }

    ...

}


为 Nginx 启用 PROXY protocol

HAProxy 配置

...

backend web1

        mode tcp

        server web1 127.0.0.1:356 send-proxy


backend web2

        mode tcp

        server web2 127.0.0.1:357 send-proxy

...

Nginx 配置

...

http {

    ...

    ## web1 站点配置

    ...

    server {

        listen 356 ssl http2 proxy_protocol;

        server_name web1.exp.com;

        index index.php index.html;

        root /www/wwwroot/web1.exp.com;


        set_real_ip_from 127.0.0.1;

        real_ip_header proxy_protocol;


        ssl_certificate /path/to/fullchain.crt;

        ssl_certificate_key /path/to/private.key;

        ...

    }


    ## web2 站点配置

    ...

    server {

        listen 357 ssl http2 proxy_protocol;

        server_name web2.exp.com;

        index index.php index.html;

        root /www/wwwroot/web2.exp.com;


        set_real_ip_from 127.0.0.1;

        real_ip_header proxy_protocol;


        ssl_certificate /path/to/fullchain.crt;

        ssl_certificate_key /path/to/private.key;

        ...

    }

    ...

}








2020年12月22日星期二

Centos 7 安装emby后无法启用的问题排除

输入service emby-server status

如果看到 

emby-server[1622]: at System.IO.Directory.CreateDirectory(String path)

说明无写入权限

解决方式:

chmod 777/var/lib/emby

chmod 777/var/lib



2020年12月10日星期四

V2Ray 客户端跑Https模式(Http+tls)

一个客户端json范本,供参考


 {

    "log": {

        "access": "",

        "error": "",

        "loglevel": "warning"

    },

    "inbounds": [

        {

            "tag": "proxy",

            "port": 10809,

            "listen": "0.0.0.0",

            "protocol": "socks",

            "sniffing": {

                "enabled": true,

                "destOverride": [

                    "http",

                    "tls"

                ]

            },

            "settings": {

                "auth": "noauth",

                "udp": true

            }

        }

    ],

    "outbounds": [

        {

            "protocol": "http",

            "settings": {

                "servers": [

                    {

                        "address": "www.mydomain.com",

                        "port": 21345,

                        "users": [

                            {

                                "user": "user",

                                "pass": "passwd"

                            }

                        ]

                    }

                ]

            },

            "streamSettings": {"security": "tls"}

        }

    ],

    "routing": {

        "domainStrategy": "IPIfNonMatch",

        "rules": [

            {

                "type": "field",

                "inboundTag": [

                    "api"

                ],

                "outboundTag": "api"

            },

            {

                "type": "field",

                "outboundTag": "proxy",

                "domain": [

                    "geosite:google",

                    "geosite:github",

                    "geosite:netflix",

                    "geosite:steam",

                    "geosite:telegram",

                    "geosite:tumblr",

                    "geosite:speedtest",

                    "geosite:bbc",

                    "domain:gvt1.com",

                    "domain:textnow.com",

                    "domain:twitch.tv",

                    "domain:wikileaks.org",

                    "domain:naver.com"

                ]

            },

            {

                "type": "field",

                "outboundTag": "proxy",

                "ip": [

                    "91.108.4.0/22",

                    "91.108.8.0/22",

                    "91.108.12.0/22",

                    "91.108.20.0/22",

                    "91.108.36.0/23",

                    "91.108.38.0/23",

                    "91.108.56.0/22",

                    "149.154.160.0/20",

                    "149.154.164.0/22",

                    "149.154.172.0/22",

                    "74.125.0.0/16",

                    "173.194.0.0/16",

                    "172.217.0.0/16",

                    "216.58.200.0/24",

                    "216.58.220.0/24",

                    "91.108.56.116",

                    "91.108.56.0/24",

                    "109.239.140.0/24",

                    "149.154.167.0/24",

                    "149.154.175.0/24"

                ]

            },

            {

                "type": "field",

                "outboundTag": "direct",

                "domain": [

                    "domain:12306.com",

                    "domain:51ym.me",

                    "domain:52pojie.cn",

                    "domain:8686c.com",

                    "domain:abercrombie.com",

                    "domain:adobesc.com",

                    "domain:air-matters.com",

                    "domain:air-matters.io",

                    "domain:airtable.com",

                    "domain:akadns.net",

                    "domain:apache.org",

                    "domain:api.crisp.chat",

                    "domain:api.termius.com",

                    "domain:appshike.com",

                    "domain:appstore.com",

                    "domain:aweme.snssdk.com",

                    "domain:bababian.com",

                    "domain:battle.net",

                    "domain:beatsbydre.com",

                    "domain:bet365.com",

                    "domain:bilibili.cn",

                    "domain:ccgslb.com",

                    "domain:ccgslb.net",

                    "domain:chunbo.com",

                    "domain:chunboimg.com",

                    "domain:clashroyaleapp.com",

                    "domain:cloudsigma.com",

                    "domain:cloudxns.net",

                    "domain:cmfu.com",

                    "domain:culturedcode.com",

                    "domain:dct-cloud.com",

                    "domain:didialift.com",

                    "domain:douyutv.com",

                    "domain:duokan.com",

                    "domain:dytt8.net",

                    "domain:easou.com",

                    "domain:ecitic.net",

                    "domain:eclipse.org",

                    "domain:eudic.net",

                    "domain:ewqcxz.com",

                    "domain:fir.im",

                    "domain:frdic.com",

                    "domain:fresh-ideas.cc",

                    "domain:godic.net",

                    "domain:goodread.com",

                    "domain:haibian.com",

                    "domain:hdslb.net",

                    "domain:hollisterco.com",

                    "domain:hongxiu.com",

                    "domain:hxcdn.net",

                    "domain:images.unsplash.com",

                    "domain:img4me.com",

                    "domain:ipify.org",

                    "domain:ixdzs.com",

                    "domain:jd.hk",

                    "domain:jianshuapi.com",

                    "domain:jomodns.com",

                    "domain:jsboxbbs.com",

                    "domain:knewone.com",

                    "domain:kuaidi100.com",

                    "domain:lemicp.com",

                    "domain:letvcloud.com",

                    "domain:lizhi.io",

                    "domain:localizecdn.com",

                    "domain:lucifr.com",

                    "domain:luoo.net",

                    "domain:mai.tn",

                    "domain:maven.org",

                    "domain:miwifi.com",

                    "domain:moji.com",

                    "domain:moke.com",

                    "domain:mtalk.google.com",

                    "domain:mxhichina.com",

                    "domain:myqcloud.com",

                    "domain:myunlu.com",

                    "domain:netease.com",

                    "domain:nfoservers.com",

                    "domain:nssurge.com",

                    "domain:nuomi.com",

                    "domain:ourdvs.com",

                    "domain:overcast.fm",

                    "domain:paypal.com",

                    "domain:paypalobjects.com",

                    "domain:pgyer.com",

                    "domain:qdaily.com",

                    "domain:qdmm.com",

                    "domain:qin.io",

                    "domain:qingmang.me",

                    "domain:qingmang.mobi",

                    "domain:qqurl.com",

                    "domain:rarbg.to",

                    "domain:rrmj.tv",

                    "domain:ruguoapp.com",

                    "domain:sm.ms",

                    "domain:snwx.com",

                    "domain:soku.com",

                    "domain:startssl.com",

                    "domain:store.steampowered.com",

                    "domain:symcd.com",

                    "domain:teamviewer.com",

                    "domain:tmzvps.com",

                    "domain:trello.com",

                    "domain:trellocdn.com",

                    "domain:ttmeiju.com",

                    "domain:udache.com",

                    "domain:uxengine.net",

                    "domain:weather.bjango.com",

                    "domain:weather.com",

                    "domain:webqxs.com",

                    "domain:weico.cc",

                    "domain:wenku8.net",

                    "domain:werewolf.53site.com",

                    "domain:windowsupdate.com",

                    "domain:wkcdn.com",

                    "domain:workflowy.com",

                    "domain:xdrig.com",

                    "domain:xiaojukeji.com",

                    "domain:xiaomi.net",

                    "domain:xiaomicp.com",

                    "domain:ximalaya.com",

                    "domain:xitek.com",

                    "domain:xmcdn.com",

                    "domain:xslb.net",

                    "domain:xteko.com",

                    "domain:yach.me",

                    "domain:yixia.com",

                    "domain:yunjiasu-cdn.net",

                    "domain:zealer.com",

                    "domain:zgslb.net",

                    "domain:zimuzu.tv",

                    "domain:zmz002.com",

                    "domain:samsungdm.com"

                ]

            },

            {

                "type": "field",

                "outboundTag": "block",

                "domain": [

                    "geosite:category-ads"

                ]

            },

            {

                "type": "field",

                "outboundTag": "direct",

                "ip": [

                    "geoip:private"

                ]

            },

            {

                "type": "field",

                "outboundTag": "direct",

                "ip": [

                    "geoip:cn"

                ]

            },

            {

                "type": "field",

                "outboundTag": "direct",

                "domain": [

                    "geosite:cn"

                ]

            }

        ]

    }

}

由233一键脚本改V2Ray跑Socks+TLS模式

 刚在油管看到个有意思的思路,尝试一下也成功了。只是客户端那边基本没便捷的适用方式,目前只能用读json来启用。

下面分享一下极速搭建方法

https://paste.ubuntu.com/p/jYgWf7HSCy/


bash <(curl -s -L https://git.io/v2ray.sh)
233一键脚本搭建ws tls服务端,
向导参数为 准备ip指向vps的域名www.vps服务端域名.com(下文同),内部端口48311-开启tls,分流路径/caddy



改好json 后重启服务 
nano /etc/v2ray/config.json

=============================服务端配置==========================================
{
    "inbounds": [
        {
            "port": 48311,
            "listen": "127.0.0.1",
            "protocol": "socks",
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "settings": {
                "auth": "noauth",
                "udp": false,
                "userLevel": 10
            },
            "streamSettings": {
				"network": "ws"
			}
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {
                
            }
        }
    ]
}

====================================================================================
============================客户端配置================================================
{
    "log": {
        "access": "",
        "error": "",
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "tag": "proxy",
            "port": 10809,
            "listen": "0.0.0.0",
            "protocol": "socks",
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "settings": {
                "auth": "noauth",
                "udp": true
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "socks",
            "settings": {
                "servers": [
                    {
                        "address": "www.vps服务端域名.com",
                        "port": 443
                    }
                ]
            },
            "streamSettings": {
                "network": "ws",
                "security": "tls",
                "wsSettings": {
                    "path": "/caddy"
                }
            }
        }
    ],
    "routing": {
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            {
                "type": "field",
                "inboundTag": [
                    "api"
                ],
                "outboundTag": "api"
            },
            {
                "type": "field",
                "outboundTag": "proxy",
                "domain": [
                    "geosite:google",
                    "geosite:github",
                    "geosite:netflix",
                    "geosite:steam",
                    "geosite:telegram",
                    "geosite:tumblr",
                    "geosite:speedtest",
                    "geosite:bbc",
                    "domain:gvt1.com",
                    "domain:textnow.com",
                    "domain:twitch.tv",
                    "domain:wikileaks.org",
                    "domain:naver.com"
                ]
            },
            {
                "type": "field",
                "outboundTag": "proxy",
                "ip": [
                    "91.108.4.0/22",
                    "91.108.8.0/22",
                    "91.108.12.0/22",
                    "91.108.20.0/22",
                    "91.108.36.0/23",
                    "91.108.38.0/23",
                    "91.108.56.0/22",
                    "149.154.160.0/20",
                    "149.154.164.0/22",
                    "149.154.172.0/22",
                    "74.125.0.0/16",
                    "173.194.0.0/16",
                    "172.217.0.0/16",
                    "216.58.200.0/24",
                    "216.58.220.0/24",
                    "91.108.56.116",
                    "91.108.56.0/24",
                    "109.239.140.0/24",
                    "149.154.167.0/24",
                    "149.154.175.0/24"
                ]
            },
            {
                "type": "field",
                "outboundTag": "direct",
                "domain": [
                    "domain:12306.com",
                    "domain:51ym.me",
                    "domain:52pojie.cn",
                    "domain:8686c.com",
                    "domain:abercrombie.com",
                    "domain:adobesc.com",
                    "domain:air-matters.com",
                    "domain:air-matters.io",
                    "domain:airtable.com",
                    "domain:akadns.net",
                    "domain:apache.org",
                    "domain:api.crisp.chat",
                    "domain:api.termius.com",
                    "domain:appshike.com",
                    "domain:appstore.com",
                    "domain:aweme.snssdk.com",
                    "domain:bababian.com",
                    "domain:battle.net",
                    "domain:beatsbydre.com",
                    "domain:bet365.com",
                    "domain:bilibili.cn",
                    "domain:ccgslb.com",
                    "domain:ccgslb.net",
                    "domain:chunbo.com",
                    "domain:chunboimg.com",
                    "domain:clashroyaleapp.com",
                    "domain:cloudsigma.com",
                    "domain:cloudxns.net",
                    "domain:cmfu.com",
                    "domain:culturedcode.com",
                    "domain:dct-cloud.com",
                    "domain:didialift.com",
                    "domain:douyutv.com",
                    "domain:duokan.com",
                    "domain:dytt8.net",
                    "domain:easou.com",
                    "domain:ecitic.net",
                    "domain:eclipse.org",
                    "domain:eudic.net",
                    "domain:ewqcxz.com",
                    "domain:fir.im",
                    "domain:frdic.com",
                    "domain:fresh-ideas.cc",
                    "domain:godic.net",
                    "domain:goodread.com",
                    "domain:haibian.com",
                    "domain:hdslb.net",
                    "domain:hollisterco.com",
                    "domain:hongxiu.com",
                    "domain:hxcdn.net",
                    "domain:images.unsplash.com",
                    "domain:img4me.com",
                    "domain:ipify.org",
                    "domain:ixdzs.com",
                    "domain:jd.hk",
                    "domain:jianshuapi.com",
                    "domain:jomodns.com",
                    "domain:jsboxbbs.com",
                    "domain:knewone.com",
                    "domain:kuaidi100.com",
                    "domain:lemicp.com",
                    "domain:letvcloud.com",
                    "domain:lizhi.io",
                    "domain:localizecdn.com",
                    "domain:lucifr.com",
                    "domain:luoo.net",
                    "domain:mai.tn",
                    "domain:maven.org",
                    "domain:miwifi.com",
                    "domain:moji.com",
                    "domain:moke.com",
                    "domain:mtalk.google.com",
                    "domain:mxhichina.com",
                    "domain:myqcloud.com",
                    "domain:myunlu.com",
                    "domain:netease.com",
                    "domain:nfoservers.com",
                    "domain:nssurge.com",
                    "domain:nuomi.com",
                    "domain:ourdvs.com",
                    "domain:overcast.fm",
                    "domain:paypal.com",
                    "domain:paypalobjects.com",
                    "domain:pgyer.com",
                    "domain:qdaily.com",
                    "domain:qdmm.com",
                    "domain:qin.io",
                    "domain:qingmang.me",
                    "domain:qingmang.mobi",
                    "domain:qqurl.com",
                    "domain:rarbg.to",
                    "domain:rrmj.tv",
                    "domain:ruguoapp.com",
                    "domain:sm.ms",
                    "domain:snwx.com",
                    "domain:soku.com",
                    "domain:startssl.com",
                    "domain:store.steampowered.com",
                    "domain:symcd.com",
                    "domain:teamviewer.com",
                    "domain:tmzvps.com",
                    "domain:trello.com",
                    "domain:trellocdn.com",
                    "domain:ttmeiju.com",
                    "domain:udache.com",
                    "domain:uxengine.net",
                    "domain:weather.bjango.com",
                    "domain:weather.com",
                    "domain:webqxs.com",
                    "domain:weico.cc",
                    "domain:wenku8.net",
                    "domain:werewolf.53site.com",
                    "domain:windowsupdate.com",
                    "domain:wkcdn.com",
                    "domain:workflowy.com",
                    "domain:xdrig.com",
                    "domain:xiaojukeji.com",
                    "domain:xiaomi.net",
                    "domain:xiaomicp.com",
                    "domain:ximalaya.com",
                    "domain:xitek.com",
                    "domain:xmcdn.com",
                    "domain:xslb.net",
                    "domain:xteko.com",
                    "domain:yach.me",
                    "domain:yixia.com",
                    "domain:yunjiasu-cdn.net",
                    "domain:zealer.com",
                    "domain:zgslb.net",
                    "domain:zimuzu.tv",
                    "domain:zmz002.com",
                    "domain:samsungdm.com"
                ]
            },
            {
                "type": "field",
                "outboundTag": "block",
                "domain": [
                    "geosite:category-ads"
                ]
            },
            {
                "type": "field",
                "outboundTag": "direct",
                "ip": [
                    "geoip:private"
                ]
            },
            {
                "type": "field",
                "outboundTag": "direct",
                "ip": [
                    "geoip:cn"
                ]
            },
            {
                "type": "field",
                "outboundTag": "direct",
                "domain": [
                    "geosite:cn"
                ]
            }
        ]
    }
}

2020年12月4日星期五

Ubuntu卸载Nginx / 升级或安装Nginx最新稳定版 & 安装

 转自

https://blog.csdn.net/qq_35556064/article/details/83069672


============卸载Nginx======================

没装过的可以忽略

1
2
3
4
5
6
7
sudo apt-get remove nginx nginx-common # 卸载删除除了配置文件以外的所有文件。
 
sudo apt-get purge nginx nginx-common # 卸载所有东东,包括删除配置文件。
 
sudo apt-get autoremove # 在上面命令结束后执行,主要是卸载删除Nginx的不再被使用的依赖包。
 
sudo apt-get remove nginx-full nginx-common #卸载删除两个主要的包。

上面的命令基本上都能解决你在Ubuntu下安装卸载Nginx的问题。


===================安装Nginx新版=======================


  1. Nginx版本介绍
    Nginx官网下载
    在这里插入图片描述
    Mainline version:正在开发阶段的版本,可能会有漏洞。
    Stable version:稳定版
    Legacy versions: 历史版本
    本次安装1.14.0的稳定版本

  2. 安装或升级
    需要添加源才能下载Nginx的稳定版本
    首先输入以下两条命令

 sudo wget http://nginx.org/keys/nginx_signing.key
 sudo apt-key add nginx_signing.key
  • 1
  • 2

在 /etc/apt/sources.list 文件中加入下面两行:

deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx
  • 1
  • 2

注意 codename 要根据系统来选择可以点击查看详细说明
在这里插入图片描述

sudo vim /etc/apt/sources.list
  • 1

如下图所示:
在这里插入图片描述
Ubuntu其他版本和系统平台更换codename即可
最后输入:

sudo apt-get update
sudo apt-get install nginx
  • 1
  • 2

输入nginx -v查看安装版本:
在这里插入图片描述
此外,/etc/nginx/下的目录结构:
在这里插入图片描述

2020年12月3日星期四

Oracle Cloud甲骨文免费VPS 梯子防火墙设置

 #Oracle自带的Ubuntu镜像默认设置了Iptable规则

#强制删除

apt-get purge netfilter-persistent -y && rm -rf /etc/iptables && reboot




#开放所有端口


sudo iptables -P INPUT ACCEPT

sudo iptables -P FORWARD ACCEPT

sudo iptables -P OUTPUT ACCEPT

sudo iptables -F

2020年11月26日星期四

R6300V2 美定制版刷koolshare梅林

先下载所需工具,点这里下载

最新版koolshare梅林点这里


我下文设备对应正面底部为蓝色的美版特定机型

0-原厂美版固件,恢复出厂设置

1-开启windows组件 telnet client

2-telnetenable.exe放进C:/user/用户里(即计算机-下载-的上一页根目录)


3-进192.168.1.1,抄下192.168.1.1 LAN局域网的MAC,例如11:22:33:44:55


4:电脑开启CMD命令行管理员模式,输入下面开启telnet


telnetenable 192.168.1.1 1122334455 admin password


5-输入

telnet 192.168.1.1

回车,一般直接进入;

如果提示输入账号密码,则输入我们设置的密码


输入命令

burnboardid U12H240T00_NETGEAR

修改后会显示OK。

再输入

nvram set board_id=U12H240T00_NETGEAR

然后进192.168.1.1刷2-R6300v2-V1.0.4.36_10.0.93.chk正式版固件


再在官方固件-刷2-factory-to-dd-wrt.chk 过渡固件

192.168.1.1设置用户名root密码admin


在顶部一排按钮中找到administrator-update firmware-上传3-R6300V2_merlin_1.2.trx


进入192.168.1.1梅林后,左上角跳过-随便输wifi密码

系统管理-恢复出厂设置

重进主菜单后,刷顶部最新koolshare梅林R6300V2_380.70_0-X7.9.1-koolshare.trx


那个是koolshare梅林380固件。之后就完事了。


屏蔽koolshare拦截科学插件:


系统管理-系统设置-Enable SSH

进ssh 输入

sed -i 's/\tdetect_package/\t# detect_package/g' /koolshare/scripts/ks_tar_install.sh


以后找380的插件安装即可。工具压缩包里有ss离线安装包,支持trojan


trojan写法:




2020年11月14日星期六

同济 世纪互联 SharePoint onemanager URL重定向

从头操作一次

进入下面网址,获得site-id

https://od.xkx.me/sp.php 


网页进入SharePoint第一个盘,url复制下来,用于填图上。


rclone config
n
起名字
23or24
true
挂21VN世纪互联

下面CMD获取token
cd C:\Users\Administrator\Desktop\rclone\

rclone authorize onedrive "dd9ba43d-9520-4659-baae-e9ca449b1cae" "esB30EN]9kp=y.nPWN6QMLBsrdq-wBrt" --onedrive-is-21vianet-version=true

粘贴进rclone回车后
选择4
粘贴上面site-id(非常长一段)

找到一个盘:0-文档

选中就完成了。


ssh展示

Choose a number from below, or type in an existing value
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Root Sharepoint site
   \ "sharepoint"
 3 / Type in driveID
   \ "driveid"
 4 / Type in SiteID
   \ "siteid"
 5 / Search a Sharepoint site
   \ "search"
Your choice> 4
Paste your Site ID here> universitytongji.sharepoint.cn,3a6c9cf5-3b08a284cfe,1252308e-84ca-4-41e697ad9d3f
Found 1 drives, please select the one you want to use:
0: 文档 (documentLibrary) id=b!9ZxsOv47_0SDd4JAiihM_o4wUbnC_
Chose drive to use:> 0






onemanager 自己API 重定向 URI填下面那个
https://scfonedrive.github.io

怎么看,在跳转到登陆世纪互联时,url复制下来,看下面红字
https://login.partner.microsoftonline.cn/common/oauth2/v2.0/authorize?scope=https%3A%2F%2Fmicrosoftgraph.chinacloudapi.cn%2FFiles.ReadWrite.All+offline_access&response_type=code&client_id=2e0a9e3d-b423-4932-8e8e-4df1cd366ac2&redirect_uri=https://scfonedrive.github.io&state=https%3A%2F%2F9tvz6vv0ryv1r.cfc-execute.gz.baidubce.com%2F%257Bfilepath%2B%257D%2F


2020年11月4日星期三

linux守护进程 脚本

 脚本三:

这个脚本是博士在网友“小Q主人”那里获得的,这个linux脚本是windows进程守护脚本设计思路编写的。

将下面的代码保存为frps.sh放入frp程序目录

Bash
cd /root/frp/
start='./frps -c ./frps.ini'

while :
do
echo [`date`]restart\"$start\" > /root/restartfrps.log
$start
done


cd /root/frp/为你的文件路径

使用方法

Bash

sh ./frps.sh

kill了frpc进程后 脚本起作用了马上又恢复了frpc进程,效果还是可以的。



来源http://diannaobos.com/post/769.html

openwrt在线编译 插件名字查找

openwrt在线编译 https://firmware-selector.staging.immortalwrt.org/ 插件名字查找 https://downloads.staging.immortalwrt.org/releases/23.05.1/packages/x8...