Installation and use of CentOS Pip and Shadowsocks

Source: Internet
Author: User
Tags centos iptables port number server port

There are many Python programs that can be installed directly through the PIP, such as the well-known Django, Markdown, Shadowsocks, and so on.


Briefly describe the use of the PIP (to install shadowsocks examples):
1. Installation package
Pip Install Shadowsocks
2, list the installed packages
Pip Freeze
3, install a specific version of the package
Pip Install shadowsocks=1.3.3′
Pip Install shadowsocks>1.0,<1.3.3′
4, upgrade the installed package to the latest version
Pip Install-u shadowsocks
5, uninstall the installed package
Pip Uninstall Shadowsocks
6, the query has been installed package
Pip Search "Shadowsocks"

You must install Setuptools before installing the PIP, and you must install Python before installing Setuptools, which is dependent on the installation process. Therefore, the whole process is still more troublesome.
1, check the Python version
Python–version
The Python version of the CentOS6.5 default installation is 2.6.6, and the return value is: Python 2.6.6
2. Installation Setuptools
Yum Install-y Python-setuptools
Once the installation is complete, the Easy_install command is ready to use.
3. Install Pip
Easy_install pip
Installing the PIP via Easy_install is the easiest way to do it. The PIP is installed to the/usr/bin directory by default.
4. Installation Shadowsocks
Pip Install Shadowsocks
As of now, the Shadowsocks version installed via PIP is 1.3.3

Configuration and use of Shadowsocks
As for what Shadowsocks can do, there is no need to repeat them here. Let's go straight ahead.
1, create the Shadowsocks profile:
CentOS This configuration through vim, run the command:
Vi/etc/config.json
The contents are as follows:

{
"Server": "My_server_ip",
"Server_port": 8989,
"Local_port": 1080,
"Password": "Teddysun.com",
"Timeout": 600,
"Method": "AES-256-CFB"
The meaning of each field:
Server server IP (ipv4/ipv6), note that this will also be the IP address that the service side listens to
Server_port Server Port
Local_port Local Port
Password used by password to encrypt
Timeout timeout (seconds)
Method of encryption, you can choose "BF-CFB", "AES-256-CFB", "DES-CFB", "Rc4″, and so on." Default is an unsecured encryption, recommended by the "AES-256-CFB"

Once created, give permissions:
chmod 755/etc/config.json

2. Installation M2crypto
Default encryption Method table is fast, but not safe. Recommended use of "AES-256-CFB" or "BF-CFB". Please do not use "Rc4″, it is not safe." If you select an encryption other than "table", you need to install M2crypto.
To install the dependency pack first:

Yum install-y openssl-devel gcc swig python-devel autoconf installation Libtool:

wget--no-check-certificate https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
Python ez_setup.py install then install M2crypto via PIP:
Pip Install M2crypto

3. Installation Gevent
Installing gevent can improve the performance of shadowsocks. CentOS under installation gevent dependent on libevent and Greenlet.
Install Libevent:
Yum Install-y libevent
Install Greenlet:
Pip Install Greenlet
Install Gevent:
Pip Install Gevent

4. Command-Line arguments (server-side startup command)
Ssserver-c/etc/config.json
If you want to run shadowsocks in the background, start the command as follows:

Nohup ssserver-c/etc/config.json >/dev/null 2>&1 & Remarks: About Nohup, is the command that can let the program run in the background, when the above command is executed, the screen output process PID, Also prompt:
nohup:ignoring input and redirecting stderr to stdout
At this point, return to the shell and enter the command window.

You can also overwrite the settings in Config.json with the command-line arguments:
Sslocal-s server address-P server Port-L Local Port-K password-M encryption method
Ssserver-p Server Port-K password-M encryption method

Note: sslocal is a client program; Ssserver is a server-side program.

5, firewall settings (if any)
Edit the firewall configuration file/etc/sysconfig/iptables to release the server port (server_port).
Add a firewall rule:

-A input-m state--state new-m tcp-p TCP--dport 8989-j accept reboot firewall iptables:
Service Iptables Restart

At this point, the server-side shadowsocks installation and configuration is complete.

6. Client Configuration
The Windows client has a graphical interface and command line, and here is an example of a shadowsocks-csharp that configures the graphical interface.
Download Client Shadowsocks-csharp (latest version 1.1.2):
Https://shadowsocks-csharp.googlecode.com/files/shadowsocks-csharp-1.1.2.zip

Extract to any directory, double-click Shadowsocks-csharp.exe to run the program, each parameter option fills in:


Server IP: Servers IP (ipv4/ipv6), filling in server-side IP addresses (server)
Server port: Servers ports, filling in the port number set on the server side (Server_port)
Password: Password to encrypt, fill in the encrypted password set on the server side (Password)
Proxy port: Ports for local-side proxies, filling in the local port ports set on the server side (Local_port)
Encryptor: Encryption method, filling in the server-side set of encryption method (methods)

Note: The parameters that local clients fill out must be consistent with the server-side settings.

You can use the browser plugin to browse foreign websites without any obstacles. The setup process for Plug-ins is skipped here.
Autoproxy (for Firefox), Proxy Switchysharp (for Chrome)

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.