目录
由于某些需求,个人需要做这个记录,其他的小伙伴有需求也可以借鉴:
第一步:安装lnmp
安装搭建网站的环境(lnmp)和搭建网站:
安装lnmp指南:地址
(先不要把域名解析到这个网站,等下边第二步弄完以后在解析和配置安装网站,也就是你可以先执行第二步,在执行第一步,在解析域名和配置网站)
第二步:安装ss+v2ray-plugin
安装ss+v2ray-plugin:地址
# Installation
## CentOS 7/8
wget -O centos-ss-install.sh https://github.com/M3chD09/shadowsocks-with-v2ray-plugin-install/raw/master/centos-ss-install.sh
chmod +x centos-ss-install.sh
./centos-ss-install.sh
## Ubuntu 18.04/16.04 or Debian 9/10
wget -O ubuntu-ss-install.sh https://github.com/M3chD09/shadowsocks-with-v2ray-plugin-install/raw/master/ubuntu-ss-install.sh
chmod +x ubuntu-ss-install.sh
./ubuntu-ss-install.sh
# Manage shadowsocks with systemctl
systemctl status shadowsocks
systemctl start shadowsocks
systemctl stop shadowsocks
第三步:开始修改配置了
安装完成后配置文件的目录/etc/shadowsocks-libev/config.json
{
"server":"0.0.0.0",
"server_port":443,
"password":"password",
"timeout":300,
"method":"aes-256-gcm",
"plugin":"v2ray-plugin",
"plugin_opts":"server;cert=/path/cert.pem;key=/path/key.pem;host=yourhost;loglevel=none" }
默认配置文件是没有经过nginx转发, 直接连接SS服务端, 开启443端口, 所以需要证书. 如果经过nginx
转发需要简单修改一下配置文件, 端口是nginx转发端口, 不再需要证书, 因为证书已经配置在nginx上
了. 可能有路径.
{
"server":"0.0.0.0",
"server_port":3389,
"password":"passwd",
"timeout":300,
"method":"aes-256-gcm",
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp",
"plugin":"v2ray-plugin",
"plugin_opts":"server;path=/vjsun; loglevel=none;tls;cert=/usr/local/nginx/conf/ssl/localhost/fullchain.cer;key=/usr/local/nginx/conf/ssl/localhost/localhost.key;"
}
重新启动ss service shadowsocks restart
服务器端nginx配置
服务器nginx之前已经配置过v2ray相关转发, 在这里只需要拷贝v2ray转发, 修改一下转发端口即可.
location /vjsun {
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://localhost:3389;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
重启一下nginx, lnmp restart
自动启文件地址:/lib/systemd/system/shadowsocks.service
运行shadowsocks.service
systemctl start shadowsocks.service
允许开机自动启动
systemctl enable shadowsocks.service
查看运行状态
systemctl status shadowsocks.service
客户端设置:地址
解决问题:
This system doesn't provide enough entropy to quickly generate high-quality random numbers
原因也正如提示中所说,系统没有足够的熵,这时候可以通过安装rng-tools来解决这个问题
如果不安装rng-tools,等待一定的时间后,服务也可以正常运行,至于用还是不用,请自行取舍
安装rng-tools:
apt-get update
apt-get install rng-tools
编辑配置文件:
vi /etc/default/rng-tools
添加如下内容:
HRNGDEVICE=/dev/urandom
1