jan 19 2009

Instalação da versão 1.53 para debian lenny.

#!/bin/sh -e

echo Por: Aderbal Botelho – aderbal@gmail.com & Thiago Montenegro – opencode@gmail.com
echo Preparando o python…

apt-get remove –purge python2.4
apt-get install libc6-dev gcc g++ python2.5 python2.5-dev bind9 dhcp3-server ntp ntpdate libpq-dev postgresql-8.3 pmacct snmp snmpd iproute
wget -c http://pylonshq.com/download/0.9.7/ez_setup.py

rm -rf /usr/bin/python
ln -s /usr/bin/python2.5 /usr/bin/python

python2.5 ez_setup.py
easy_install-2.5 Pylons==0.9.7rc3
easy_install-2.5 SQLAlchemy==0.4.7p1
easy_install-2.5 psycopg2
easy_install-2.5 pisa
easy_install-2.5 html5lib

## Obtendo o pil
wget http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz
tar -zxvf Imaging-1.1.6.tar.gz
cd Imaging-1.1.6
python setup.py install

## Obtendo o Reportlab
wget http://www.reportlab.org/ftp/ReportLab_2_2.tgz
tar -xvf ReportLab_2_2.tgz
cd ReportLab_2_2
python setup.py install

## Criando estrutura do sistema
mkdir /opt/pylons
wget http://pycontrole.googlecode.com/files/pycontrole_1.5.3.zip
mv pycontrole_1.5.3.zip /opt/pylons
cd /opt/pylons
apt-get install unzip
unzip pycontrole_1.5.3.zip

cd /opt/pylons/pycontrole/install/files/
cp pycontrole /etc/init.d/pycontrole
cp pylons /etc/init.d/pylons
cp pg_hba.conf /etc/postgresql/8.3/main/
cp pmacctd.conf /etc/pmacct/

chmod +x /etc/init.d/pycontrole
chmod +x /etc/init.d/pylons

wget 189.23.134.82/snmpd.conf
cp snmpd.conf /etc/snmp/

/etc/init.d/postgresql-8.3 restart
/etc/init.d/snmpd restart
/etc/init.d/pmacct restart

cd /opt/pylons/pycontrole

# Criando os usuários
su postgres -c “createuser -U postgres pycontrole”
su postgres -c “createuser -U postgres pmacct”

# Alterando as senhas para os padrões
su postgres -c “psql -U postgres -c \”alter user pycontrole with password ‘pyoitudobemcontrole00′\”"
su postgres -c “psql -U postgres -c \”alter user pmacct with password ‘pmacctasdfpoiu’\”"

# Criando banco de dados
su postgres -c “createdb -U postgres -O pycontrole -E UTF8 pycontrole”
su postgres -c “createdb -U postgres -O pmacct pmacct”

# Criando tabelas e inserindo dados padrões no banco pycontrole e no pmacct
su postgres -c “psql -U postgres -d pycontrole < install/sql/pycontrole.sql”
su postgres -c “psql -U postgres -d pmacct < install/sql/pmacct.sql”

echo Arquivos para editar senhas:
echo /opt/pylons/pycontrole/pycontrole/configsys/system/pmacct.cfg
echo /opt/pylons/pycontrole/production.ini

## Start pylons e pycontrole
/etc/init.d/pylons start
/etc/init.d/pycontrole start

# Adicionando para iniciar quando sistema carregar
update-rc.d pylons defaults 42
update-rc.d pycontrole defaults 42

DEIXA UM COMENTÁRIO

Deverás fazer login para fazer um comentário.