{"id":1718,"date":"2014-01-22T20:58:20","date_gmt":"2014-01-22T18:58:20","guid":{"rendered":"http:\/\/raftaman.net\/?p=1718"},"modified":"2021-05-15T11:46:37","modified_gmt":"2021-05-15T09:46:37","slug":"installing-openerp-7-0-on-fedora-20","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1718","title":{"rendered":"Installing OpenERP 7.0 on Fedora 20"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.openerp.com\/\">OpenERP<\/a> is a free an open-source enterprise resource planning (ERP) software. It&#8217;s written in Python and makes heavy use of JavaScript and XML and runs completely in that runs in your browser. <\/p>\n<p><!--more--><\/p>\n<h2>0. Installation prerequisites<\/h2>\n<p>OpenERP needs a <a href=\"http:\/\/www.postgresql.org\/\">PostgreSQL<\/a> database backend and a load of python modules. So here&#8217;s a handy one-liner to install (hopefully) all required packages at once:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# yum install python-dateutil python-docutils python-feedparser python-gdata \\\r\npython-jinja2 python-ldap libxslt-python python-lxml python-mako python-mock \\\r\npython-openid python-psycopg2 python-psutil python-babel pychart pydot \\\r\npython3-pyparsing python-reportlab python-simplejson python-dateutil \\\r\npython-unittest2 python-vatnumber python-vobject python-webdav-library \\\r\npython-werkzeug python-xlwt python-yaml python-ZSI python3-pytz pytz tar wget\r\n<\/pre>\n<h2>1. Create an OpenERP user<\/h2>\n<p>Running a service as root is usually a bad idea. So we create an OpenERP user and group solely for the purpose of running the openerp service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# groupadd openerp\r\n# adduser openerp --system --home-dir=\/opt\/openerp -m -g openerp\r\n<\/pre>\n<h2>2. Set up the PostgreSQL database<\/h2>\n<p>OpenERP uses a PostgreSQL database backend so the next step is to install and configure the PostgreSQL server.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# yum install postgresql-server\r\n<\/pre>\n<p>We now need to initialize the cluster with the <code>initdb<\/code> command<\/p>\n<pre class=\"brush: bash; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n# su - postgres\r\n-bash-4.2$ initdb\r\nThe files belonging to this database system will be owned by user &quot;postgres&quot;.\r\nThis user must also own the server process.\r\n\r\nThe database cluster will be initialized with locale &quot;en_US.UTF-8&quot;.\r\nThe default database encoding has accordingly been set to &quot;UTF8&quot;.\r\nThe default text search configuration will be set to &quot;english&quot;.\r\n\r\nData page checksums are disabled.\r\n\r\nfixing permissions on existing directory \/var\/lib\/pgsql\/data ... ok\r\ncreating subdirectories ... ok\r\nselecting default max_connections ... 100\r\nselecting default shared_buffers ... 128MB\r\ncreating configuration files ... ok\r\ncreating template1 database in \/var\/lib\/pgsql\/data\/base\/1 ... ok\r\ninitializing pg_authid ... ok\r\ninitializing dependencies ... ok\r\ncreating system views ... ok\r\nloading system objects' descriptions ... ok\r\ncreating collations ... ok\r\ncreating conversions ... ok\r\ncreating dictionaries ... ok\r\nsetting privileges on built-in objects ... ok\r\ncreating information schema ... ok\r\nloading PL\/pgSQL server-side language ... ok\r\nvacuuming database template1 ... ok\r\ncopying template1 to template0 ... ok\r\ncopying template1 to postgres ... ok\r\nsyncing data to disk ... ok\r\n\r\nWARNING: enabling &quot;trust&quot; authentication for local connections\r\nYou can change this by editing pg_hba.conf or using the option -A, or\r\n--auth-local and --auth-host, the next time you run initdb.\r\n\r\nSuccess. You can now start the database server using:\r\n\r\n    postgres -D \/var\/lib\/pgsql\/data\r\nor\r\n    pg_ctl -D \/var\/lib\/pgsql\/data -l logfile start\r\n<\/pre>\n<p>While we are already logged in as the <code>postgres<\/code>-user we can also add a database dedicated to OpenERP and a corresponding database user that has access rights to PostgreSQL and can create and drop databases. Eventually you can exit from the <code>postgres<\/code> user account.<\/p>\n<pre class=\"brush: bash; highlight: [1,4]; title: ; notranslate\" title=\"\">\r\n-bash-4.2$ createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp\r\nEnter password for new role: \r\nEnter it again: \r\n-bash-4.2$ exit\r\nlogout\r\n<\/pre>\n<p>Finally, enable and start the <code>postgresql<\/code> service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# systemctl enable postgresql.service \r\nln -s '\/usr\/lib\/systemd\/system\/postgresql.service' '\/etc\/systemd\/system\/multi-user.target.wants\/postgresql.service'\r\n# systemctl start postgresql.service\r\n<\/pre>\n<h2>3. Install the OpenERP server<\/h2>\n<h2>Get the nightly tarball<\/h2>\n<p>Since OpenERP 7.0 is not officially released yet, there&#8217;s no source tarball and we have to take potluck with the nightly source tarball:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# wget http:\/\/nightly.openerp.com\/7.0\/nightly\/src\/openerp-7.0-latest.tar.gz\r\n# tar xvfz openerp-7.0-latest.tar.gz -C \/opt\/openerp\/\r\n# chown -R openerp:openerp \/opt\/openerp\r\n<\/pre>\n<h2>Configure OpenERP<\/h2>\n<p>There is a sample configuration file in <code>\/opt\/openerp\/openerp-7.0-*\/install\/<\/code> called <code>openerp-server.conf<\/code> which is rather minimalistic but will work just fine with one minor adjustment. <\/p>\n<p>First, we make a copy and change the file ownership and permission:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# cp \/opt\/openerp\/openerp-7.0-*\/install\/openerp-server.conf \/etc\/\r\n# chown openerp:openerp \/etc\/openerp-server.conf \r\n# chmod 640 \/etc\/openerp-server.conf\r\n<\/pre>\n<p>And then open the file with an editor to change the <code>db_password<\/code> <\/p>\n<pre class=\"brush: plain; highlight: [7]; title: \/etc\/openerp-server.conf; notranslate\" title=\"\/etc\/openerp-server.conf\">\r\n&#x5B;options]\r\n; This is the password that allows database operations:\r\n; admin_passwd = admin\r\ndb_host = False\r\ndb_port = False\r\ndb_user = openerp\r\ndb_password = openerp\r\n<\/pre>\n<h2>Add a systemd unit file<\/h2>\n<p>To start OpenERP automatically when the host is booted, we add a systemd unit file with the following content. Note that you have to specify the full path to your OpenERP installation in the <code>ExecStart<\/code> variable<\/p>\n<pre class=\"brush: plain; highlight: [16]; title: \/usr\/lib\/systemd\/system\/openerp.service; notranslate\" title=\"\/usr\/lib\/systemd\/system\/openerp.service\">\r\n&#x5B;Unit]\r\nDescription=Advanced OpenSource ERP and CRM server\r\nRequires=postgresql.service\r\nAfter=postgresql.service\r\n&#x5B;Install]\r\nAlias=openerp.service\r\n&#x5B;Service]\r\nType=simple\r\nPermissionsStartOnly=true\r\nEnvironmentFile=-\/etc\/conf.d\/openerp-server\r\nUser=openerp\r\nGroup=openerp\r\nSyslogIdentifier=openerp-server\r\nPIDFile=\/run\/openerp\/openerp-server.pid\r\nExecStartPre=\/usr\/bin\/install -d -m755 -o openerp -g openerp \/run\/openerp\r\nExecStart=\/&lt;path-to-openerp&gt;\/openerp-server -c \/etc\/openerp-server.conf --pid=\/run\/openerp\/openerp-server.pid --syslog $OPENERP_ARGS\r\nExecStop=\/bin\/kill $MAINPID\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>The last thing, left to do is enabling and starting up the service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# systemctl enable openerp.service \r\nln -s '\/usr\/lib\/systemd\/system\/openerp.service' '\/etc\/systemd\/system\/openerp.service'\r\nln -s '\/usr\/lib\/systemd\/system\/openerp.service' '\/etc\/systemd\/system\/multi-user.target.wants\/openerp.service'\r\n# systemctl start openerp.service\r\n<\/pre>\n<p>OpenERP should now be reachable at <a href=\"http:\/\/localhost:8069\">http:\/\/localhost:8069<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenERP is a free an open-source enterprise resource planning (ERP) software. It&#8217;s written in Python and makes heavy use of JavaScript and XML and runs completely in that runs in your browser.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7],"class_list":["post-1718","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-fedora"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1718"}],"version-history":[{"count":18,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1718\/revisions"}],"predecessor-version":[{"id":1736,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1718\/revisions\/1736"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}