Last active
November 19, 2018 20:56
-
-
Save samjaninf/ed29d27b75d1ed2492621af59975f2da to your computer and use it in GitHub Desktop.
install odoo 11 centos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| adduser --system --shell=/bin/bash --home-dir=/opt/odoo --user-group odoo | |
| yum -y groupinstall "development tools" | |
| yum -y install https://centos7.iuscommunity.org/ius-release.rpm | |
| yum -y install python36u python36u-pip python36u-devel wget unzip postgresql-devel npm nodejs git libjpeg-devel libxml2-devel libxslt-devel openldap-devel cyrus-sasl-devel | |
| pip3.6 install --upgrade pip | |
| ln -s /usr/bin/python3.6 /usr/bin/python3 | |
| wget -nc https://github.com/odoo/odoo/archive/11.0.zip -O archive.zip | |
| unzip -nq archive.zip | |
| mkdir -p /opt/odoo | |
| mkdir -p /etc/odoo | |
| mkdir -p /var/log/odoo | |
| mv odoo-11.0 odoo | |
| mv odoo /opt/odoo/ | |
| chown odoo:odoo /opt/odoo/ -R && chown odoo:odoo /var/log/odoo/ -R | |
| cd /opt/odoo/odoo && pip3.6 install -r requirements.txt | |
| npm install -g less less-plugin-clean-css -y | |
| mkdir /opt/wkhtmltox && cd /opt/wkhtmltox && wget -nc https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
| tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
| cd /opt/wkhtmltox/wkhtmltox | |
| cp -R /opt/wkhtmltox/wkhtmltox/* /usr/local/ | |
| ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf | |
| ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage | |
| mkdir /opt/geolite && cd /opt/geolite && wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
| gunzip GeoLiteCity.dat.gz | |
| mkdir /usr/share/GeoIP | |
| mv /opt/geolite/GeoLiteCity.dat /usr/share/GeoIP | |
| postgresql-setup initdb | |
| systemctl enable --now postgresql | |
| su - postgres -c "createuser -s odoo" | |
| su - postgres -c "psql -c \"alter user odoo with encrypted password 'Temple_46';\"" | |
| su - odoo -c "/opt/odoo/odoo/odoo-bin --addons-path=/opt/odoo/odoo/addons -s --stop-after-init" | |
| mv /opt/odoo/.odoorc /etc/odoo/odoo.conf | |
| sed -i "s,^\(logfile = \).*,\1"/var/log/odoo/odoo.log"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(logrotate = \).*,\1"True"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(db_host = \).*,\1"localhost"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(db_name = \).*,\1"odoo"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(db_password = \).*,\1"odoo"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(db_template = \).*,\1"template0"," /etc/odoo/odoo.conf | |
| sed -i "s,^\(db_user = \).*,\1"odoo"," /etc/odoo/odoo.conf | |
| ln -s /opt/odoo/odoo/odoo-bin /usr/bin/odoo | |
| cat << EOF > /usr/lib/systemd/system/odoo.service | |
| [Unit] | |
| Description=odoo | |
| Wants=network.target | |
| [Service] | |
| Type=simple | |
| User=odoo | |
| Group=odoo | |
| ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOF | |
| systemctl enable --now odoo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment