Confirm python version
|
[ec2-user@ ~]$ python -V Python 2.6.9 |
so we need to install PIP [python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip by default ] Install PIP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
[ec2-user@ ~]$ wget https://bootstrap.pypa.io/get-pip.py --2015-03-17 05:23:37-- https://bootstrap.pypa.io/get-pip.py Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 199.27.76.175 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|199.27.76.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1608741 (1.5M) [text/x-python] Saving to: ‘get-pip.py’ get-pip.py 100%[===========================>] 1.53M --.-KB/s in 0.1s [ec2-user@ ~]$ sudo python get-pip.py Collecting pip Downloading pip-6.0.8-py2.py3-none-any.whl (1.3MB) 100% |################################| 1.3MB 376kB/s Installing collected packages: pip Successfully installed pip-6.0.8 |
Install Shadowsocks
|
[ec2-user@ ~]$ sudo pip install shadowsocks Collecting shadowsocks Downloading shadowsocks-2.6.8.tar.gz Installing collected packages: shadowsocks Running setup.py install for shadowsocks Installing sslocal script to /usr/bin Installing ssserver script to /usr/bin Successfully installed shadowsocks-2.6.8 |
Config Shadowsocks Server
|
[ec2-user@ ~]$ sudo vi /etc/security/limits.conf |
Add these two lines below
|
* soft nofile 51200 * hard nofile 51200 |
Then tune the kernel parameters
|
[ec2-user@ ~]$ sudo vi /etc/sysctl.conf |
Add these lines below (example)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
fs.file-max = 51200 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.core.netdev_max_backlog = 250000 net.core.somaxconn = 4096 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 0 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 1200 net.ipv4.ip_local_port_range = 10000 65000 net.ipv4.tcp_max_syn_backlog = 8192 net.ipv4.tcp_max_tw_buckets = 5000 net.ipv4.tcp_fastopen = 3 net.ipv4.tcp_mem = 25600 51200 102400 net.ipv4.tcp_rmem = 4096 87380 67108864 net.ipv4.tcp_wmem = 4096 65536 67108864 net.ipv4.tcp_mtu_probing = 1 net.ipv4.tcp_congestion_control = hybla |
Start Shadowsocks […]