Some Centos Python production environment deployment commands

After getting a clean centos, initialize the Python environment, just record some commands and problems
Can be made into a script to initialize automatically, of course, it is better to use docker
Basic environment

1. Create user

sudo adduser newuser
sudo passwd newuser

No password is required to set up authorization

sudo /usr/sbin/visudo
newuser       ALL=NOPASSWD: ALL

2. EPEL(Fedora Extra Packages for Enterprise Linux repository )

Reference documents

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmsudo rpm -Uvh epel-release-6*.rpm

3. Add ius source

Packet address

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpmsudo rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm

4. Install python2.7 / python3 / pip

sudo yum install python27
sudo yum install python27-devel

then

curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo /usr/bin/python2.7-

pip

curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | sudo /usr/bin/python2.7-extra: install python3

sudo yum install python34u python34u-devel

5. virtualenv

sudo pip install virtualenv

6. gen ssh key

ssh-keygen -t rsa

add ~/.ssh/id_rsa.pub to git or github

Some services


1. install git

sudo yum install git

**2. **mysql

sudo yum install mysql
sudo yum install mysql-devel*-y
sudo yum install mysql-server
sudo /sbin/service mysqld start

3. redis

sudo yum install redis

4. rabbitmq

sudo yum install rabbitmq-server

problem

[ Errno 14] Peer cert cannot be verified or peer cert invalid

add "sslverify=false"in/etc/yum.conf
pip error: ImportError: cannot import name HTTPSHandler
yum install openssl openssl-devel -y

see in sof
MySQL-python

_ mysql.c:2642: error: initializer element is not constant
_ mysql.c:2642: error:(near initialization for ‘_mysql_ResultObject_memberlist[0].offset’)
_ mysql.c: In function ‘_mysql_ConnectionObject_getattr’:
_ mysql.c:2666: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
error: command 'gcc' failed with exit status 1----------------------------------------
Command "/data/home/alarm/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-HgXAQT/MySQL-python/setup.py';exec(compile(getattr(tokenize,'open', open)(__file__).read().replace('\r\n','\n'), __file__,'exec'))" install --record /tmp/pip-kx2cSu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1in/tmp/pip-build-HgXAQT/MySQL-python

Processing: ```javascript
yum install mysql-devel

Recommended Posts

Some Centos Python production environment deployment commands
Python and scrapy deployment in centos environment
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Centos7 deploys python3 virtual environment
Configure python3 environment on centos7 and
FFmpeg environment deployment record under centos7
CentOS 7 configure Python language development environment
CentOS + Python3.6+
Centos 7.5 python3.6
Centos-6.5 installation and deployment of LNMP environment
Centos6 install Python2.7.13
Centos basic commands
Centos7 install Python 3.6.
Production environment deployment of ubuntu Django + Uwsgi + Nginx
CentOS7 upgrade python3
CentOS install Python 3.6
Python - centos6 installation
Centos install Python3
CentOS6.8 install python2.7
CentOS deployment Harbor
Summary of linux (centos) project deployment phase related commands
SFTP dual-machine high availability environment deployment record under Centos
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
Centos 6.4 python 2.6 upgrade to 2.7
CentOS6.7 build LNMP environment
Centos 6.4 python 2.6 upgrade to 2.7
Hadoop environment construction (centos7)
CentOS server deployment (YUM)
Centos7.6 build LNMP environment
Centos source installation Python3
lamp (centos7) installation lamp environment
Python virtual environment: Ubuntu16.04
Centos6.9 install npm environment
Python deployment rad+xray automation
Centos7 configure nodejs environment
CentOS Python Java installations
ubuntu environment deployment project
Configure CentOS7 GPU environment
CentOS 7 build LNMP environment
CentOS7.6 server deployment VNC