安装相关程序环境
| 1 | sudo apt-get install php5 | 
Clone位于GitHub上的manyuser项目的Repo
cd /home/shangxin
mkdir www
git clone https://github.com/YoungSx/shadowsocks-manyuser.git backen
在https://github.com/orvice/ss-panel/releases下载Latest release的包,解压到www
数据库操作
登陆mysql1
mysql -u root -p
执行以下两条SQL语句,1是创建shadowsocks数据库,2是创建一个ss用户密码为22222,并赋予权限
| 1 | CREATE DATABASE IF NOT EXISTS shadowsocks DEFAULT CHARSET utf8 COLLATE utf8_general_ci; | 
导入数据库
| 1 | USE shadowsocks | 
配置数据库信息
将 lib/config-sample.php 重命名为 config.php,并编辑数据库信息.
加密方式改为2
当使用新的加密方式「带salt的sha256」加密,由于每个站点的$salt值都不同,所以初始密码「1993」是没有用的,安装完成后,访问/pwd.php?pwd=密码
得到的字符串是encode后的密码,需要插入到数据库中
| 1 | update user set pass="加密后的密码字符串",email="你的邮箱" where email="first@blood.com"; | 
安装各种依赖
| 1 | cd /home/shangxin/www | 
ManyUser配置
| 1 | gedit /home/shangxin/www/backend/shadowsocks/Config.py | 
使用supervisor进程守护
安装supervisor
| 1 | apt-get install python-pip python-m2crypto supervisor | 
编辑文件
| 1 | gedit /etc/supervisor/conf.d/shadowsocks.conf | 
输入(dir路径记得修改,路径千万不要多空格!!!)
| 1 | [program:shadowsocks] | 
启动
| 1 | service supervisor start | 
修改以下文件
/etc/profile
/etc/default/supervisor
| 1 | 结尾各添加3行 | 
debug查看日志
| 1 | supervisorctl tail -f shadowsocks stderr | 
启动/重启/停止
| 1 | supervisorctl start shadowsocks | 
Apache2的配置
| 1 | sudo gedit /etc/apache2/sites-available/000-default.conf | 
加入Include httpd.conf
根目录改成 /home/shangxin/www/
/etc/apache2/目录下新建httpd.conf,文件内容“ServerName localhost”
| 1 | sudo apt-get install libapache2-mod-auth-mysql | 
重启Apache2
| 1 | sudo /etc/init.d/apache2 restart | 
Mysql远程访问解决方案:
1 在目标服务器上(192.168.1.11),修改mysql的my.cnf文件:
sudo vi /etc/mysql/my.cnf
2 注释掉bind-address,屏蔽其只对本地监听
| 1 | #bind-address = 127.0.0.1 | 
3 启动MySQL服务,使其修改的配置生效
| 1 | sudo restart mysql | 
参考:
https://github.com/orvice/ss-panel
https://github.com/mengskysama/shadowsocks/tree/manyuser
踩过的坑:
http://stackoverflow.com/questions/32264309/errors-while-using-a-laravel-5-boilerplate
http://www.2cto.com/os/201308/238996.html
http://blogsit.iteye.com/blog/1944415
https://www.zmrbk.com/post-2583.html
http://www.111cn.net/sys/202/47318.htm