本文最后更新于 436 天前,其中的信息可能已经有所发展或是发生改变。
/etc/systemd/system/XXXXX.service
| [Unit] |
| Description=XXXXX |
| |
| [Service] |
| Type=simple |
| User=root |
| WorkingDirectory=/ |
| ExecStart=[shell] |
| Restart=always |
| RestartSec=1 |
| StartLimitIntervalSec=0 |
| |
| [Install] |
| WantedBy=multi-user.target |
systemctl daemon-reload
| a2enmod ssl |
| a2enmod rewrite |
| a2enmod proxy proxy_balancer proxy_http |
| systemctl restart apache2 |
/etc/apache2/ports.conf
| |
| |
| |
| |
| Listen 80 |
| |
| <IfModule ssl_module> |
| Listen 443 |
| </IfModule> |
| |
| <IfModule mod_gnutls.c> |
| Listen 443 |
| </IfModule> |
| |
| |
/etc/apache2/sites-enabled/000-default.conf
| <VirtualHost *:80> |
| ServerAdmin jbnrz@localhost |
| DocumentRoot /var/www/html |
| ServerName jbnrz.com.cn |
| |
| RewriteEngine on |
| RewriteCond %{HTTPS} !=on |
| RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R] |
| RemoteIPProxyProtocol on |
| ErrorLog ${APACHE_LOG_DIR}/error.log |
| CustomLog ${APACHE_LOG_DIR}/access.log combined |
| </VirtualHost> |
| |
| <VirtualHost *:443> |
| ServerAdmin jbnrz@localhost |
| DocumentRoot /var/www/html |
| |
| ServerName jbnrz.com.cn |
| |
| SSLEngine on |
| |
| SSLCertificateFile /home/jbnrz/ssl/jbnrz.com.cn.crt |
| |
| SSLCertificateKeyFile /home/jbnrz/ssl/jbnrz.com.cn.key |
| |
| SSLCertificateChainFile /home/jbnrz/ssl/root_bundle.crt |
| RemoteIPProxyProtocol on |
| ErrorLog ${APACHE_LOG_DIR}/error.log |
| CustomLog ${APACHE_LOG_DIR}/access.log combined |
| <Directory "/var/www/html"> |
| Options FollowSymLinks |
| </Directory> |
| |
| </VirtualHost> |
| [global] |
| timeout = 6000 |
| index-url = https://pypi.tuna.tsinghua.edu.cn/simple |
| trusted-host = pypi.tuna.tsinghua.edu.cn |
Ubuntu 20.04
/etc/apt/sources.list
| # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 |
| deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse |
| deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse |
| deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse |
| # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse |
| |
| # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse |
| # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse |
| |
| deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse |
| # deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse |
| |
| # 预发布软件源,不建议启用 |
| # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse |
| # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse |
| deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse |
| deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse |
| |
| deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse |
| deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse |
| |
| deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse |
| deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse |
| |
| # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse |
| # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse |
| |
| deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse |
| deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse |
/home/username/.config/clash/
| config.yaml 从 windows 导出 |
| |
| Country.mmdb 从 https://github.com/esrrhs/pingtunnel/blob/master/GeoLite2-Country.mmdb 下载 |
| 换源 |
| |
| apt |
| apt |
| |
| apt install open-vm-tools-desktop |
frpc.ini
| [common] |
| tls_enable = true |
| server_addr = ip |
| server_port = 7000 |
| token = token |
| |
| [test web] |
| type = tcp |
| local_ip = 127.0.0.1 |
| local_port = 80 |
| remote_port = 80 |
frps.ini
| [common] |
| bind_port = 7000 |
| dashboard_addr = 0.0.0.0 |
| dashboard_port = 1234 |
| dashboard_user = user |
| dashboard_pwd = pwd |
| enable_prometheus = true |
| pprof_enable = true |
| token = token |
| 关闭:echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all |
| 开启:echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all |