Deployment commands for some CentOS Python production environments

Source: Internet
Author: User
Tags install openssl virtualenv rabbitmq install redis
This article mainly introduces some CentOS Python production environment Deployment command, very good, with reference value, need to refer to the friend

Just notes

After getting a clean CentOS, initialize the Python environment with some commands and problem logs.

Can be made into scripts to initialize automatically, of course, with Docker better

Basic Environment

1. Create a user

sudo adduser newusersudo passwd newuser# setting authorization does not require a password to be entered Sudo/usr/sbin/visudonewuser 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

Package 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. Installing PYTHON2.7/PYTHON3/PIP

sudo yum install python27sudo yum install Python27-develthencurl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ ez_setup.py | sudo/usr/bin/python2.7-# Pipcurl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | Sudo/usr/bin/python2.7-extra:install python3sudo Yum Install python34u python34u-devel

5. Virtualenv

sudo pip install virtualenv

6. Gen SSH key

Ssh-keygen-t Rsaadd ~/.ssh/id_rsa.pub to git or github

Some services

1. Install git

sudo yum install git

2. mysql

sudo yum install mysqlsudo yum install mysql-devel*-ysudo yum install mysql-serversudo/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 1 In/tmp/pip-build-hgxaqt/mysql-python

Processing:yum install mysql-devel

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.