Vừa rồi cũng bày đặt mày mò thử nghiệm ERP Odoo v10.0 chạy trên máy chủ CentOS 7.3, môi trường ảo hóa VMware vSphere v6.5, và tích hợp công cụ quản trị Virtualmin v6.0, nên giờ ghi lại vài dòng note để sau này có cần thì tham khảo lại.. Mục đích của bài viết là để trích dẫn những source đã tham khảo trong quá trình cài đặt, chứ không nhằm viết trọn một tutorial hướng dẫn.
Trang chủ CentOS: https://www.centos.org/
Trang chủ Odoo: https://www.odoo.com/
Việc tải CentOS 7 mới nhất, tạo ra usb boot rồi cài đặt thì quá dễ rồi. Thực tế thì tôi đã triển khai CentOS 7.3 trên hệ thống máy chủ VMware vSphere v6.5.
Song song với việc cài đặt CentOS, tôi luôn lựa chọn cài đặt thêm 1 application nữa là Virtualmin để thuận tiện cho việc quản lý, cập nhật… Cách cài đặt Virtualmin thì cực kỳ dễ dàng, chỉ cần follow theo hướng dẫn trên website chính thức của virtualmin là được: https://www.virtualmin.com/download.html
Việc cài đặt, cấu hình phần cứng máy ảo và cấu hình mạng trên máy chủ linux không đề cập nhiều ở đây.
Sau khi hoàn thành các bước trên thì tôi tiến hành cài đặt Odoo 10.0 theo như hướng dẫn trên website chính thức của Odoo: https://www.odoo.com/documentation/10.0/setup/install.html –> Chọn đến mục Packaged installers / RPM / Community
$ sudo yum install -y postgresql-server
$ sudo postgresql-setup initdb
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql
$ sudo yum install yum-utils
$ sudo yum-config-manager –add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
$ sudo yum install -y odoo
$ sudo systemctl enable odoo
$ sudo systemctl start odoo
Cực kỳ đơn giản, tuy nhiên nếu gặp khó khăn với hướng dẫn trên, thì có thể tham khảo phần hướng dẫn cài đặt phía dưới này (_reference):
Requirements
For this tutorial, we will be using our SSD 1 Linux VPS hosting plan with CentOS 7 as an operating system.
Log in to your server via SSH:
ssh root@server_ip
Before starting, enter the command below to check whether you have the proper version of CentOS installed on your machine:
# cat /etc/redhat-release
which should give you the underneath output: CentOS Linux release 7.3.xxxx (Core)
Update the system
Make sure your server is fully up to date:
# yum update
Once this is done, install the EPEL repository:
# yum install -y epel-release
Install PostgreSQL
Odoo uses PostgreSQL, therefore let’s install it along with some much-needed dependencies. Execute the below command:
# yum install postgresql-server fontconfig libpng libX11 libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi wkhtmltopdf yum-utils
Now initialize the PostgreSQL database:
# postgresql-setup initdb
Enable PostgreSQL to start on boot and start the service using:
# systemctl enable postgresql
# systemctl start postgresql
Install Odoo 10
Add the Odoo repository:
# yum-config-manager –add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
Update the package index and install Odoo 10:
# yum update && yum install odoo
Once the installation is completed, enable Odoo to start on boot:
# systemctl enable odoo
Start Odoo:
# systemctl start odoo
Check if Odoo is working:
# ps aux |grep odoo
Odoo’s default master password is set to ‘admin‘. Let’s change this. Open the configuration file for Odoo with your favorite text editor. We are using nano:
# nano /etc/odoo/odoo.conf
Uncomment – delete ; – the admin_passwd line and set your new master password. Be sure to use a strong password. You can generate one through the command line. Save and close the file. Restart Odoo for the changes to take effect:
# systemctl restart odoo
Đến đây thì hầu như đã hoàn tất việc cài đặt Odoo 10.0 trên máy chủ CentOS 7.3 nếu như không có lỗi phát sinh trong quá trình cài đặt – hãy thử truy cập vào trang quản trị của Odoo http://SERVER-IP:8069.
Remarks: Có thể gặp một chút khó khăn khi truy cập trang quản trị Odoo do bị cấu hình firewall của CentOS chặn, nếu vậy thì làm như sau:
add firewall rule:
$ firewall-cmd –zone=public –permanent –add-service=http
$ firewall-cmd –zone=public –add-port=8069/tcp –permanent
$ firewall-cmd –reload


