Wednesday, December 10, 2014

Cài đặt openERP8 Trên CentOS7(how to install OpenERP8 on CentOS 7)

1 .  cấu hình SELinux, thay đổi như bên dưới.
vi /etc/sysconfig/selinux

    2  . ở đây mình tắt firewall. Trên centos7 iptables đã được thay thế bằng firewall.
chkconfig firewalld off
 systemctl stop firewalld
    3. Thường thì MariaDB được cài dặt sẳn trong bản full, nên chúng ta phải remove nó ra. Nếu chúng ta sử dụng bản  simple thì có thể bỏ qua bước này
  # yum remove mariadb mariadb-server
     yum clean all
     yum update
4. Thiết lập một số thư viện cần thiết cho  openERRP.  
  yum install babel python-devel libxslt-python pyparsing python-dateutil python-decorator python-imaging python-jinja2 python-ldap python-lxml python-mako python-psycopg2 python-reportlab python-requests python-werkzeug python-yaml python-docutils  python-matplotlib python-babel python-gevent pygtk2 glade3 pytz libxslt-devel bzr automake gcc gcc-c++ byacc
   5. Tiến hành cài dặt web apache

   yum -y install httpd
xem fle câu hình
    vi /etc/httpd/conf/httpd.conf
     systemctl start httpd
     chkconfig httpd on
    systemctl restart httpd
 6.  cài dặt database cho operrp
  yum install -y postgresql-setup initdb
   yum install postgresql-libs postgresql-server postgresql php-pgsql php-gd
   postgresql-setup initdb
   systemctl enable postgresql.service
    systemctl start postgresql.service
 Tạo user opener như bên dưới.
   su - postgres
   adduser openerp
    passwd opener
tạo user mới cho database.
    su - postgres -c "createuser --pwprompt --createdb --no-createrole --no-superuser openerp"
ý nghĩa của các tham số trên:
·         --createdb : the new user will be able to create new databases
·         --username postgres : createuser will use the postgres user (superuser)
·         --no-createrole : the new user will not be able to create new users
·         --pwprompt : createuser will ask you the new user's password
·         openerp : the new user's name


7.cài đặt python + openerp8    
yum -y install python.
yum install epel-release
yum-config-manager --add-repo=
https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo

yum update
 yum install odoo
 systemctl start odoo
cấu hình file opener.
    vi /etc/odoo/openerp-server.conf

    Phân quyền và tạo file ghi log.
   mkdir -p /var/log/openerp/
   touch /var/log/openerp/openerp-server.log
  chown openerp /var/log/openerp/openerp-server.log
   chmod 644 /var/log/openerp/openerp-server.log
  vi /var/lib/pgsql/data/pg_hba.conf
    su - postgres
    systemctl restart postgresql.service
8.tạo file  khởi động openerp khi mở OS.
     vi /usr/lib/systemd/system/openerp.service
[Unit]
Description=Advanced OpenSource ERP and CRM server
Requires=postgresql.service
After=postgresql.service
[Install]
Alias=openerp.service
[Service]
Type=simple
PermissionsStartOnly=true
EnvironmentFile=-/etc/conf.d/openerp-server
User=openerp
Group=openerp
SyslogIdentifier=openerp-server
PIDFile=/run/openerp/openerp-server.pid
ExecStartPre=/usr/bin/install -d -m755 -o openerp -g openerp /run/openerp
ExecStart=/usr/local/bin/openerp-server -c /etc/openerp-server.conf --pid=/run/openerp/openerp-server.pid --syslog $OPENERP_ARGS
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target

     systemctl enable openerp.service
     systemctl enable openerp
     chown openerp -R /usr/lib/python2.7/site-packages/openerp/
 9. Đăng nhập:


tạo database và đăng nhập với user admin (mặc định).
hưởng thành quả.
note: bài viết có thamk khảo tài liệu từ doc.odoo.com và rosehosting.com