python2.7.8环境安装笔记
yum -y install zlib zlib-devel openssl-develgcc python-devel
1.python 2.7.8安装
cd /usr/local/src/python && tar xf Python-2.7.8.tgz &&cd Python-2.7.8
./configure --prefix=/usr/local/python2.7.8 &&make && make install
mv /usr/bin/python /usr/bin/python_old &&ln -s /usr/local/python2.7.8/bin/python2.7 /usr/bin/python
2.源码安装setuptools和pip
tar xf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install
tar xf pip-6.1.1.tar.gz
cd pip-6.1.1
python setup.py build
python setup.py install
vim /etc/profile
==========================
#set python_pip environment
export PATH=$PATH:/usr/local/python2.7.8/bin
==========================
(手头上一台CentOS,自带的python2.6,版本较低,所以就自己下了个2.7.9,手动编译安装,然后安装pip,发现报错: No module named 'pip._vendor.requests' 上网查了一圈,最后在stackoverflow找到了答案,发现是因为在编译时没有找到ssl相关的模块导致。 执行yum install openssl-devel,然后重新编译python2.7.9,问题解决。...)
whereis pip 检查pip是否安装上
3.源码安装MySQLdb库(参考:http://www.jb51.net/article/60631.htm)
unzip MySQLdb1-master.zip
cd MySQLdb1-master
#vi site.cfg
================================
threadsafe = False
mysql_config = /usr/bin/mysql_config
================================
yum -y install mysql mysql-devel mysql-connector-odbc (mysql_config在mysql包(这个就是mysql-client))
python setup.py build
python setup.py install
#验证是否安装成功:import MySQLdb
(build时报错:error: command 'gcc' failed with exit status 1 解决:yum install gcc python-devel)
4.安装simplejson
pip install simplejson
5.node环境部署
wget http://nodejs.org/dist/v0.12.2/node-v0.12.2.tar.gz
tar xf node-v0.12.2.tar.gz && cd node-v0.12.2
./configure --prefix=/usr/local/nodejs && make && make install
(报错:确实bz2 解决:http://blog.csdn.net/liubo2012/article/details/8367603)
yum -y install bzip2*
cd Python-2.7.8/Modules/zlib
./configure && make && make install
cd Python-2.7.8 && python setup.py install
重新进入node-v0.12.2 make && make install
配置环境:
vim /etc/profile
#set nodejs environment
export PATH=$PATH:/usr/local/nodejs/bin
source /etc/profile
6.数据库安装(参考rpm安装mysql5.6)
vim /etc/my.cnf
[client]
socket = /home/mysql/data/mysql.sock
[mysqld]
basedir = /usr/ #这里是mysql的命令路径系统默认进入./bin/寻找相应的命令
datadir = /home/mysql/data
socket = /home/mysql/data/mysql.sock
character-set-server=utf8
max_connect_errors = 500
max_connections = 8000
max_allowed_packet = 500M
thread_cache_size = 64
wait_timeout = 180
default-storage-engine = MYISAM
socket = /home/mysql/data/mysql.sock
slow_query_log = ON
slow_query_log_file = /home/mysql/data/analysis1-slow.log
long_query_time = 2