#二次更新# Alpine Linux下搭建酸酸乳一键脚本
二次更新说明:
由于ssrr项目被移除,更新安装程序。替换为博客备份版本。
安装Alpine Linux: Linux下OpenVZ平台Alpine Linux一键安装脚本
重装Alpine Linux后的内存占用:
下面上安装脚本:
(建议使用上面的来重装,如果是Docker pull的Alpine的话,没有包含rc-update服务,无法实现开机自启,需要手动启动。)
apk update
apk add py3-lxml
apk add python3
pip3 install pip==10.0.0
pip3 freeze
apk add --no-cache --virtual .build-deps tar
apk add --no-cache --virtual .build-deps wget
apk add --no-cache --virtual .build-deps openssl
apk add --no-cache --virtual .build-depslibsodium-dev
apk add curl unzip
cd /usr/local/
curl -O https://cikeblog.com/s/shadowsocksr.zip
unzip shadowsocksr.zip
cd /usr/local/shadowsocks/shadowsocks
echo '{
"server":"0.0.0.0",
"server_ipv6":"::",
"server_port":9000,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"password0",
"timeout":120,
"method":"aes-256-cfb",
"protocol":"origin",
"protocol_param":"",
"obfs":"plain",
"obfs_param":"",
"redirect":"",
"dns_ipv6":false,
"fast_open":true,
"workers":1
}' >1.json
nohup python3 /usr/local/shadowsocks/shadowsocks/server.py -c /usr/local/shadowsocks/shadowsocks/1.json &
echo "nohup python3 /usr/local/shadowsocks/shadowsocks/server.py -c /usr/local/shadowsocks/shadowsocks/1.json & " >/etc/local.d/ss.start
chmod +x /etc/local.d/ss.start
rc-update add local
apk add py3-lxml
apk add python3
pip3 install pip==10.0.0
pip3 freeze
apk add --no-cache --virtual .build-deps tar
apk add --no-cache --virtual .build-deps wget
apk add --no-cache --virtual .build-deps openssl
apk add --no-cache --virtual .build-depslibsodium-dev
apk add curl unzip
cd /usr/local/
curl -O https://cikeblog.com/s/shadowsocksr.zip
unzip shadowsocksr.zip
cd /usr/local/shadowsocks/shadowsocks
echo '{
"server":"0.0.0.0",
"server_ipv6":"::",
"server_port":9000,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"password0",
"timeout":120,
"method":"aes-256-cfb",
"protocol":"origin",
"protocol_param":"",
"obfs":"plain",
"obfs_param":"",
"redirect":"",
"dns_ipv6":false,
"fast_open":true,
"workers":1
}' >1.json
nohup python3 /usr/local/shadowsocks/shadowsocks/server.py -c /usr/local/shadowsocks/shadowsocks/1.json &
echo "nohup python3 /usr/local/shadowsocks/shadowsocks/server.py -c /usr/local/shadowsocks/shadowsocks/1.json & " >/etc/local.d/ss.start
chmod +x /etc/local.d/ss.start
rc-update add local
把上面的代码复制到终端执行即可,最好一行行复制执行。
安装完成后,我们执行:
netstat -ntlp
查看shadowsocksr运行状态,如果需要修改端口和加密方式的话,请修改/root/1.json即可,由于Alpine的运行方式,我们修改后需要kill掉ss的进程,再执行:
nohup python3 /usr/local/shadowsocks/shadowsocks/server.py -c /usr/local/shadowsocks/shadowsocks/1.json &
来进行后台守护,如果觉着麻烦,直接写进/bin目录下,作为程序运行也可以。
安装完成后重启,包含ss和系统的内存占用如下:
因为ShadowsocksR的进程会递增,如果小内存的vps的话,可以考虑下更换为Shadowsocks-go等占用小的程序运行。后面说不定我会发布ss版本的Alpine。
继续阅读
- 上一篇 >:CentOS 7 一键安装桌面环境(可远程RDP连接)
- 下一篇 >:Linux使用指定用户运行程序