Install Deployment Shadowsocks (centos/debian/ubuntu/windows) in Linux systems

Source: Internet
Author: User
Tags json vps goagent in python

The former is LIBUV version, just for mobile phone use, but later Millet update system, shadowsocks on my phone is always flashing, goagent also flash back, the only use is fqrouter. Recently shadowsocks Update, millet also updated, netizens let me try, the results did not flash back, so I intend to reinstall the Shadowsocks on the VPS.
Shadowsocks installation is divided into two parts, one is server-side deployment, the other is client deployment. Here first the server-side deployment, that is, centos/debian/ubuntu/windows installation shadowsocks service side.
Service side (the shadowsocks installed here is the Python version):
Install the Shadowsocks service side for Debian/ubuntu:
Apt-get Install Python-pip
Pip Install Shadowsocks
Install Shadowsocks service end for CentOS;
Yum Install Python-setuptools
Easy_install pip
Pip Install Shadowsocks
If the VPS is windows, then install the Shadowsocks server by looking for the following method:
Download the OpenSSL that installs the Windows version. Linux does not need to be installed again because it has been brought in by itself. Then, like a Linux installation, install the Easy_install and Pip, and then install the shadowsocks. Have experience in Python programming, sure, until you install it.
Configure the Shadowsocks service side:
Create the Shadowsocks.json file in the/etc directory and put the following:
{
"Server": "My_server_ip",
"Server_port": 8388,
"Local_address": "127.0.0.1",
"Local_port": 1080,
"Password": "MyPassword",
"Timeout": 300,
"Method": "AES-256-CFB",
"Fast_open": false,
"Workers": 1
}
Explanation of each field:
Server service-side listening address, the service can be filled 0.0.0.0
Server_port the port of the server (as long as you do not conflict with the existing port, as you fill out, I fill in 8137)
Local_address Local listening address, write directly 127.0.0.1
Local_port local port, casually write, as long as not conflict, I filled in is 1345
Password your shadowsocks connection password.
Timeout timeout, per second
Method encryption. The default is: "AES-256-CFB", see the following: see Https://github.com/clowwindy/shadowsocks/wiki/Encryption
Workers should be the number of processes, this I do not have, we can change to see if the process has increased. Do not understand the conversion, do not change, this parameter is only available under Unix/linux.
Then start running the shadowsocks server side:
Ssserver-c/etc/shadowsocks.json
Do not close the Terminal Command Action window at this time, and then go to http://sourceforge.net/projects/shadowsocksgui/files/dist/to download the Shadowsocks client under Windows, and note that The downloaded file ends with XX.TAR.XZ, a new compression method. First install 7zip, it is all for Xx.tar, and then casually with RAR or 7ZP continue to extract, the executable file.
Then, will just set the parameters, fill in the corresponding location, click Save, and then configure the browser agent, the corresponding local port to the settings you just set, you can have no obstruction of the Internet.
Command line arguments:
You can change the settings in Config.json with the following command-line arguments:
Sslocal-s server_addr-p server_port-l local_port-k password-m BF-CFB
Ssserver-p server_port-k password-m BF-CFB--workers 2
Ssserver-c/etc/shadowsocks/config.json
You can view all parameters using-H.
Wiki address: Https://github.com/clowwindy/shadowsocks/wiki
Here is how to run the shadowsocks background. Because according to the above method, as long as closes the terminal window, then the shadowsocks process also interrupted, we cannot through shadowsocks the surfer. So, we can use supervisor to start and manage the monitoring shadowsocks process.
Under Debian:
Run:
Apt-get Update
Apt-get Install PYTHON-PIP Python-m2crypto Supervisor
Pip Install Shadowsocks
Edit/etc/supervisor/conf.d/shadowsocks.conf to add the following:
[Program:shadowsocks]
Command=ssserver-c/etc/shadowsocks.json
Autorestart=true
User=nobody
and add the following line to the back of the/etc/default/supervisor file:
Ulimit-n 51200
Then run the command and start supervisor:
Service Supervisor Start
Supervisorctl Reload
Now the supervisor has started.
Supervisorctl tail-f shadowsocks stderr//view shadowsocks Log
Supervisorctl Restart Shadowsocks//restart Shadowsocks process
Supervisorctl start shadowsocks//starting shadowsocks process
Supervisorctl Stop shadowsocks//stops Shadowsocks process
Centos:
To run the command:
sudo yum install PYTHON-PIP supervisor
sudo pip install Shadowsocks
Edit/etc/supervisord.conf Add at the end:
[Program:shadowsocks]
Command=ssserver-c/etc/shadowsocks.json
Autorestart=true
User=nobody
Run:
sudo chkconfig--add supervisord//Add Boot Boot Supervisor Service Daemon
sudo chkconfig supervisord on
Service Supervisord Start//official git on the wrong, will "Supervisord" less a D, otherwise prompted supervisor:unrecognized service, meaning that the service is not recognized
Supervisorctl Reload//can reboot the shadowsocks via this command.
Supervisord is a background Management server that is used to manage the daemon process based on the policy of the profile, which automatically starts with the system
Supervisorctl for administrator to send start/restart/stop instructions to Admin program;
The next step seems to be dispensable, I did not add this rule in the iptables, did not encounter problems:
-A input-m state--state new-m tcp-p TCP--dport your_server_port-j ACCEPT
One of the your_server_port represents the port of the server you just shadowsocks. Represents this port that allows the VPS to be connected.


After everything is done, you can surf the Internet. Goagent anyway in my this has been abolished. The rest of the mobile client configuration, you can directly scan the computer client's two-dimensional code to save the trouble of manual configuration, but the only pity is that the mobile phone client can not be deployed everywhere, but the computer client, in the Shadowsockis directory.
Fqrouter can also use the Shadowsocks configuration.

Android installation Shadowsocks, if you do not give root permissions, is the VPN mode, but not stable, with the use of automatic exit. And the root mode does not have this problem, and the speed is stable, so I have been given it root permissions.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.