- == 系统问题,暂停聊天功能。==
- 【征集】西西河的经济学,及清流措施,需要主动参与者,『稷下学宫』新认证方式,24年网站打算和努力目标
主题:shadowsocks的配置(2016年) -- 杨微粒
ss的配置
服务器端
shadowsocks的安装其实很简单,安装好debian8之后在root下:
apt-get install python-pip
pip install shadowsocks
在后台运行(同样需要root):
ssserver -p 8388 -k password -m aes-256-cfb --user nobody -d start
远程编辑/etc/shadowsocks/config.json文件的内容为:
{
"server":"0.0.0.0",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
sudo /usr/local/bin/ssserver -c /etc/shadowsocks/config.json -d start
开机启动
开机启动由于debian8使用了新的systemd,直接编辑/etc/rc.local不可。编辑完/etc/rc.local后,修改/etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=oneshot
ExecStart=/etc/rc.local
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
然后
sudo systemctl enable /etc/systemd/system/rc-local.service
sudo systemctl start rc-local.service
本地端
我的本地也是debian8。安装shadowsocks:
sudo aptitude install shadowsocks
本地编辑/etc/shadowsocks/config.json文件的内容为:
{
"server":"xxx.xxx.xxx.xxx",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"workers": 1
}
然后运行
sslocal -c /etc/shadowsocks/config.json
/usr/bin/chromium --proxy-server="socks5://127.0.0.1:1080"
同样可以让它自启动。
参考:
shadowsocks/README.md at master · shadowsocks/shadowsocks · GitHub
https://github.com/shadowsocks/shadowsocks/blob/master/README.md
求助:Archlinux在转向systemd之后,如何开机自启动自定义脚本?(已解决!)
http://forum.ubuntu.org.cn/viewtopic.php?f=155&t=395231
Configure Multiple Users · shadowsocks/shadowsocks Wiki · GitHub
https://github.com/shadowsocks/shadowsocks/wiki/Configure-Multiple-Users
shadowsocks的多用户配置(死链接)
http://everet.org/shadowsocks.html
{
"server": "0.0.0.0",
"port_password": {
"8381": "foobar1",
"8382": "foobar2",
"8383": "foobar3",
"8384": "foobar4"
},
"timeout": 300,
"method": "aes-256-cfb"
}
文档中的这种写法使用软件源里面的ss2.1.0是不行的。需要新版ss。
git clone https://github.com/mengskysama/shadowsocks-rm.git
gitlab的安装
首先按照官方教程来,在服务器上运行以下操作:
1. Install and configure the necessary dependencies
If you install Postfix to send email please select 'Internet Site' during setup. Instead of using Postfix you can also use Sendmail orconfigure a custom SMTP server. If you wish to use Exim, please configure it as an SMTP server.
On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.
sudo apt-get install curl openssh-server ca-certificates postfix
2. Add the GitLab package server and install the package
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
If you are not comfortable installing the repository through a piped script, you can find the entire script here.
3. Configure and start GitLab
sudo gitlab-ctl reconfigure
4. Browse to the hostname and login
Username: root
Password: 5iveL!fe
然后会在添加SSH key 的时候出现500错误。经查发现是调用ssh的时候无法分配足够内存而出错。因而给服务器的系统增加一个swapfile。
You need to create a swap file. Try the following steps to see if this works:
dd if=/dev/zero of=/swapfile bs=2048k count=1000
mkswap /swapfile
swapon /swapfile
swapon -s
chown root:root /swapfile
chmod 0600 /swapfile
echo 10 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
If this works you can make it permanent by editing the following file: #nano /etc/fstab
add this line :
/swapfile none swap sw 0 0
然后去网页上看,发现clone地址里面还有http://gitlab.example.com。于是修改/var/opt/gitlab/gitlab-rails/etc/gitlab.yml,将host哪一行改成机器的IP。然后在本地运行:
git remote add gitlab [email protected]:yx_wh/manga-translation.git
并试图 git push gitlab master,但是失败,系统询问我git的用户密码。于是进入服务器的/var/opt/gitlab/.ssh ,删除authorized_keys.lock并保证权限正确。
最后终于push成功。
参考:
Download GitLab Community Edition (CE)
https://about.gitlab.com/installation/
Gitlab 500 error when adding/removing SSH key
https://stackoverflow.com/questions/26777690/gitlab-500-error-when-adding-removing-ssh-key
GitLab git user password
https://stackoverflow.com/questions/15495843/gitlab-git-user-password
编辑于 2016-05-27
没搞过Linux......
但是,windows 10可以从应用商店装Linux的,Ubuntu和Fedora都有,然后bash就进去了。
Ubuntu是基于Debian,理论上上面的步骤可以一模一样。
有空我也试试。
都不用安装的,秒速翻墙,节点不能用了就去更新一下
更新下。。。我用的win7,有一个节点信息需要拷贝进去,其他就没了
不过现在翻墙是在没啥可看的,我连翻墙的动力都没有了,出去是一脸茫然
服务器端:
windows版设置更简单,只要一个config.json配置文件。
https://github.com/shadowsocks/shadowsocks-go/releases
有比较旧的编译好的windows版, shadowsocks-server-win32-1.1.5.zip
客户端
更简单,图形设置界面.
https://github.com/shadowsocks/shadowsocks-windows/releases
这个周末我试试。。。。
现在上西西河,整天提心吊胆,不知道啥时候就被屏蔽掉了,我还是先做好准备。。。。
用supervisor实现开机自动启动,非常方便。
http://liyangliang.me/posts/2015/06/using-supervisor/
- 待认可未通过。偏要看