懂的人自然懂,不懂看看就行。哈哈哈哈
如果本机安装了python2,尽量不要管他,使用python3运行python脚本就好,因为可能有程序依赖目前的python2环境,
比如yum!!!!!
不要动现有的python2环境!
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
https://www.python.org/downloads/
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
我个人习惯安装在/usr/local/python3(具体安装位置看个人喜好) 创建目录:
mkdir -p /usr/local/python3
解压下载好的Python-3.x.x.tgz包(具体包名因你下载的Python具体版本不不同⽽而不不同,如:我下载的是Python3.6.1.那我这里就是Python-3.6.1.tgz)
tar -zxvf Python-3.6.1.tgz
cd Python-3.6.1``# ./configure --prefix=/usr/local/python3
make
make
make install
make install 或者 make && make install
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH
按ESC,输入:wq回车退出。
修改完记得执行行下面的命令,让上一步的修改生效:
source ~/.bash_profile
检查Python3及pip3是否正常可用:
# python3 -V
Python 3.6.1
# pip3 -V
pip 9.0.1 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)
# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
毕竟丰富的第三方库是python的优势所在,为了更加方便的安装第三方库,使用pip命令,我们需要进行相应的安装。
命令如下:
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
python3 setup.py build
python3 setup.py install
如果前面没布置好环境的话,就要苦逼一下了:报错: <font style="color:red">RuntimeError: Compression requires the (missing) zlib module</font>
yum install zlib-devel
`` cd python3.6.1
make && make install
重新安装setuptools
python3 setup.py build
python3 setup.py install
上面完成之后进行下面的安装配置
1、安装wget下载器
yum -y install wget
2、安装SS,执行下面命令
yum install python-setuptools && easy_install pip -y
pip install shadowsocks -y
或执行以下命令(我用的是这种方式)
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
# 赋予执行权限
chmod +x shadowsocks.sh
# 执行安装并启动
./shadowsocks.sh 2>&1 | tee shadowsocks.log
3、编辑配置文件
nano /etc/shadowsocks.json
如果没有装nano编辑器请先下载 yum -y install nano
配置如下:
{
"server":"服务器的IP地址",
"server_port":服务监听的端口号,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"监听端口密码",
"timeout":300,
"method":"rc4-md5",
"fast_open": false
}
多用户多端口配置:
{
"server":"服务器IP地址",
"local_address":"127.0.0.1",
"local_port":1080,
"port_password":{
"8989":"password0",
"9001":"password1",
"9002":"password2",
"9003":"password3",
"9004":"password4"
},
"timeout":300,
"method":"rc4-md5",
"fast_open": false
}
4、启动SS
/etc/init.d/shadowsocks start
其他命令
#停止
/etc/init.d/shadowsocks stop
#重启
/etc/init.d/shadowsocks restart
#状态
/etc/init.d/shadowsocks status
https://github.com/shadowsocks/shadowsocks-windows/releases
在浏览器地址栏上输入https://www.google.com
如果访问有页面就OK了!
本站主要用于日常笔记的记录和生活日志。本站不保证所有内容信息可靠!(大多数文章属于搬运!)如有版权问题,请联系我立即删除:“abcdsjx@126.com”。
QQ: 1164453243
邮箱: abcdsjx@126.com