Odoo on Cloudlinux 6 (a journey)
As this has cropped up a couple of times with little in the way of concrete information I figured I'd share my roller coaster ride with this. We have Cloudlinux on our Cpanel server but that shouldn't detract from the process too much.
Intentions:
- Install Odoo 14.0 community edition on Cpanel/Cloudlinux Centos 6
First up.. RPM/Yum installation of odoo showed a myriad of dependencies that aren't supported by the repos I have setup and (showing my ignorance here) I'm not convinced I want to use a different repos if it may compromise my setup so I abandoned this.
So we move to install using WSGI which has so far gone as follows:
- Cloudlinux doesn't have Python selector enabled by default (or at least mine didn't) so:
- WHM > LVE Manager
- Enable Python and install the 3.8.1 (alt) version of Python .
- Make sure the Cpanel feature manager has Python selector enabled .
- Create your postgresql database and user that you intend to use with odoo and assign the user to that database. .
- Odoo requires access to a number of executables (which CageFS will block)so you will need to:
- cat /etc/cagefs/custom.proxy.commands
- Add the following lines:
-
PG_CONFIG=/opt/alt/postgresql11/usr/bin/pg_config DEVTOOLS7_GCC=/opt/rh/devtoolset-7/root/usr/bin/gcc DEVTOOLS7_GPP=/opt/rh/devtoolset-7/root/usr/bin/g++
. - Save the edited file Ref: --depth 1 --branch 14.0 ./odoo
- pip3 install -r [path/]requirements.txt . At this point you should have managed to install the various prerequisites to get odoo to install...
- So, on to installing odoo itself... In shell:
- cd [path/]
- pip3 install ./ .
- With the db and user login for your postgresql db you now initialise the odoo database
- python odoo-bin --init --addons-path=addons --db_host=localhost --db_user=DBUSER --db_password="DBPASS" -d DBNAME --stop-after-init
-
Ok... so, installing the new PostgreSQL version to version 10 or above is doable but tbh I'm not entirely sure how I managed it (with version 12). This is a rough recollection of events: I combined most of the information provided in this post:
.. and replaced it with..# my @cent_pkgs = ( "postgresql", "postgresql-devel", "postgresql-libs", "postgresql-server" ); my @cent_pkgs = ( "postgresql12", "postgresql12-devel", "postgresql12-libs", "postgresql12-server" );
I then (I think) ran the script and it installed postgresql12 successfully even though it wasn't reporting success. My guess is that the process restored the pg_hba.conf default that WHM requires to monitor the postresql server. Whether it's required or not I'm unsure but I then ran:- cagefsctl --force-update
- cagefsctl -M
0 -
Final few clues on fixing the connection to postgreSQL. ref: Can't connect the postgreSQL with psycopg2 Set unix_socket_directories in postgresql.conf to /var/run/postgresql, /tmp, and restart PostgreSQL. ... to ensure that there's a socket connection for psycopg2 to connect to. Edit: /var/lib/pgsql.12/data/pg_hba.conf Add: local all all md5
This will allow your database user to connect to the database. Edit: /etc/cagefs/cagefs.mp Add:/var/run/postgresql
Also need to correct step 4 in the OP. Edit: /etc/cagefs/custom.proxy.commandsPG_CONFIG=/usr/bin/pg_config DEVTOOLS7_GCC=/opt/rh/devtoolset-7/root/usr/bin/gcc DEVTOOLS7_GPP=/opt/rh/devtoolset-7/root/usr/bin/g++
Still not got the app to actually work! but most of the technical hurdles are resolved.0
Please sign in to leave a comment.
Comments
2 comments