Created
August 27, 2013 15:02
-
-
Save schleumer/6354727 to your computer and use it in GitHub Desktop.
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
# Cria um diretório de sources | |
mkdir ~/src | |
# Entra no diretório de sources | |
cd ~/src | |
# baixa a key do epel | |
wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6 | |
# importa a key do epel | |
rpm --import RPM-GPG-KEY-EPEL-6 | |
# baixa o repo epel | |
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# instala o repo epel | |
rpm -ivh epel-release-6-8.noarch.rpm | |
# Instalar ferramentas de desenvolvimento | |
yum groupinstall "Development tools" | |
# Dependencias | |
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel install libev libev-devel libxslt libxslt-devel mysql-devel httpd-devel | |
#/??? | |
cd ~/src | |
# Baixa o source do Python2.7 | |
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 | |
# Descompacta | |
tar xf Python-2.7.3.tar.bz2 | |
# Entra no source | |
cd Python-2.7.3 | |
# Configura o make | |
./configure --prefix=/usr/local --enable-shared | |
# Compila e instala | |
make && make altinstall | |
# Adiciona o caminho da biblioteca /usr/local/lib ao sistema, como default o CentOS não adota isso | |
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local-lib.conf | |
# faz as paradas funcionar | |
ldconfig | |
# Volta ao diretório de sources | |
cd ~/src | |
# Baixar o pacote distribute para o Python | |
wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz --no-check-certificate | |
# descompact | |
tar xf distribute-0.6.35.tar.gz | |
# entra no source do pacote | |
cd distribute-0.6.35 | |
# instala o pacote | |
python2.7 setup.py install | |
# instala o virtualenv para futuros usos | |
easy_install-2.7 virtualenv | |
###################################################### | |
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!# | |
#!! NECESSÁRIO REMOVER, CASO JÁ EXISTA, O MOD_WSGI !!# | |
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!# | |
###################################################### | |
# volta ao diretório de sources | |
cd ~/src | |
# baixa o source do mod_wsgi | |
wget https://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz | |
# descompacta | |
tar xfvz mod_wsgi-3.4.tar.gz | |
# entra no diretório do source | |
cd mod_wsgi-3.4 | |
# configura o make | |
./configure --with-python=/usr/local/bin/python2.7 | |
# compila e instala o mod | |
make && make install | |
# cria um arquivo chamado wsgi.conf em /etc/httpd/conf.d para carregar o modulo mod_wsgi | |
echo "LoadModule wsgi_module modules/mod_wsgi.so" > /etc/httpd/conf.d/wsgi.conf | |
# depois crie um virtual host com o ilustrativo conteudo | |
<<CONTEUDO_ILUSTRATIVO | |
<VirtualHost *:80> | |
ServerName teste-microsistec.schleumer.com.br | |
ServerAlias teste-microsistec.schleumer.com.br | |
ServerAdmin [email protected] | |
DocumentRoot /home/crawler/crawler/Web | |
WSGIScriptAlias / /home/crawler/crawler/Web/runserver.py | |
WSGIDaemonProcess teste user=apache group=apache python-path=/usr/local | |
<Directory /home/crawler/crawler/Web> | |
Order allow,deny | |
Allow from all | |
</Directory> | |
Alias /static /home/crawler/crawler/Web/static | |
</VirtualHost> | |
CONTEUDO_ILUSTRATIVO | |
# execute as dependencias do crawler `crawler/Web/deps.sh` | |
sh deps.sh | |
# entra em opt | |
cd /opt | |
# Baixa o phantomjs | |
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
# Descompacta | |
tar xfvj phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
# Naming matters | |
mv phantomjs-1.9.1-linux-x86_64 phantomjs | |
# cria um link em /usr/bin | |
ln -s /opt/phantomjs/bin/phantomjs /usr/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment