Artigos‎ > ‎Cloud‎ > ‎Amazon EC2‎ > ‎

Instalando OpenERP nas nuvens do Amazon


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.


Basicamente siga as instruções disponiveis em : http://doc.openerp.com/v6.1/install/linux/index.html
Outra fonte de referência: http://www.slideshare.net/easyopenerp/how-to-install-openerp-61-rc1-en

Atualize o sistema
sudo tee /etc/apt/sources.list.d/openerp.list <<EOF
deb http://nightly.openerp.com/6.1/nightly/deb/ ./
EOF
sudo apt-get update
sudo apt-get upgrade
apt-cache search openerp

Instalação automatizada para ubuntu:
sudo apt-get install openerp
Configuração mínima do banco de dados:
sudo -u postgres createuser --createdb --username postgres --no-createrole openerp
Shall the new role be a superuser? (y/n) y

Caso necessite verificar o banco de dados utilize o comando:
sudo -u postgres psql postgres
Para sair execute:
\q

Caso queira configurar outro local para o armazenamento de dados altere:
sudo nano /etc/postgresql/9.1/main/postgresql.conf
data_directory = '/var/lib/postgresql/9.1/main'
O diretório deve ter autorização de acesso para o usuário postgres como segue:
chown postgres:postgres /var/lib/postgresql/9.1/main
chmod 700 /var/lib/postgresql/9.1/main

Reinicie o servidor com o comando:
sudo service postgresql restart

Verifique a configuração da conexão ao banco de dados no servidor openerp:
sudo nano /etc/openerp/openerp-server.conf
[options]
addons_path = /usr/lib/pymodules/python2.7/openerp/addons admin_passwd = admin assert_exit_level = error cache_timeout = 100000 cpu_time_limit = 60 csv_internal_sep = , db_host = False db_maxconn = 64 db_name = False db_password = False db_port = False db_template = template0 db_user = openerp dbfilter = .* debug_mode = False demo = {} email_from = False import_partial = list_db = True log_handler = [':INFO'] log_level = info logfile = /var/log/openerp-server.log login_message = False logrotate = True max_cron_threads = 4 netrpc = True netrpc_interface = netrpc_port = 8070 osv_memory_age_limit = 1.0 osv_memory_count_limit = False pg_path = None pidfile = None proxy_mode = False reportgz = False secure_cert_file = server.cert secure_pkey_file = server.pkey server_wide_modules = None smtp_password = False smtp_port = 25 smtp_server = localhost smtp_ssl = False smtp_user = False static_http_document_root = None static_http_enable = False static_http_url_prefix = None syslog = False test_commit = False test_disable = False test_file = False test_report_directory = False timezone = False translate_modules = ['all'] unaccent = False virtual_memory_limit = 805306368 virtual_memory_reset = 671088640 without_demo = False xmlrpc = True xmlrpc_interface = xmlrpc_port = 8069 xmlrpcs = True xmlrpcs_interface = xmlrpcs_port = 8071


Acesso Webdav ainda inclua:
[webdav]
enable = True
vdir = webdav
verbose = True
debug = True


Comandos Úteis:

Reinicie o postgresl:
sudo service postgresql restart
Reinicie o servidor ERP:
sudo service openerp restart

Resolução de problemas com o log:
sudo cat /var/log/openerp-server.log
Servidor conectado ao banco de dados pela porta 5432 e atendendo pelas portas 8069, 8070 e 8071 (segura)
ps uaxww | grep -i openerp
sudo lsof -i :8069
sudo lsof -i :8070
sudo netstat -anpt
Acesse o endereço de seu servidor com seu browser preferido:
http://ec2-177-71-163-151.sa-east-1.compute.amazonaws.com:8069 

E escolha manage database abaixo da tela de login
O senha padrão do master password é : admin



Depois voce pode acessar o sistema com o usuário Admin e senha acima selecionada.


Agora precisa baixar e configurar a localização brasileira:

sudo apt-get install bzr bzrtools
sudo mkdir /etc/openerp/launchpad
sudo chown openerp:openerp /etc/openerp/launchpad
cd /etc/openerp/launchpad

Agora, utilizando o terminal digite a seguinte linha de comando, substituindo o parâmetro final pelo seu nome de usuário do LP (Launchpad):

sudo -u openerp USER=openerp HOME=/etc/openerp/launchpad bzr launchpad-login arvati

sudo -u openerp ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/openerp/.ssh/id_rsa): /etc/openerp/launchpad/id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/openerp/launchpad/id_rsa.
Your public key has been saved in /etc/openerp/launchpad/id_rsa.pub.
The key fingerprint is:
74:b6:b6:a9:1e:de:4e:90:bc:2a:e2:5d:97:3e:fc:d9 openerp@ip-10-252-25-216
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|         .       |
|        . =      |
|       . + + .   |
|       .S o +    |
|       .   . +   |
|        . +.+ .  |
|      ...+ *o. o |
|     .....+.+oo E|
+-----------------+
cat id_rsa.pub

Agora abra o seguinte link no seu navegador (substitua seu usuário Launchpad no link): https://launchpad.net/~arvati/+editsshkeys

sudo tee -a /etc/ssh/ssh_config <<EOF
Host bazaar.launchpad.net
   IdentityFile /etc/openerp/launchpad/id_rsa
   User arvati # the short name that appears in the URL when you visit https://launchpad.net/~
EOF

sudo -u openerp USER=openerp HOME=/etc/openerp/launchpad bzr branch lp:openerp.pt-br-localiz /etc/openerp/launchpad/pt-br
sudo -u openerp USER=openerp HOME=/etc/openerp/launchpad bzr branch lp:openobject-addons/extra-trunk /etc/openerp/launchpad/extra

Agora vamos disponibilizar estes modulos de localização ao servidor:
sudo cp -a  /etc/openerp/launchpad/pt-br/l10n_br*  /usr/lib/pymodules/python2.7/openerp/addons/ 
E alguns módulos extras necessários:
  • account_fiscal_position_rule
  • account_fiscal_position_rule_purchase
  • account_fiscal_position_rule_sale
  • account_fiscal_position_rule_stock
  • account_product_fiscal_classification
  • account_payment_extension

sudo cp -a /etc/openerp/launchpad/extra/account_fiscal_position_rule /usr/lib/pymodules/python2.7/openerp/addons/
sudo cp -a /etc/openerp/launchpad/extra/account_fiscal_position_rule_purchase /usr/lib/pymodules/python2.7/openerp/addons/ 
sudo cp -a /etc/openerp/launchpad/extra/account_fiscal_position_rule_sale /usr/lib/pymodules/python2.7/openerp/addons/ 
sudo cp -a /etc/openerp/launchpad/extra/account_fiscal_position_rule_stock /usr/lib/pymodules/python2.7/openerp/addons/ 
sudo cp -a /etc/openerp/launchpad/extra/account_product_fiscal_classification /usr/lib/pymodules/python2.7/openerp/addons/ 
sudo cp -a /etc/openerp/launchpad/extra/account_payment_extension /usr/lib/pymodules/python2.7/openerp/addons/

Dependendo das configurações de seu servidor, pode ser que a instalação do módulo l10n_br_data_zip demore muito por ser uma importação de dados muito extensa. Tem algumas dicas de como tornar esta importação mais rápida inicalizando o servidor com os seguintes parâmetros abaixo:
sudo -u openerp openerp-server --import-partial=/tmp/status.pickle --database=openerp --init=l10n_br_data_zip --config=/etc/openerp/openerp-server.conf --logfile=/var/log/openerp-server.log &

Parâmetros padrão:
Caminho do arquivo de configuração: /etc/openerp/openerp-server.conf
Caminho do arquivo de log: /var/log/openerp-server.log
Usuário do processo openerp-server: openerp
Readme: /usr/share/doc/openerp/README
Caminho dos Addons na instalação Ubuntu: /usr/lib/pymodules/python2.7/openerp/addons/

Ajuda sobre todas as configurações possíveis no arquivo /etc/openerp/openerp-server.conf pode ser verificada pelo comando:
openerp-server --help

--version

show program's version number and exit

 -h, 

--help

show this help message and exit

