Use ubuntu server18.04 build odoo12 operating environment

odoo12 runtime environment consists of three main conditions:

   1, ubuntu server 18.04, this is the official recommendation of the server operating environment;

    2, postgresql 10 database, version 11 has a problem;

 3, python3 to odoo12 required to run the package.   

 

First, install ubuntu basic environment

1.1, install ubuntu server 18.04,

1.2, the installation process select openssh option to prepare for the remote control, or use the end sudo apt install openssh-server installation

1.3, configuration time, modified time zone, Reference: https://blog.csdn.net/zhengchaooo/article/details/79500032

1.4, add the source image:

south you /etc/apt/sources.list  

deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

Is the source address above 18.04 version of Netease, to prepare for subsequent software update
1.5, update system

sudo apt-get update
sudo apt-get upgrade

1.6, reboot the system

sudo reboot Second, install postgresql 10 Database 2.1, install the 10 version of the database, choose a small version of the current maximum version is currently installed postgresql10.10


sudo apt install postgresql-10 -y

After installation is complete, with the system automatically run;

While producing a postgres postgres user and a database, postgres account password is random, in order to enter the database-related operations, you need to change the user's password postgres

2.2, create an account to access the database, two steps, first create a system user, the second step will be to empower the user to the database

step one:

# Create a system user account 
sudo adduser odoo
at # newly created user empowerment, the empowerment process should go to the root user (newly installed system rootz account password is blank, use the command sudo passwd root to root account password )
su root or su -
# use the visudo command to edit / etc / sudoers file odoo authorized users
visudo / etc / sudoers

Step Two


Third, the environment and the configuration dependent packages python3

3.1, install python3.5 confirm or later, you can modify the version under odoo

 

# Modify the .bashrc file alias Python Alias = ' /usr/bin/python3.6 ' 
the sudo Vim ~ / .bashrc
# the changes to take effect immediately
source ~ / .bashrc

3.2, the installation-dependent pip3 python3

sudo apt install python3-pip -y
sudo apt-get install git python3-dev python3-pip -y
sudo apt install build-essential libxslt-dev libzip-dev libldap2-dev libsasl2-dev libssl-dev -y

 

2.3, installation Node.js:
the sudo -Y NPM APT the install
the sudo -g less NPM the install

2.8, install dependencies
sudo pip3 install Babel passlib lxml decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 Mako MarkupSafe mock num2words ofxparse Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd
another method (recommend this method, in addition requirements.txt file can be found in the odoo directory):
wget HTTPS: / /raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt
sudo -H PIP3 install -r requirements.txt

2.9, install Chinese fonts and print reports need to be wkhtmltopdf
sudo install ttf-APT-wqy zenhei -y
sudo APT install ttf-wqy-microhei -y
wget "https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_amd64.deb"
2.10, install odoo12 source
sudo su odoo
git clone https://github.com/ odoo / odoo.git / Home / odoo / odoo12. 1 -b = 12.0 --depth
2.11, start odoo12
./odoo-bin,

three system configurations
3.1, creating a configuration file
  ./odoo-bin --save - stop-after -init
the next step we need the system configuration file in the configuration file directory / etc, the following commands:

. 1
2
. 3
. 4
the sudo mkdir / etc / odoo
the sudo /home/odoo/.odoorc CP / etc / odoo / odoo.conf
the sudo chown -R & lt odoo / etc / odoo
the sudo the chmod = R & lt U, G = RW, O = R & lt /etc/odoo/odoo.conf use security reinforcing #
Finally, the above command line is optional, but it improves the safety of the system. It ensures that the process is running Odoo users can read but can not modify the configuration file. Then you will not be able to modify the database master password, but in the production of this service is not a problem, because you should use list_db = False to disable web service configuration database administrator. We need to create a directory to store log files to Odoo service. This is usually placed under the / var / log directory, the following commands:

. 1
2
the sudo mkdir / var / log / odoo
the sudo chown odoo / var / log / odoo
/ POST / odoo-12-1

Guess you like

Origin www.cnblogs.com/wwh/p/11609318.html