In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to compile odoo8 on tinycolinux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Odoo uses python, and talking about the excellent comparison of languages is enough to set off a big debate. I'm not going to repeat the old topics that focus on how pythonic is inside the language, just a few external features:
1, C series and native programs are the cornerstone of almost all visible system implementations in reality, but C series is not necessarily the best, they are pragmatic products that are used first, and python is the de facto scripting language environment for all linux releases.
2. In terms of language selection, although the engineering level is to propose more and more scripting languages to support all kinds of domain, in fact, history still tends to directly support a rich langtechs language to support library-level expression of DSL, which is why many languages in history have done some things well in a certain field. In fact, they are not easy to use in other fields, but they still claim to be a general scripting language. For example, php is not used for non-WEB development, other languages are not often used in natural languages or scientific computing, etc., although python is not universal enough, but in fact its application field is the most general.
3. In terms of language selection, more and more languages are advocated in engineering, but for people and learners, we generally tend to learn only two languages, one C-Series must-learn (C or C++), and the other application scripting language, and these two languages form the only two selection features of one host one guest. According to the two languages mentioned in 2, more and more of these features should be included in DSL. Although lua is as subtle as C in orthogonal design, it is easy to interact with c as hosting, but it still needs to appear c-series object-oriented and other CPP multi-paradigm demand scenarios, so in addition to lua,c, which is more dedicated, basic and partial, we still need to learn the support of python and cpp in application, and python is the battery included language of both langtech level and liblevel.
Python in onlytwo as guest for c series is a mixed language system, and there are already real works of mixed languages in the industry. The following products also have comparisons in the Python world: for example, to make terralang that supports domain logic + jit in DSL, such as moonscript in compiled to lua (it proposes that new languages eliminate the need for direct binding) For example, cython,zephir is a "mixed language" system that only generates C modules as the original language module (it does not propose a new language).
Let's build the lnpp appstack structure (linux+nginx+python+postgresql) on tinycolinux and install odoo8. Note that here we only simplify the necessary modules for installing odoo and web-related modules.
Compile python+uswgi and postgresql for lnpp
Following the article "creating applications for tinycolinux and lnmp- source code and toolchain", we are compiling python this time. In addition to the tinycorelinux tcz needed in gcc in this article, we also need openssl-1.0.0-dev.tcz (in fact, python compilation does not need it, but then pip will use it), extract and install it, download python src, I chose Python-2.7.14rc1.tgz, extract cd to the src directory, we are / home/tc/Python-2.7.14rc1 Sudo. / configure-- prefix=/usr/local/python (you can add-- enable-threads will need to start uswgi multithreading support with python in the future), sudo make install
Cd / usr/local/python/bin, download pip,wget-- no-check-certificate https://bootstrap.pypa.io/get-pip.py, and then install pip on sudo python get-pip.py. Next, you can install uswgi sudo pip install uswgi (which will use the same pcre-dev.tcz as nginx at compile time), run uswgi, and show that the installed version of uswgi is, ctl+c exits it, and we'll run it with the correct detailed parameters in the second part below.
I downloaded postgresql-10.1.tar.gz for pgsql, and handling it as I did with python src would require the use of readline, which was disabled in sudo. / configure-- prefix=/usr/local/pgsql-- disable-redline. The sudo make install is compiled. Then create a data folder in / usr/local/pgsql, right-click to set permissions to 7777 groups of root, and user tc [1001]. This is because pgsql does not actually allow it to run in root mode by default.
Sudo-u tc / usr/local/pgsql/bin/initdb-D / usr/local/pgsql/data-- encoding=UTF8 creates the default system database base, and then starts it sudo-u tc / usr/local/pgsql/bin/pg_ctl start-D / usr/local/pgsql/data (pg_ctl start is also postgresql). In this case, the tc user's password for this database is empty port 5432. Sudo-u tc / usr/local/pgsql/bin/psql base can be connected to management, ctl+c exit management, and enter the data directory. Modify the two conf files so that you can locally use navcat and other tools to manage otherwise server closed the connection unexpectedly postgresql errors will occur, first open listenadress= "*" in postgresql.conf, and then add a note in pg_hba.conf: host all all 10.0.2.2 host windows 32 trust (10.0.2.2 is the host windows address in tinycolinux slirp mode, you can also change it to 0.0.0.0).
Why add-- encoding. Because if you don't, you will be prompted later after installing odoo to set up the odoo database in base: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
Install the thin odoo,python module and configure the uswgi and nginx parameters in lnpp
Let's install odoo before we deal with python, so that when running it, we can install the missing python modules one by one through pip, release odoo8 to / usr/local/nginx/html, and simplify all modules installed by / usr/local/nginx/html/odoo/addons, leaving only the following:
Accountaccount_voucheranalyticauth_cryptauth_signupbase_action_rulebase_importbase_setupboardbuscalendarcontactsdecimal_precisiondocumentediemail_templatefetchmailgamificationgoogle_accountgoogle_driveim_chatim_livechatknowledgemailmarketingnotepadpad_projectpaymentpayment_paypalpayment_transferprocurementproductprojectreportresourcesalesales_teamsharewebwebsitewebsite_blogwebsite_forumwebsite_forum_docwebsite_livechatwebsite_mailwebsite_partnerwebsite_paymentwebsite_reportwebsite_saleweb_calendarweb_diagramweb_ganttweb_graphweb_kanbanweb_kanban_gaugeweb_kanban_sparklineweb_testsweb_view_editor
Let's jointly configure uwsgi and python,nginx. We also want to launch nginx,mysql and php-cgi independently, just like lnmp (which is equivalent to uwsgi in python), and start uswgi first:
/ usr/local/python/bin/uwsgi-socket: 8000-pythonpath / usr/local/nginx/html/odoo-wsgi-file / usr/local/nginx/html/odoo/openerp-wsgi.py
In fact, it also has many variants and abbreviations (you can test it separately by creating a small example online instead of the content in openerp-wsgi.py):
-socket=:8000-- master-- uid=tc-- gid=root-- wsgi-file / usr/local/nginx/html/odoo/openerp-wsgi.py-- daemonize=/usr/local/python/bin/uwsgi.log
-- socket=:8000-- chdir=/usr/local/nginx/html/odoo-- wsgi-file openerp-wsgi.py (the above chdir can also be replaced by pythonpath. The application module in this pythonpath is not python to find a meaningful pythonmoudlepath)
-- manage-script-name-- mount / yourapplication=myapp:app
-s: 8000-w uwsgi-server:application-d somelogfile
(all the above parameters can be written into an ini, and then proceed as uswgi specifies ini, but above we prefer not to use uwsgi+ini files)
You can see that there is always something statically configured above, either address or module name or class name, and the parameters after php-cgi in lnmp are not linked to any static address. It is a global server that converts language services into cgi or uwsgi, so we have to change it. This change is called "dynamic mode of uswgi":
/ usr/local/python/bin/uwsgi-socket=:8000-master-daemonize=/usr/local/python/bin/uwsgi.log
Correctly configured under nginx to match the "dynamic mode" from the above uwsgi (you can see the correspondence with the configuration entries in static mode):
Include uwsgi_params;uwsgi_param UWSGI_CHDIR / usr/local/nginx/html/odoo;uwsgi_param UWSGI_MODULE uwsgi-server; (no .py) uwsgi_param UWSGI_CALLABLE application;uwsgi_pass 127.0.0.1 uwsgi_param UWSGI_CALLABLE application;uwsgi_pass 8000
Modifying the swgi-openerp.py under / usr/local/nginx/html/odoo corresponds to some of the following entries (it is equivalent to the content in. / openerp-server-c. / openerp-server.conf,openerp-server.conf in the cd directory, that is, similar to the resulting configuration file modified below):
Db_host = 127.0.0.1db_port = 5432db_user = tcdb_password = pg_path = / usr/local/pgsql/binaddons_path = / usr/local/nginx/html/odoo/addons,/usr/local/pgsql/data/addons/8.0 (if this is not set, it will cause http://xxx:/web/static.... Full.css 404) data_dir = / usr/local/pgsql/data
Make sure that the required modules for python are carried out at the end, comment out the daemonize entry when uwsgi starts, view the output after startup, and install the sudo pip install module name one by one. The special treatment for pillow and pychart is as follows:
.sudo pip install Pillow==3.4.2 (cant create space error will occur if you do not install this version) sudo pip install http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pychart/python-pychart_1.39.orig.tar.gz.....
All of the above lnpp will be started successfully and will automatically generate directories such as filestor,addons/8.0 under / usr/local/pgsql/data. Visit localhost and succeed!
To sum up, we need to start nginx,uswgi and / opt/bootlocal.sh at tinycolinux startup with the following command
/ usr/local/nginx/sbin/nginx/usr/local/python/bin/uwsgi-socket=:8000-- master-- uid=tc-- gid=root-- daemonize=/usr/local/python/bin/uwsgi.log sudo-u tc / usr/local/pgsql/bin/postgres-D / usr/local/pgsql/data
All right, how to apply and operate odoo is another situation. In all the operations of odoo, the data has a fixed view, a blog post and a file are the same, a product and a computer are the same, faint, I remember how to enter the management mode, forgot.
This is the end of "how to compile odoo8 on tinycolinux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.