-c CONFIG, 

--config=CONFIG

specify alternate config file

 -s, 

--save

save configuration to ~/.openerp_serverrc

 -i INIT, 

--init=INIT

install one or more modules (comma-separated list, use "all" for all modules), requires -d

 -u UPDATE, 

--update=UPDATE

update one or more modules (comma-separated list, use "all" for all modules). Requires -d.

 --without-demo=WITHOUT_DEMO

disable loading demo data for modules to be installed (comma-separated, use "all" for all modules). Requires -d and -i. Default is none

 -P IMPORT_PARTIAL, 

 --import-partial=IMPORT_PARTIAL

Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states.

 --pidfile=PIDFILE

file where the server pid will be stored

 --addons-path=ADDONS_PATH

specify additional addons paths (separated by commas).

 --load=SERVER_WIDE_MODULES

Comma-separated list of server-wide modules default=web

--xmlrpc-interface=XMLRPC_INTERFACE

Specify the TCP IP address for the XML-RPC protocol. The empty string binds to all interfaces.

 --xmlrpc-port=XMLRPC_PORT

specify the TCP port for the XML-RPC protocol

 --no-xmlrpc

disable the XML-RPC protocol

 --proxy-mode

Enable correct behavior when behind a reverse proxy

--xmlrpcs-interface=XMLRPCS_INTERFACE

Specify the TCP IP address for the XML-RPC Secure protocol. The empty string binds to all interfaces.

 --xmlrpcs-port=XMLRPCS_PORT

specify the TCP port for the XML-RPC Secure protocol

 --no-xmlrpcs

disable the XML-RPC Secure protocol

 --cert-file=SECURE_CERT_FILE

specify the certificate file for the SSL connection

 --pkey-file=SECURE_PKEY_FILE

specify the private key file for the SSL connection

--netrpc-interface=NETRPC_INTERFACE

specify the TCP IP address for the NETRPC protocol

 --netrpc-port=NETRPC_PORT

specify the TCP port for the NETRPC protocol

 --no-netrpc

disable the NETRPC protocol

--db-filter=REGEXP

Filter listed database

--static-http-enable

 enable static HTTP service for serving plain HTML files

 --static-http-document-root=STATIC_HTTP_DOCUMENT_ROOT

 specify the directory containing your static HTML files (e.g '/var/www/')

 --static-http-url-prefix=STATIC_HTTP_URL_PREFIX

 specify the URL root prefix where you want web browsers to access your static HTML files (e.g '/')

--test-file=TEST_FILE

 Launch a YML test file.

 --test-report-directory=TEST_REPORT_DIRECTORY

 If set, will save sample of all reports in this directory.

 --test-disable

Disable loading test files.

 --test-commit

Commit database changes performed by tests.

 --assert-exit-level=ASSERT_EXIT_LEVEL

 specify the level at which a failed assertion will stop the server. Accepted values: ['info', 'warn', 'test', 'critical', 'error', 'debug', 'notset']

--logfile=LOGFILE

file where the server log will be stored

 --no-logrotate

do not rotate the logfile

 --syslog

Send the log to the syslog server

 --log-handler=PREFIX:LEVEL

 setup a handler at LEVEL for a given PREFIX. An empty PREFIX indicates the root logger. This option can be repeated. Example: "openerp.orm:DEBUG" or "werkzeug:CRITICAL" (default: ":INFO")

 --log-request

shortcut for --log- handler=openerp.netsvc.rpc.request:DEBUG

 --log-response

shortcut for --log- handler=openerp.netsvc.rpc.response:DEBUG

 --log-web

shortcut for --log- handler=openerp.addons.web.common.http:DEBUG

 --log-sql

shortcut for --log-handler=openerp.sql_db:DEBUG

 --log-level=LOG_LEVEL

 specify the level of the logging. Accepted values: ['info', 'debug_rpc', 'warn', 'test', 'critical', 'debug_sql', 'error', 'debug', 'debug_rpc_answer', 'notset'] (deprecated option).

--email-from=EMAIL_FROM

 specify the SMTP email address for sending email

 --smtp=SMTP_SERVER

