Configuring Odoo on CentOS 6.6 can present various challenges due to compatibility issues with newer versions of Odoo and dependencies that might not be readily available in CentOS 6 repositories. Here’s a step-by-step guide to help you address common errors and successfully configure Odoo on CentOS 6.6:
Step-by-Step Guide to Configure Odoo on CentOS 6.6
1. Update Your System
Ensure your CentOS system is up to date with the latest packages and security updates.
sudo yum update
2. Install Required Dependencies
- Python: CentOS 6.6 comes with Python 2.6 by default, which is outdated for newer versions of Odoo. You’ll need to install a newer version of Python. One approach is to use Software Collections (SCL) for CentOS to install Python 2.7 or higher.
sudo yum install centos-release-scl sudo yum install python27 # Install Python 2.7 scl enable python27 bash # Enable Python 2.7 for the current session
- PostgreSQL: Install PostgreSQL, which is the recommended database for Odoo.
sudo yum install postgresql-server postgresql-contrib sudo service postgresql initdb sudo service postgresql start sudo chkconfig postgresql on
- Other Dependencies: Install additional required packages.
bash sudo yum install git gcc wget nodejs-less sudo yum install libxslt-devel libxml2-devel zlib-devel
3. Install Wkhtmltopdf
Odoo requires Wkhtmltopdf to generate PDF reports. CentOS 6.6 does not provide the required version of Wkhtmltopdf in its repositories, so you’ll need to download and install it manually.
cd /tmp
wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos6.x86_64.rpm
sudo yum localinstall wkhtmltox-0.12.5-1.centos6.x86_64.rpm
4. Create PostgreSQL User and Database
- Log into PostgreSQL and create a user and database for Odoo.
bash sudo -u postgres psql postgres=# CREATE USER odoo WITH PASSWORD 'your_password'; postgres=# CREATE DATABASE odoo WITH OWNER odoo ENCODING 'UTF8'; postgres=# \q
5. Clone Odoo Repository and Install
- Create a directory for Odoo and clone the Odoo source code repository.
sudo mkdir /opt/odoo sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 /opt/odoo/odoo10
- Install Python dependencies using
pip
.bash sudo yum install python-pip sudo pip install -r /opt/odoo/odoo10/requirements.txt
6. Configure Odoo
- Copy the configuration file and adjust settings as necessary.
sudo cp /opt/odoo/odoo10/debian/openerp-server.conf /etc/odoo.conf sudo nano /etc/odoo.conf
Example configuration (/etc/odoo.conf
):[options] admin_passwd = your_admin_password db_host = localhost db_port = 5432 db_user = odoo db_password = your_password addons_path = /opt/odoo/odoo10/addons
7. Start Odoo
- Use the Python interpreter from the SCL environment to run Odoo.
bash scl enable python27 bash cd /opt/odoo/odoo10 python odoo-bin -c /etc/odoo.conf
8. Configure Nginx as a Reverse Proxy (Optional)
- Install Nginx to serve as a reverse proxy for Odoo if you want to improve performance and security.
sudo yum install nginx
- Configure Nginx to proxy requests to Odoo.
server { listen 80; server_name your_domain.com; location / { proxy_pass http://localhost:8069; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } }
- Restart Nginx for the changes to take effect.
bash sudo service nginx restart
Troubleshooting Tips
- Check Logs: Monitor Odoo logs (
/var/log/odoo/odoo.log
) for any errors or warnings that might indicate configuration issues.
sudo tail -f /var/log/odoo/odoo.log
- Permissions: Ensure file permissions are set correctly for Odoo files and directories.
sudo chown -R odoo: /opt/odoo
- Firewall: If you’re experiencing connectivity issues, ensure that firewall rules allow traffic on ports 80 (HTTP), 443 (HTTPS), and 8069 (Odoo default port).
- Python Environment: Always use the
scl enable python27 bash
command to activate the Python environment before starting Odoo.
Conclusion
By following the overall troubleshooting steps, you should be able to configure Odoo successfully on CentOS 6.6. Odoo comes with a newer version in which there are additional dependencies or requirements. By documenting the general troubleshooting procedures, you should be able to configure Odoo successfully on CentOS 6.6. By documenting the general troubleshooting procedures, you should be able to configure Odoo as the best Odoo server solution successfully on CentOS 6.6 and maintain a robust Odoo environment.