Last active
December 16, 2015 21:09
-
-
Save alejandrobernardis/5497458 to your computer and use it in GitHub Desktop.
PYENV Install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | curl -O https://gist.github.com/alejandrobernardis/5497458/raw/cfa73fdcadead945eddcdf10913228aa49c12ef8/install-env.sh | chmod +x install-env.sh | ./install-env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash profile | |
mv ~/.bash_profile ~/.bash_profile.old | |
curl -o ~/.bash_profile https://raw.github.com/asumikamikaze/python-environment/master/config/root/dot_bash_profile | |
# update | |
yum update | |
yum install nano wget tree gcc gcc-c++ compat-gcc-34-c++ gcc-gfortran zlib zlib-devel bzip2 bzip2-devel \ | |
openssl openssl-devel ncurses ncurses-devel sqlite sqlite-devel gdbm gdbm-devel readline \ | |
readline-devel expat expat-devel freetype freetype-devel libjpeg libjpeg-devel libpng libpng-devel \ | |
gdb bison libtool make automake strace autoconf gettext automake mercurial git vim lynx libevent \ | |
libevent-devel e2fsprogs-devel glibc-devel | |
# directories | |
mkdir -p ~/backups ~/downloads | |
# python 2.7 | |
cd ~/downloads | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 | |
tar xvjf Python-2.7.3.tar.bz2 | |
cd Python-2.7.3 | |
./configure | |
make | |
make install | |
# setuptools | |
cd ~/downloads | |
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz | |
tar xfvz setuptools-0.6c11.tar.gz | |
cd setuptools-0.6c11 | |
python setup.py build | |
python setup.py install | |
# pip | |
cd ~/downloads | |
wget http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz | |
tar xfvz pip-1.2.1.tar.gz | |
cd pip-1.2.1 | |
python setup.py build | |
python setup.py install | |
# supervisor | |
cd ~/downloads | |
wget wget http://pypi.python.org/packages/source/s/supervisor/supervisor-3.0b1.tar.gz | |
tar xfvz supervisor-3.0b1.tar.gz | |
cd supervisor-3.0b1 | |
python setup.py build | |
python setup.py install | |
curl -o /etc/supervisord.conf https://raw.github.com/asumikamikaze/python-environment/master/config/etc/supervisord.conf | |
mkdir -p /etc/supervisord /var/log/supervisord | |
curl -o /etc/rc.d/init.d/supervisord https://raw.github.com/asumikamikaze/python-environment/master/config/etc/rc.d/init.d/supervisord | |
chmod +x /etc/rc.d/init.d/supervisord | |
chkconfig --list | |
chkconfig --add supervisord | |
chkconfig supervisord on | |
# all dependencies | |
curl -o /tmp/python-requirements.txt https://raw.github.com/asumikamikaze/python-environment/master/config/tmp/python-requirements.txt | |
pip install -r /tmp/python-requirements.txt | |
# rabbit | |
cd ~/downloads | |
wget --no-check-certificate https://elearning.erlang-solutions.com/couchdb/rbingen_adapter/package_R16B_centos632_1361907974/esl-erlang-R16B-2.i386.rpm | |
yum install esl-erlang-R16B-2.i386.rpm | |
cd ~/downloads | |
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.4/rabbitmq-server-3.0.4-1.noarch.rpm | |
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
rpm --nodeps -Uvh rabbitmq-server-3.0.4-1.noarch.rpm | |
rabbitmq-plugins enable rabbitmq_management | |
chkconfig --list | |
chkconfig rabbitmq-server on | |
# redis | |
cd ~/downloads | |
wget http://redis.googlecode.com/files/redis-2.6.11.tar.gz | |
tar xvjf redis-2.6.11.tar.gz | |
cd redis-2.6.11 | |
make && make test | |
mkdir /etc/redis /var/lib/redis | |
cp src/redis-server src/redis-cli /usr/local/sbin | |
curl -o /etc/redis/redis.conf https://raw.github.com/asumikamikaze/python-environment/master/config/etc/redis/redis.conf | |
curl -o /etc/rc.d/init.d/redis-server https://raw.github.com/asumikamikaze/python-environment/master/config/etc/rc.d/init.d/redis-server | |
chmod +x /etc/rc.d/init.d/redis-server | |
chkconfig --list | |
chkconfig --add redis-server | |
chkconfig redis-server on | |
cp /etc/sysctl.conf /etc/sysctl.conf.old | |
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf | |
sysctl vm.overcommit_memory=1 | |
# memcached | |
cd ~/downloads | |
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz | |
tar xfvz memcached-1.4.15.tar.gz | |
cd memcached-1.4.15 | |
./configure | |
make | |
make install | |
curl -o /etc/sysconfig/memcached https://raw.github.com/asumikamikaze/python-environment/master/config/etc/sysconfig/memcached | |
curl -o /etc/rc.d/init.d/memcached https://raw.github.com/asumikamikaze/python-environment/master/config/etc/rc.d/init.d/memcached | |
chmod +x /etc/rc.d/init.d/memcached | |
chkconfig --list | |
chkconfig --add memcached | |
chkconfig memcached on | |
# mongodb | |
curl -o /etc/yum.repos.d/10gen.repo https://raw.github.com/asumikamikaze/python-environment/master/config/etc/yum.repos.d/10gen.i686.repo | |
yum update | |
yum install mongo-10gen mongo-10gen-server | |
# nodejs | |
cd ~/downloads | |
wget http://nodejs.org/dist/v0.10.0/node-v0.10.0.tar.gz | |
tar xvjf node-v0.10.0.tar.gz | |
cd node-v0.10.0 | |
./configure | |
make | |
make install | |
# nginx | |
curl -o /etc/yum.repos.d/nginx.repo https://raw.github.com/asumikamikaze/python-environment/master/config/etc/yum.repos.d/nginx.repo | |
yum update | |
yum install nginx | |
mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled | |
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old | |
curl -o /etc/nginx/nginx.conf https://raw.github.com/asumikamikaze/python-environment/master/config/etc/nginx/nginx.conf | |
curl -o /usr/local/bin/ngxadd https://raw.github.com/asumikamikaze/python-environment/master/config/usr/local/bin/ngxadd | |
curl -o /usr/local/bin/ngxdel https://raw.github.com/asumikamikaze/python-environment/master/config/usr/local/bin/ngxdel | |
# iptables | |
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.old | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 55672 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 8000:8999 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --sport 80 --dport 8000:8999 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --sport 443 --dport 8000:8999 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT" >> /etc/sysconfig/iptables | |
echo "-A INPUT -m state --state NEW -m tcp -p tcp --dport 28017 -j ACCEPT" >> /etc/sysconfig/iptables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment