On Ubuntu Kylin 16.04 LTS Source Way Installation Odoo

Source: Internet
Author: User
Tags install node wkhtmltopdf

  1. Update Ubuntu Server Software source

    Run the following code:

    sudo apt-get update #更新软件源

    sudo apt-get dist-upgrade #更新软件包, automatically find dependencies

    sudo shutdown-r now #重启服务器 to update the changed content

  2.  

    new System user to run the Odoo program

    Run the following command to create a system User:

    sudo adduser --system --home=/opt/odoo9 --group odoo9   #新建系统用户odoo9, Specifies that the home directory is/opt/odoo9  the

    System user cannot be used to log on and does not have a shell, but you can switch users with the SU command when a specific action is required to do so:

     sudo su  - odoo9 -s /bin/bash  #  switch the current terminal login to the ODOO9 user and use the/bin/bash shell  

    When the command runs, it automatically switches from the current directory to the ODOO9 user's home directory/opt/odoo9. After the operation is completed, enter the Exit command, leaving the odoo9 user's shell and returning to the user who logged in.

  3. Installing and configuring the database server PostgreSQL

    Run the following command to see the version of the PostgreSQL database first:

    Psql–version #查看PostgreSQL版本

    If the error indicates that the PostgreSQL has not been installed before, then it can be installed by the following command:

    sudo apt-get install PostgreSQL #安装PostgreSQL

    Next switch to Postgres user, it is postgresql default initial user, as its identity operation we have the right to configure the database:

    sudo su-postgres

    Then create a new database user as Postgres the Odoo9,odoo program will use that user to access the database, Note that this user will be used in the following configuration file:

    CreateUser--createdb--username postgres--no-createrole--no-superuser--pwprompt odoo9

    According to the system input password, remember the password you set here. Last Run exit exit Postgres user.

  4. Install the Python runtime and wkhtmltopdf (pay special attention to the details of this article, otherwise you will not be able to generate PDF documents after successful installation)

    Run the following command to install the Python runtime that the Odoo 9.0 version relies on:

    sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap PYTHON-LIBXSLT1 python-lxml Python-mako python-mock python-openid python-psycopg2 python-psutil Python-pybabel Python-pychart Python-pydot python-pyparsing python-reportlab python-simplejson Python-tz python-unittest2 Python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-pypdf Python-decorator Python-passlib python-requests

    Note that the Python-pypdf library here can not be capitalized in all lowercase, otherwise it cannot be successfully installed, resulting in PDF documents not being generated

    Download Install Wkhtmltopdf (Odoo uses wkhtmltopdf to output PDF):

    sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb #下载wkhtmltopdf, Note Select the appropriate version based on the operating system

    sudo dpkg-i wkhtmltox-0.12.1_linux-trusty-amd64.deb #安装wkhtmltopdf

    sudo cp/usr/local/bin/wkhtmltopdf/usr/bin/wkhtmltopdf #安装完成后将可执行文件复制到usr/bin

    sudo chown root:root/usr/bin/wkhtmltopdf #更改所有者为root用户

    sudo chmod +x/usr/bin/wkhtmltopdf #并增加可执行属性

    Wkhtmltopdf www.baidu.com ~/baidu.pdf #打印一个网页到home目录, successful PDF creation indicates successful installation

    sudo apt-get install Ttf-wqy-zenhei #安装中文字体

    sudo apt-get install Ttf-wqy-microhei #安装中文字体

  5.  

    Install the Odoo server code (usually wait a long time here)

    sudo  apt-get install git   #安装git软件   

    Sudo su - odoo9 -s  /bin/bash  #切换到odoo9用户   

    git clone -b 9.0 https://github.com/ odoo/odoo.git .   #下载Odoo9.0 code   

    exit  #退出odoo9用户  

  6. Install Nodejs, node-less (this step will often cause problems)

    This step can not be forgotten, or in the future when the Odoo book, the interface will have an error message: Could not execute command LESSC

    Here are two ways to install Nodejs:

    The first, referring to the methods inside the tutorial, but the author after the installation of a successful run error, so the second method to repair:

    Apt-get install-y NPM

    sudo ln-s/usr/bin/nodejs/usr/bin/node

    NPM install-g Less Less-plugin-clean-css

    Apt-get Install Node-less

    The second, source installation (this way to get the latest source code installation):

    wget https://nodejs.org/dist/v4.4.3/node-v4.4.3.tar.gz #获取最新源代码

    Tar zxvf node-v4.4.3.tar.gz #解压缩

    CD node-v4.4.3/

    ./configure

    Make install

    Apt-get Install Node-less

    Cd/usr/lib/nodejs/less/node_module #此步骤及下步骤是笔者在运行出现错误后重装的操作

    NPM Install Clean-css

  7. Configuring Odoo Programs

    The default profile openerp-server.conf includes the basic settings, which need to be changed:

    sudo cp/opt/odoo9/odoo/debian/openerp-server.conf/etc/odoo9-server.conf #把文件复制到/etc directory, It is important to note that Odoo's installation directory changes

    sudo chown odoo9:/etc/odoo9-server.conf #将所有权赋予odoo用户和用户组

    sudo chmod 640/etc/odoo9-server.conf #只允许odoo用户和root用户读取

    Edit it with the Nano editor that comes with Ubuntu, and run the following command to open the configuration file:

    sudo nano/etc/odoo9-server.conf #注意文件名不要弄错

    What needs to be changed is as follows,

    1, ADMIN_PASSPW = WLBNT #设置odoo安装账套的主控密码

    2, Db_user = Odoo9 #前面新建的数据库用户

    3, Db_password = passwd #设置密码

    4, Addons_path =/opt/odoo9/odoo/addons/ #此处注意安装目录的问题

    5, logfile =/var/log/odoo9/odoo9-server.log

    After the profile is edited, press Ctrl+o, then enter the overwrite save, and then Ctrl+x exit the Nano program. The configuration file specifies the location where the log files are stored, so create this directory and let it be read and written by odoo9 users:

    sudo mkdir/var/log/odoo9

    sudo chown odoo9:root/var/log/odoo9

    You can now try to start the Odoo server:

    sudo su-odoo9-s/bin/bash #先切换到odoo9用户,

    ./openerp-server-c/etc/odoo9-server.conf #运行Odoo

    Enter the HTTP://IP address in the browser: 8069/, because it is a new installation, has not created a posting set, so the default will go to the database management interface.

    If everything works, press CTRL + C to stop the server, and then leave the ODOO9 user with the Exit command to return to your own landing shell. If an error occurs, you need to review the Odoo-server.log troubleshooting errors. (For convenience, the logfile line in the configuration file can be commented out first, so that you can see the error message directly in the console)

  8.  

    install startup script

    Start, stop Odoo service requires more than one step of operation, more cumbersome, You can install startup scripts to process these steps in batches. You can go to the resources to download the modified file (in particular, it is important to note that if Odoo's installation directory is different from the file directory in the downloaded file, the file cannot be modified and saved under Windows, or the file will not run) , copy to/etc/ init.d/, then change it to an executable file and assign it to the root user:

    sudo chmod 755 /etc/init.d/odoo9-server  

    Sudo chown root: /etc/init.d/odoo9-server

    To start the Odoo server, enter:

    sudo /etc/init.d/ Odoo9-server start

    You can then view the log file to see if Odoo has started:

    Less /var/log/odoo9/odoo9-server.log

    To exit the less command's viewing interface, simply press the Q key. If there is a problem during startup, you can find the cause based on the contents of the log file. Check below to see if the Odoo server can be properly stopped:

    Sudo /etc/init.d/odoo9-server stop  

    Check the log file to make sure the service is stopped. You can also use the top command to check the process tables that the Ubuntu server is running. (The view interface for exiting the top command is also press the Q key)

  9. 9

    Set Odoo to boot from

    Let the startup script automatically start and close the Odoo service as the Ubuntu server opens and shuts down.

    sudo update-rc.d odoo9-server defaults

    You can restart your server now, and when you log in again, Odoo should already be running. Enter the following command to see if Odoo is already running:

    PS aux | grep odoo9

    At this point, the odoo9 is already installed and can be powered on and run automatically

On Ubuntu Kylin 16.04 LTS Source Way Installation Odoo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.