specify the SMTP server for sending email

 --smtp-port=SMTP_PORT

 specify the SMTP port

 --smtp-ssl

specify the SMTP server support SSL or not

 --smtp-user=SMTP_USER

 specify the SMTP username for sending email

 --smtp-password=SMTP_PASSWORD

 specify the SMTP password for sending email

-d DB_NAME, 

--database=DB_NAME

 specify the database name

 -r DB_USER, 

 --db_user=DB_USER

 specify the database user name

 -w DB_PASSWORD, 

 --db_password=DB_PASSWORD

 specify the database password

 --pg_path=PG_PATH

specify the pg executable path

 --db_host=DB_HOST

specify the database host

 --db_port=DB_PORT

specify the database port

 --db_maxconn=DB_MAXCONN

 specify the the maximum number of physical connections to posgresql

 --db-template=DB_TEMPLATE

 specify a custom database template to create a new database Internationalisation options:  Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-d' is mandatory.Option '-l' is mandatory in case of importation

--load-language=LOAD_LANGUAGE

 specifies the languages for the translations you want to be loaded

 -l LANGUAGE, 

 --language=LANGUAGE

 specify the language of the translation file. Use it  with --i18n-export or --i18n-import

 --i18n-export=TRANSLATE_OUT

 export all sentences to be translated to a CSV file, a PO file or a TGZ archive and exit

 --i18n-import=TRANSLATE_IN

 import a CSV or a PO file with translations and exit.  The '-l' option is required.

 --i18n-overwrite

overwrites existing translation terms on updating a module or importing a CSV or a PO file.

 --modules=TRANSLATE_MODULES

 specify modules to export. Use in combination with  --i18n-export

--no-database-list

disable the ability to return the list of databases

--cache-timeout=CACHE_TIMEOUT

 set the timeout for the cache system

 --debug

enable debug mode

 --stop-after-init

stop the server after its initialization

 -t TIMEZONE, 

 --timezone=TIMEZONE

 specify reference timezone for the server (e.g. Europe/Brussels

 --osv-memory-count-limit=OSV_MEMORY_COUNT_LIMIT

 Force a limit on the maximum number of records kept in the virtual osv_memory tables. The default is False, which means no count-based limit.

 --osv-memory-age-limit=OSV_MEMORY_AGE_LIMIT

 Force a limit on the maximum age of records kept in the virtual osv_memory tables. This is a decimal value expressed in hours, and the default is 1 hour.

 --max-cron-threads=MAX_CRON_THREADS

 Maximum number of threads processing concurrently cron jobs.

 --virtual-memory-limit=VIRTUAL_MEMORY_LIMIT

 Maximum allowed virtual memory per Gunicorn process. When the limit is reached, any memory allocation will fail.

 --virtual-memory-reset=VIRTUAL_MEMORY_RESET

 Maximum allowed virtual memory per Gunicorn process. When the limit is reached, the worker will be reset after the current request.

 --cpu-time-limit=CPU_TIME_LIMIT

 Maximum allowed CPU time per Gunicorn process. When the limit is reached, an exception is raised.

 --unaccent

Use the unaccent function provided by the database when available.


Oficialmente as opções disponíveis são:

Verbose

Enable the debugging mode (default False)

Pidfile

The file where the server pid will be stored (default False)

Logfile

The file where the server log will be stored (default False)

Interface

The IP address on which the server will bind. If empty, it will bind on all interfaces (default empty)

Port

The TCP port on which the server will listen. (default 8069)

debug_mode

Enable debug mode (default False)

secure

Launch server over https instead of http. (default False)

smtp_server

Specify the SMTP server for sending email. (default localhost)

smtp_user

Specify the SMTP user for sending email. (default False)

smtp_password

Specify the SMTP password for sending email. (default False)

db_name

Specify the database name.

db_user

Specify the database user name. (default None)

db_password

Specify the database password for db_user. (default None)

pg_path

Specify the PostgreSQL executable path. (default None)

db_host

Specify the database host. (default localhost)

db_port

Specify the database port. (default None)

price_accuracy

Specify the price accuracy.




O URL específico do gadget não foi encontrado



Comments