How to install OpenERP 6.1 on Ubuntu 10.04 LTS
The new release of OpenERP 6.1 heralds a great many incremental improvements in the product plus a complete re-write of the web interface; which is a massive improvement and much more an integral part of OpenERP than it’s predecessor.
UPDATE: By popular request here is a subsequent post describing how to set up a reverse proxy and ssl using nginx.
As my previous howto for 6.0 was a such roaring success I thought I’d better do something for the new 6.1 release too.
Before continuing, I should mention that you can simply download a “.deb” package of OpenERP 6.1 and install that on Ubuntu. But that doesn’t provide me with enough fine grained control over what and where things get installed and it restricts our flexibility to modify & customise hence I prefer to do it a slightly more manual way… (It should be said though, that this install process should only take about 10-15 minutes once the host machine has been built)
So without further ado here we go:
Step 1. Build your server
I install just the bare minimum from the install routine (you can install the openssh-server
during the install procedure or install subsequently depending on your preference).
After the server has restarted for the first time I install the openssh-server
package (so we can connect to it remotely) and denyhosts
to add a degree of brute-force attack protection. There are other protection applications available: I’m not saying this one is the best, but it’s one that works and is easy to configure and manage. If you don’t already, it’s also worth looking at setting up key-based ssh access, rather than relying on passwords. This can also help to limit the potential of brute-force attacks. [NB: This isn’t a How To on securing your server…]
sudo apt-get install openssh-server denyhosts
Now make sure you are running all the latest patches by doing an update:
sudo apt-get update
sudo apt-get dist-upgrade
Although not always essential it’s probably a good idea to reboot your server now and make sure it all comes back up and you can login via ssh.
Now we’re ready to start the OpenERP install.
Step 2. Create the OpenERP user that will own and run the application
sudo adduser --system --home=/opt/openerp --group openerp
This is a “system†user. It is there to own and run the application, it isn’t supposed to be a person type user with a login etc. In Ubuntu, a system user gets a UID below 1000, has no shell (it’s actually /bin/false
) and has logins disabled. Note that I’ve specified a “home†of /opt/openerp
, this is where the OpenERP server code will reside and is created automatically by the command above. The location of the server code is your choice of course, but be aware that some of the instructions and configuration files below may need to be altered if you decide to install to a different location.
A question I was asked a few times in the previous how to for 6.0 was how to run the OpenERP server as the openerp system user from the command line if it has no shell. This can be done quite easily:
sudo su - openerp -s /bin/bash
This will su
your current terminal login to the openerp user (the “-
” between su
and openerp
is correct) and use the shell /bin/bash
. When this command is run you will be in openerp’s home directory: /opt/openerp
.
When you have done what you need you can leave the openerp user’s shell by typing exit
.
Step 3. Install and configure the database server, PostgreSQL
sudo apt-get install postgresql
Then configure the OpenERP user on postgres:
First change to the postgres user so we have the necessary privileges to configure the database.
sudo su - postgres
Now create a new database user. This is so OpenERP has access rights to connect to PostgreSQL and to create and drop databases. Remember what your choice of password is here; you will need it later on:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********
Finally exit from the postgres user account:
exit
Step 4. Install the necessary Python libraries for the server
Update 27/02/2012: Many thanks to Gavin for reporting. Have added python-simplejson to the package list.
sudo apt-get install python-dateutil python-feedparser python-gdata \
python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \
python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \
python-simplejson python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-zsi
From what I can tell, on Ubuntu 10.04 the package python-werkzeug is too old and this will cause the server to not start properly. If you are trying this on a later version of Ubuntu then you might be OK, but just in-case you can also do the following.
I found it necessary to install a more recent version of Werkzeug using Python’s own package management library PIP. The python pip tool can be installed like this:
sudo apt-get install python-pip
Then remove Ubuntu’s packaged version of werkzeug:
sudo apt-get remove python-werkzeug
Then install the up-to-date version of werkzeug:
sudo pip install werkzeug
With that done, all the dependencies for installing OpenERP 6.1 are now satisfied, including for the new integral web interface.
Step 5. Install the OpenERP server
I tend to use wget
for this sort of thing and I download the files to my home directory.
Make sure you get the latest version of the application. At the time of writing this it’s 6.1-1; I got the download links from their download page.
wget http://nightly.openerp.com/6.1/releases/openerp-6.1-1.tar.gz
Now install the code where we need it: cd
to the /opt/openerp/
directory and extract the tarball there.
cd /opt/openerp
sudo tar xvf ~/openerp-6.1-1.tar.gz
Next we need to change the ownership of all the the files to the OpenERP user and group.
sudo chown -R openerp: *
And finally, the way I have done this is to copy the server directory to something with a simpler name so that the configuration files and boot scripts don’t need constant editing (I called it, rather unimaginatively, server). I started out using a symlink solution, but I found that when it comes to upgrading, it seems to make more sense to me to just keep a copy of the files in place and then overwrite them with the new code. This way you keep any custom or user-installed modules and reports etc. all in the right place.
sudo cp -a openerp-6.1-1 server
As an example, should OpenERP 6.1-2 come out soon, I can extract the tarballs into /opt/openerp/ as above. I can do any testing I need, then repeat the copy command so that the modified files will overwrite as needed and any custom modules, report templates and such will be retained. Once satisfied the upgrade is stable, the older 6.1-1 directories can be removed if wanted.
That’s the OpenERP server software installed. The last steps to a working system is to set up the configuration file and associated boot script so OpenERP starts and stops automatically when the server itself stops and starts.
Step 6. Configuring the OpenERP application
The default configuration file for the server (in /opt/openerp/server/install/
) is actually very minimal and will, with only one small change work fine so we’ll simply copy that file to where we need it and change it’s ownership and permissions:
sudo cp /opt/openerp/server/install/openerp-server.conf /etc/
sudo chown openerp: /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf
The above commands make the file owned and writeable only by the openerp user and group and only readable by openerp and root.
To allow the OpenERP server to run initially, you should only need to change one line in this file. Toward to the top of the file change the line db_password = False
to the same password you used back in step 3. Use your favourite text editor here. I tend to use nano, e.g.
sudo nano /etc/openerp-server.conf
One other line we might as well add to the configuration file now, is to tell OpenERP where to write its log file. To complement my suggested location below add the following line to the openerp-server.conf
file:
logfile = /var/log/openerp/openerp-server.log
Once the configuration file is edited and saved, you can start the server just to check if it actually runs.
sudo su - openerp -s /bin/bash
/opt/openerp/server/openerp-server
If you end up with a few lines eventually saying OpenERP is running and waiting for connections then you are all set. Just type CTL+C
to stop the server then exit
to leave the openerp user’s shell.
If there are errors, you’ll need to go back and check where the problem is.
Step 7. Installing the boot script
For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user. There is a script you can use in /opt/openerp/server/install/openerp-server.init
but this will need a few small modifications to work with the system installed the way I have described above. Here’s a link to the one I’ve already modified for 6.1-1.
Similar to the configuration file, you need to either copy it or paste the contents of this script to a file in /etc/init.d/
and call it openerp-server
. Once it is in the right place you will need to make it executable and owned by root:
sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server
In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the openerp user:
sudo mkdir /var/log/openerp
sudo chown openerp:root /var/log/openerp
Step 8. Testing the server
To start the OpenERP server type:
sudo /etc/init.d/openerp-server start
You should now be able to view the logfile and see that the server has started.
less /var/log/openerp/openerp-server.log
If there are any problems starting the server you need to go back and check. There’s really no point ploughing on if the server doesn’t start…
If the log file looks OK, now point your web browser at the domain or IP address of your OpenERP server (or localhost if you are on the same machine) and use port 8069. The url will look something like this:
http://IP_or_domain.com:8069
What you should see is a screen like this one:
What I do recommend you do at this point is to change the super admin password to something nice and strong (Click the “Manage Databases” link below the main Login box). By default this password is just “admin” and knowing that, a user can create, backup, restore and drop databases! This password is stored in plain text in the /etc/openerp-server.conf
file; hence why we restricted access to just openerp and root. When you change and save the new password the /etc/openerp-server.conf
file will be re-written and will have a lot more options in it.
Now it’s time to make sure the server stops properly too:
sudo /etc/init.d/openerp-server stop
Check the logfile again to make sure it has stopped and/or look at your server’s process list.
Step 9. Automating OpenERP startup and shutdown
If everything above seems to be working OK, the final step is make the script start and stop automatically with the Ubuntu Server. To do this type:
sudo update-rc.d openerp-server defaults
You can now try rebooting you server if you like. OpenERP should be running by the time you log back in.
If you type ps aux | grep openerp
you should see a line similar to this:
openerp 1491 0.1 10.6 207132 53596 ? Sl 22:23 0:02 python /opt/openerp/server/openerp-server -c /etc/openerp-server.conf
Which shows that the server is running. And of course you can check the logfile or visit the server from your web browser too.
That’s it!
OpenERP 6.1 really is a major step up in terms of improvements from 6.0 and the new integrated web interface (with a Point of Sale and a Mobile interface built-in) are really very cool. Performance has improved considerably and the way the new web service interfaces to OpenERP is very different. So, if I get the time, the next instalment of these posts will go into a bit of detail about how this works and some alternative ways to provide more secure access, such as reverse proxy.
Hi Alan
I am using OpenERP 6.0.3 on OpenSuse 12.1.
Couldn’t find RPM packages for OpenERP 6.1.1.
Could you please let me know:
1. Where I could find the rpm packages to download (both server and web)
2. Is there any way to “upgrade” from 6.0.3 to 6.1.1
Thanks.
Jamil.
@Jamil,
1. Sorry but I have no idea if anyone has packaged OpenERP for rpm-based distros.
2. Not easily unless you have an OpenERP enterprise warranty. See earlier comments on this very subject.
Thank Alan as always.
I’ll start bugging OpenSuse’s build manager to incorporate OpenERP 6.1 in their repository. They had included Beta of OpenERP with OpenSuse 12.1, but I need the released version NOT Beta.
Thanks.
Due to the nature of OpenERP I am not a fan of pre-packaged versions. You are then stuck with the distro’s choices. Install from the source tarball: it’s easy and you have more control…
Thanks Alan, I’ll definitely give a try with tarball. I believe, I could get pretty good reference starting from Step-5 in this blog page. Before trying with tarball, I have a question:
1. Do I need to uninstall OpenERP 6.0.3. Pstgresql ?
In another note, as OpenERP 6.1 package is available for Ubuntu (debian package), one fellow in the OpenSuse forum suggested me to use “alien” tool to convert .deb to .rpm and then install on OpenSuse 12.1. Last night I gave a try and installed the OpenERP (a noarch version of 6.1.1) on my OpenSuse 12.1. Installation was successful. But, I found it is ONLY one single package (looks like server), where is web client ? Does OpenERP 6.1 (no arch ersion) comes with ONLY server package ?
I am getting the following error
prince@prince-desktop:~$ sudo su - openerp -s /bin/bash
[sudo] password for prince:
openerp@prince-desktop:~$ /opt/openerp/openerp-6.1/openerp-server
Traceback (most recent call last):
File "/opt/openerp/openerp-6.1/openerp-server", line 42, in
import openerp
File "/opt/openerp/openerp-6.1/openerp/__init__.py", line 28, in
import addons
File "/opt/openerp/openerp-6.1/openerp/addons/__init__.py", line 38, in
from openerp.modules import get_module_resource, get_module_path
File "/opt/openerp/openerp-6.1/openerp/modules/__init__.py", line 28, in
import openerp.modules.graph
File "/opt/openerp/openerp-6.1/openerp/modules/graph.py", line 32, in
import openerp.osv as osv
File "/opt/openerp/openerp-6.1/openerp/osv/__init__.py", line 22, in
import osv
File "/opt/openerp/openerp-6.1/openerp/osv/osv.py", line 28, in
import orm
File "/opt/openerp/openerp-6.1/openerp/osv/orm.py", line 57, in
import fields
File "/opt/openerp/openerp-6.1/openerp/osv/fields.py", line 44, in
import openerp.tools as tools
ImportError: No module named tools
openerp@prince-desktop:~$
Thank you
You haven’t followed the instructions carefully by the looks of it. The path is wrong in your error output. You will need to adapt the configuration file if you have not followed the instructions accurately.
Hi Alan
Thank you so much for this detailed and enlightening tutorial. I spent a whole day trying to install OpenERP on Linux just with the official ebook and the online guide. But they seem a bit outdated and incomplete. After too many attempts with several Linux, Python and OpenERP versions I finally got it done by following your step by step your well described solution. Thank you!!
Hi Alan:
In my previous note on March 28, I mentioned to try from Step-5 (of this blog).
But the installation of OpenERP 6.1 failed on OpenSuse 12.1
What I did:
1. Skipped Step-1 (Build your server), reason: I was attempting to install on OpenSuse 12.1
2. Skipped Step-2 (Create the OpenERP user…), reason: I already had this created for OpenERP 6.0.3
3. Skipped Step-3 (PostgreSQL install), reason: I already had this installed for OpenERP 6.0.3
4. Skipped Step-4 (install pythos), reason: I already had this installed for OpenERP 6.0.3
5. Followed Step-5 (install OpenERP from tarball), it was installed without any error
6. Followed Step-6 (configure OpenERP), configured as documented in this step (only difference, the install directory for OpenSuse 12.1 was different, /usr/bin which was automatically picked by YAST installation and software management tool of OpenSuse)
7. Skipped Step-7 (installing boot script), reason: wanted to run first manually
8. Followed Step-9, (started postgresql <– this is not mentioned in this step), started the server but can't connect using the port 8069)
Please suggest what can I do ?
Thanks.
I wondering what the difference is with openBravo and openERP.If there is anyone with experience with both
Hi Alan,
I succesfully used your guide for the installation of 6.0.3. I used also your 6.1. guide for the installation of 6.1. , this also worked fine. Thank you for your good work.
With pgAdmin i made a backup of the database of the 6.0.3. version. After installation of the 6.1 version I tried to restore it with pgAdmin. The restore has been succesful because it gave a returncode 0 which is ok. When I tried to login with 6.1 I get an OpenERP server error. I am afraid the builders has changed the database scheme from 6.0.3 to 6.1 . I am afraid this is part of the company policy of OpenERP SA to force to sell expensive OpenERP enterprise warranty. I have never seen this trick of making money before, this is not good for the community. Do you know a way to easily check the differences in the database schemes? Do you know a way of easily exporting and importing parts of the database and fixing the scheme differences. Or methods of solving this. I don’t want to be a junkie of the OpenERP enterprise warranty.
I have no problem with OpenERP s.a and the Enterprise Warranty, they provide a fantastic business application for free, yet they do need to make money to support the development of the product and their customers.
Our customers, who rely on OpenERP for their business, do not seem to have a problem with the Enterprise Warranty either.
There is a project on Launchpad to deliver a migration server which you may find useful, and even better you can contribute to it as well.
Simprocity is an OpenERP partner. Compared with other ERP systems that we have implemented for customers, OpenERP is extremely reasonably priced. Ten users is $1,950 for the year. This includes the data conversion you require plus bug fixes and telephone support. I hope you will consider licensing as you may recoup those costs in saved time.
Simprocity has created a Virtual Machine that can be downloaded at http://www.simprocityinc.com/openerp6.1-1/SimprocityOpenERP61Srv386.zip for users to test OpenERP 6.1-1. Thank you to The Open Sourcerer and Alan Lord for the init script.
OpenErp is buggy and not functional enough for even a small company. Own modules and community modules are needed to work with this software. Because of buggyness you need to upgrade often. Even in minor software updates the database is not compatible. 165 € per month is not for free. Only bigger companies have money enough to work with this software. I am willing to pay a reasonable amount for good software. Even 165 € A month. But i am now testing this product for some months now and i am in very doubt to go further with it. Import export doesn’t work reliable. The documentation is bad. the on line version is not functional enough on the accounting module. I am now trying to use it for document management and making proposals.
Hello,
I followed your instruction and it works, thank you.
But
When i want to install, for example, Google modules, an error occures : it doesn’t find the gdata module wich is installed :’Please install gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/liste‘
Do you have an idea?
Hi! Thanks for this tutorial.
At the end of step 6, I get the following error :
Traceback (most recent call last):
File “/opt/openerp/server/openerp-server”, line 42, in
import openerp
File “/opt/openerp/server/openerp/__init__.py”, line 28, in
import addons
File “/opt/openerp/server/openerp/addons/__init__.py”, line 38, in
from openerp.modules import get_module_resource, get_module_path
File “/opt/openerp/server/openerp/modules/__init__.py”, line 28, in
import openerp.modules.graph
File “/opt/openerp/server/openerp/modules/graph.py”, line 32, in
import openerp.osv as osv
File “/opt/openerp/server/openerp/osv/__init__.py”, line 22, in
import osv
File “/opt/openerp/server/openerp/osv/osv.py”, line 28, in
import orm
File “/opt/openerp/server/openerp/osv/orm.py”, line 1406
with open(config.get(‘import_partial’), ‘rb’) as partial_import_file:
^
SyntaxError: invalid syntax
I really don’t know where the problem is … Thanks!
@Pasca,
in my case it’s work affter install gdata for python. My python 2.6 on ubuntu 10.04.
I had Download 2.0.6 from http://code.google.com/p/gdata-python-client/downloads/liste.
Before install “export PYTHONPATH=/usr/local/lib/python2.6/dist-packages” and run ./setup.py install make sure chmod setup.py 0755, and test ./tests/run_data_tests.py if it’s work you won’t see error again.
Hallo
Thanks for your instruction , it did work after 3 DAYS OF TROUBLE, BUT WEN YOU TRY TO LOG TO THE MAION PAGE A BLOCKER COMES SAYING ITS NOT SUPPORTED, How can i get rid of that on the http:myip.com:8069
Second time (probably more carefully) following this instructions and OpenERP runs fine (in VM).
Unfortunately I get an error when trying to install modules, “Your version of OpenERP is unsupported. Support & maintenance services are available here”.
I will check this at OpenERP….
I’ve got a configured virtual machine from de Brazilian community and I also got this warning occasionally. I thought this may be related to the problem with the old python-werkzeug package that Alan mentioned in Step 4. So, I substituted by the werkzeug through PIP and it worked ok afterwards.
Ops, I mixed up. This solved my problem that was the same as jk’s, in the up post. The message about not being supported is the same.
No idea, actually?
please excuse me i didn’t see the lam nh answer
Will Try That and come back
Hi, Followed the instructions and had no problems at all getting OpenERP to work perfectly. However, one issue I have run into is a timeout error when I install the first one or two larger modules like “Accounting & Finance”. after a couple of minutes or so an error screen appears with an “XmlHttpRequestError Gateway Time-out” and the html error details whch include “504 Gateway Time-out” and “nginx/o.7.65”. Once I logout and then login, the module has however loaded correctly and all is good. Does anyone have an idea where I should look to increase the timeout – OpenERP or nginX. Many thanks & thanks for the great HowTo!
Hi Alan:
(continued from my last posting on April 02, 2012), today (April 21, 2012), I could finally install and start OpenERP 6.1 on OpenSuse 12.1. Thanks again for your documented steps. I started following your steps starting from Step-2 (Step-1 is not applicable for me because, as I am using OpenSuse 12.1 desktop).
However, I found that:
1. I could only start the OpenERP 6.1 server from /opt/openerp/server/openerp-server, by system user openerp (as described in Step-6)
2. The boot script was completed as described in Step-7, but I was not able to start the server (by issuing sudo /etc/init.d/openerp-server start), I get following error:
openerp@linux-z583:/opt/openerp/server/install> sudo /etc/init.d/openerp-server start root’s password:
Starting openerp-server: /etc/init.d/openerp-server: line 46: start-stop-daemon: command not found
openerp-server.
3. Despite the OpenERP starts (from /opt/openerp/server/openerp-server), I don’t see any logs have been generated under /var/log/openerp (the openerp-server.conf has the entry of logfile = /var/log/openerp/openerp-server.log)
Few questions:
1. Which config file is being read when I start from /opt/openerp/server/openerp-server
2. How to change the port number, which is currently set at 8069
Thanks.
Jamil.
Hi Jamil,
The init.d script was written for Ubuntu/Debian. I am not surprised that it doesn’t work on Suse. You will need to re-write it for Suse.
When you start openerp from the command line, you can pass lots of options to the command. To see what option you can use run the server and add “–help” to the command. For example, to point it at your config file you would add
-c /etc/openerp-server.conf
to your command.Thanks Alan for the reply.
Heeeeelp!!!
Hi im newish to linux servers and everythign else however i got to step 6 without a problem.
Step 7 is my main issue.
“For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user. There is a script you can use in /opt/openerp/server/install/openerp-server.init but this will need a few small modifications to work with the system installed the way I have described above. Here’s a link to the one I’ve already modified for 6.1-1.”
I have basically opened the file saved it out as openerp-server2.init ( as a bkup ) then deleted all the content and replaced with all the script as per the link and saved it out as openerp-server.init
To save time i then did another write out to /etc/init.d/openerp-server ( without init on the end )
When i try to use the following this is what happens
sudo chmod 755 /etc/init.d/openerp-server ( i get another command line like nothing has happened is that normal)
sudo chown root: /etc/init.d/openerp-server ( again i get another command line like nothing has happened )
sudo mkdir /var/log/openerp
mkdir: cannot create directory `/var/log/openerp’: File exists ( because i have done this already i believe )
sudo chown openerp:root /var/log/openerp ( yet again i get another command line like nothing has happened )
ubuntu@ip-10-235-45-95:~$ sudo /etc/init.d/openerp-server start
/etc/init.d/openerp-server: 53: Syntax error: word unexpected ( confused as its found something but not liking it )
The script below is what i have used in both files
“#!/bin/sh
### BEGIN INIT INFO
# Provides: openerp-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Resource Management software
# Description: Open ERP is a complete ERP and CRM software.
### END INIT INFO
PATH=/bin:/sbin:/usr/bin
DAEMON=/opt/openerp/server/openerp-server
NAME=openerp-server
DESC=openerp-server
# Specify the user name (Default: openerp).
USER=openerp
# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE=”/etc/openerp-server.conf”
# pidfile
PIDFILE=/var/run/$NAME.pid
# Additional options that are passed to the Daemon.
DAEMON_OPTS=”-c $CONFIGFILE”
[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
[ -f $PIDFILE ] || return 1
pid=`cat $PIDFILE`
[ -d /proc/$pid ] && return 0
return 1
}
case “${1}” in
start)
echo -n “Starting ${DESC}: ”
start-stop-daemon –start –quiet –pidfile ${PIDFILE} \
–chuid ${USER} –background –make-pidfile \
–exec ${DAEMON} — ${DAEMON_OPTS}
echo “${NAME}.”
;;
stop)
echo -n “Stopping ${DESC}: ”
start-stop-daemon –stop –quiet –pidfile ${PIDFILE} \
–oknodo
echo “${NAME}.”
;;
restart|force-reload)
echo -n “Restarting ${DESC}: ”
start-stop-daemon –stop –quiet –pidfile ${PIDFILE} \
–oknodo
sleep 1
start-stop-daemon –start –quiet –pidfile ${PIDFILE} \
–chuid ${USER} –background –make-pidfile \
–exec ${DAEMON} — ${DAEMON_OPTS}
echo “${NAME}.”
;;
*)
N=/etc/init.d/${NAME}
echo “Usage: ${NAME} {start|stop|restart|force-reload}” >&2
exit 1
;;
esac
exit 0
”
Anyone got an insight as i can use the openerp while at testing stage but as soon as i log out it stops and looses database. (sudo su – openerp -s /bin/bash
/opt/openerp/server/openerp-server)
I would be very grateful for help
Just to add i have now put on webmin to make it eaiser and will remove webmin after i have all the services running correctly
Really do need some help on the startup script
Ok so i managed to sort this out myself and for anyone experincing the same problem this is what i did i used $ sudo nano /opt/openerp/server/install/openerp-server.init ( at this point just make a backup by calling it openerp-server.init ) i then added the full script and wrote it out i then wrote it out again but as /etc/init.d/openerp-server (without .init you must remove this)
Follow the instructions as in step 7
sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server
I then went into webadmin and then went into boot up and shutdown functions and edit the script to start on boot.
You could probably add web admin on the system right at the beginning as it has a shell command built in and you can also edit most of the above in a semi gui environment without it being clunky. i would use ssh though to edit the files as previously suggested using your fav client.
( at this point just make a backup by calling it openerp-server.init ) should be ( at this point just make a backup by calling it openerp-server2.init )
Hi Scott,
Thanks for the comments and follow ups.
You could have just downloaded the file directly by typing:
wget http://www.theopensourcerer.com/wp-content/uploads/2012/02/openerp-server
That would copy the file directly. I just right clicked on the link in the blog post, copied it then pasted it into my terminal using SHFT+CTL+V.
I wouldn’t recommend webmin or any other of the other web based psuedo-GUIs. They introduce many potential security issues and you have no idea what they are really doing behind the scenes.
Dear Alan,
Thanks for the 6.1 update of your installation manual.
According to your instructions I used the “command sudo cp -a openerp-6.1-1 server” on a system that had already 6.0 installed in the directory “server”, this did however not overwrite the contents of “server” but created a directory called “openerp-6.1-1” inside of “server”. Since I didn’t really need 6.0 anymore I just removed “server” after which I got the desired result.
I just wanted to mention this as in may thwart other peoples attempts as well.
Regards,
Chris
Hallo
Iam a newbie to linux and would like you to give us a systematic process on updating Openerp 6.1-1 , this application has many bugs
I’m not sure I really follow you. Updating a business system is not really something that can be easily documented because there are too many unknowns. If you are not sure what to do, I would suggest that you contact a local OpenERP partner for assistance.
We have 6.1 running with some live customers who are very happy with it. If you have specific bugs then you should report them via launchpad or, if you have one, your OpenERP Enterprise contract.
Hi Alan:
After my last posting on April 23, here is an update about OpenERP 6.1 on OpenSUSE 12.1.
1. I could successfully install and configure OpenERP 6.1 on OpenSUSE 12.1 and tested using directly running the daemon as ‘openerp’ (as you mentioned in your step 6)
2. However, I am still struggling to get my daemon script works properly and here is the problem I encounter after start:
jamil@linux-z583:~> sudo /etc/init.d/openerp-server start
Starting openerp-server…
jamil@linux-z583:~> Running as user ‘root’ is a security risk, aborting.
Could you please review where I made any mistake ?
Thanks as always.
Jamil.
Here what I have:
a. /etc/openerp-server.conf file has permission setup ONLY for system user, openerp:
-rw-r—– 1 openerp openerp 1382 Apr 29 23:29 /etc/openerp-server.conf
b. /etc/init.d/openerp-server has permission setup ONLY for root:
-rwxr-xr-x 1 root root 1508 Apr 30 18:37 /etc/init.d/openerp-server
c. /var/log/openerp has permission setup for both openerp and root:
jamil@linux-z583:/var/run/openerp> ls -rtl /var/log/openerp
total 340
-rw-r–r– 1 openerp root 360578 Apr 29 23:30 openerp-server.log
d. /var/run/openerp/openerp.pid has permission setup for ONLY root (this is where the pid is saved after openerp-server start for using by “kill” for stopping:
jamil@linux-z583:/var/run/openerp> ls -rtl /var/run/openerp/
total 4
-rw-r–r– 1 root root 1 Apr 30 18:32 openerp.pid
Here is my daemon script:
####
#!/bin/bash
#
# Start and Stop of OpenERP 6.1
# /etc/init.d/openerp-server
#
# April 28, 2012 Jamil Rahman
#
###—
# Purpose: To start, stop or restart openerp-server 6.1 daemon
# Required-Start: $syslog postgresql
# Short-Description: OpenERP Server 6.1 daemon
# Description: – OpenERP 6.1 is installed under /opt/openerp/server/
# – The daemon is “openerp-server”
# – At start, it reads the configuration file /etc/openerp-server.conf
# – After start, it saves the PID in a file openerp.pid under /var/run/openerp
# – While stopping, it kills the saved PID
###—
#
OPENERP_BIN=”/opt/openerp/server/openerp-server”
OPENERP_CONFIGFILE=”/etc/openerp-server.conf”
PIDFILE=”/var/run/openerp/openerp.pid”
# Check if the directory openerp is already existed under /var/run
# If not, create directory and keep an empty file openerp.pid under openerp folder
if [ ! -d /var/run/openerp ]; then
mkdir /var/run/openerp
echo “” > /var/run/openerp/openerp.pid
fi
case “$1” in
start)
echo -n -e “Starting openerp-server…\n”
python $OPENERP_BIN –config=$OPENERP_CONFIGFILE &
;;
stop)
echo -n -e “Shutting down openerp-server…\n”
PID=`cat $PIDFILE`
kill -9 $PID
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
;;
esac
####
Hi Alan,
I found a solution.
If I add a code in the script for changing the ownership of the file /var/run/openerp/openerp.pid , to openerp and root it works fine.
Just to add following code after openerp.pid file creation:
chmod 640 /var/run/openerp/openerp.pid
chown openerp:root /var/run/openerp/openerp.pid
Hi Jamil, thanks for keeping us informed of your progress.
I have no interest in running OpenERP on Suse myself so I am not able to help you with your startup script, but if you are trying to run OpenERP as root that is a really bad idea…
OpenERP should be running as an unprivileged user. There is a test in the server bootstrap script to check for this. If you are bypassing that check by changing the pid owner that sounds like OpenERP itself is still running as root.
I would guess that there is a tool in Suse to change the owner of a process (
su
) in an init script as there is in Redhat and Debian.Thanks very good tutorial i will try it today.
Hello Alan
This tutorial works fine on Ubuntu Server 12.04 LTS.
Thanks
Great,
Thanks for letting everyone know.
Hello,
I used the tutorial several time on locaholst under Ubuntu 10.04 LTS and Openerp v6.1.
Now I wanted to install it on 12.04 LTS but the server doesn’t start. There is a critical error about module web and attributes SharedDataMiddelware not existing. But it says server is running.
I went over the tutorial again and can’t find out what the issue might be.
Can anyone help me with this. Linux is new for me.
Thanks
Marie-Noelle
Error solved with sudo pip install –upgrade werkzeug.
Thanks for this tutorial !! Great work
Hello,
While I have to say that I did not follow your post (at least because I found it after the new install of 6.1.1 :-)) I would like to ask you a question.
The .deb package installs smoothly (I was kind of suprised, considering past experiences) and everything works out of the box (or almost). However, I see no way to properly add modules. Unless I miss something, there is no import feature anymore. If I just copy-paste some modules into the /usr/share/pyshared, its not enough, as the files need to be symlinked to /usr/lib/pymodules.
During the install, this is done by the postinst ‘update-python-modules -p openerp.public’ where openerp.public is a list of files to be symlinked.
Is there any “clean” way to create such links fo additional modules, or what is the proper way to ad them?
Thank you so much!
B
Wow, that’s interesting!
I hadn’t noticed that the “import module” option has been removed… The only way I know otherwise is you will have to manually copy your module to your addons directory (you could create a new addons directory and add it to the config file) and extract it. Then run the
openerp-server -c /etc/openerp-server.conf -d db_name -u all
option.Thanks for pointing that out.
Alan,
I am having problems with the update command. I use the following form…
/opt/openerp/server/openerp-server -c /etc/openerp-server.conf -d db_name -r db_user -w db_password -u all
… where the db_ entries are substituted with real values, of course.
But no matter which user/passwd I provide, I invariably receive “Ident authentication failed for user …” errors. I tried both the db_user/db_password entries stored in openerp-server.conf as well as “real” OpenERP administrator type user entries, but all fail.
Could you be so kind to explain which user is meant here, the master db user/passwd or an administrator type user from OpenERP?
Thanks,
Ingmar
Sorry, I hadn’t realized that my PostgresSQL server (Zentyal preinstalled) was authenticating local users only by ident. Changed to md5 and all works fine…
Excelent guide! thank you very much 😉
It would be great if you make a similar guide and scripts to work with latest openerp trunks and baazar or git…
Thank for the tutorial, it was very usefull. Still I had a problem with multiple instances of OpenERP.
I haver two instances of OpenERP each one with it’s own linux user (openerp_1 and openerp_2).
Each instance has a daemon (/var/init.d/openerp_1 and /var/init.d/openerp_2) that is lanched at start time. The owner of the daemon script is root, as well as the group.
When lanched at startup, each instance create a folder in “/tmp” for the web sessions (the folders are “/tmp/oe-sessions-openerp_1” and “/tmp/oe-sessions-openerp_2”). The owner of the folder being “openerp_1” and “openerp_2” respectively.
The problem is that when I restart an instance with the command “sudo /etc/init.d/openerp_1 restart” a new folder is created “/tmp/oe-sessions-root” whose user is “openerp_1”.
If I restart the second instance it goes down (the web, not GTK), since it is trying to create again “/tmp/oe-sessions-root” with user “openerp_2”.
I think that any way of setting how the folder is created at /tmp will solve the problem. Have you found something similar??
Make sure that you have separate database users, separate openerp-server.conf config files and that the lines in the respective init scripts are actually requesting that the daemon runs as the right user and uses the correct config file.
In my init scripts I have a line such as:
# Specify the user name (Default: openerp).
USER=openerp61
# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/etc/openerp61-server.conf"
Note also that the PIDFILE variable will need to have a different name for each openerp instance you wish to run.
If you have the config right it will work. We do this frequently.
Dear Alan, yes, everything is configured as you said. Here is a very interesting thread regardign this error: https://answers.launchpad.net/openobject-server/+question/196552
Thanks for the link Damian, that is interesting. I didn’t realise there was much difference between running the init script directly and the service command.
Thanks again.
Hi,
I have follow your steps, and it works perfectly.
Thanks for that article 🙂
Hi,
I followed your tutorial and the server starts just fine, but when I try to access it via http://localhost:8089, http://127.0.0.1:8089 or http://machine_ip:8089 nothing happens, the browser says it can’t connect.
The firewall is disabled and I can connect to the machine via ssh so the network connection is fine.
Can you give me some tip on what should I do?
The openerp log is as follows:
2012-05-09 11:15:59,681 4362 INFO ? openerp: OpenERP version 6.1-1
2012-05-09 11:15:59,681 4362 INFO ? openerp: addons paths: /opt/openerp/server/openerp/addons
2012-05-09 11:15:59,681 4362 INFO ? openerp: database hostname: localhost
2012-05-09 11:15:59,681 4362 INFO ? openerp: database port: 5432
2012-05-09 11:15:59,681 4362 INFO ? openerp: database user: openerp
2012-05-09 11:20:59,217 1338 INFO ? openerp: OpenERP version 6.1-1
2012-05-09 11:20:59,236 1338 INFO ? openerp: addons paths: /opt/openerp/server/openerp/addons
2012-05-09 11:20:59,237 1338 INFO ? openerp: database hostname: localhost
2012-05-09 11:20:59,237 1338 INFO ? openerp: database port: 5432
2012-05-09 11:20:59,237 1338 INFO ? openerp: database user: openerp
2012-05-09 11:20:59,238 1338 INFO ? openerp.service.netrpc_server: starting NET-RPC service on 0.0.0.0:8070
2012-05-09 11:20:59,239 1338 INFO ? openerp.netsvc: Starting 1 services
2012-05-09 11:20:59,429 1338 INFO ? openerp.wsgi.core: HTTP service (werkzeug) running on 0.0.0.0:8069
2012-05-09 11:21:01,291 1338 INFO ? openerp.addons.web: embedded mode
2012-05-09 11:21:04,124 1338 INFO ? openerp: OpenERP server is running, waiting for connections...
netstat -l confirms that the server is listening in port 8089:
ACC ] STREAM LISTENING 8320 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 10504 /tmp/keyring-PNe00u/control
unix 2 [ ACC ] STREAM LISTENING 8328 /var/run/postgresql/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 7322 /var/run/sdp
unix 2 [ ACC ] SEQPACKET LISTENING 6842 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 7372 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 7138 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 8321 /tmp/.X11-unix/X0
Proto: command not found
serveruser@openerp-server:~$ tcp 0 0 localhost:domain *:* LISTEN
No command 'tcp' found, but there are 25 similar ones
tcp: command not found
serveruser@openerp-server:~$ tcp 0 0 *:ssh *:* LISTEN
Just found the error, I was trying to connect to 8089 intead of 8069 (I had that on my browser from a previous install). Sorry to bother, if you can pleas delete my stupid question.
In step 6 when I start server I get sh:bzr not found
NO LSB modules are available
CRITICAL xml-rep
Help Please
Hi Usha,
I have no idea why you would be seeing that error. In my tutorial I do not mention bzr…
Google suggests lots of thing for that error.
I´ve followed your Instructions, for me worked without an issues, but I can not make backup of the Database through the web client, I can creat, Drop Database, but when I try to backup I become Access Denied
Any Sugestions
Hmmm, are you sure you have write access in the location where you are trying to save the backup?
As you can drop and create databases I know of no reason why you shouldn’t be able to backup/copy one.
Thanks, for your Sugestions. You know I´m using the WEB client, through this Interface I don´t know where the backup is going to be saved. I´m comming only to the Part, where I choose the Database to Backup and enter the master password and then I become inmediately the Access denied. I´m sure I´m using the right Password
It is a caused by IE 9, When I use Firefox, works fine
Gosh – If it isn’t already, it would be a good idea to report that as a bug on Launchpad with as much information about how to repeat the problem.
Thanks for letting everyone know. That may help others who have the same problem.
I get the following error
file “/opt/openerp/server/openerp-server line 248 in
openerp.service.start_services()
file “/opt/openerp/server/openerp/service/_init_.py line 65 in start_services
netrpc_server.init_servers()
file “/opt/openerp/server/openerp/service/netrpc_server.py , line 165, in init_servers
int(tools.config.get(netrpc_port,8070)))
file “/opt/opemerp/server/openerp/service/netrpc_server.py line 110, in _init_
self.socket.bind(self._interface,self_port))
file “” , line 1 in bind
soket.error [errno 98] already in use
–help Please
soket.error [errno 98] already in use
Looks like you have another instance of OpenERP running, or another application, already using the same port.
Hi Alan,
Thank you very much for this guide. I have just installed in a fresh Ubuntu 12.04 LTS with Postgresql 9.1 without any issue.
Could you please give me a path to follow for changing the http port from 8069 into 80?
Thank you again,
tjc
You can’t, easily, bind to port 80. On Unix systems ports below 1024 are restricted and are normally only available to root.
Probably the easiest way to do this is to stick apache or nginx or another web server in front of OpenERP and reverse proxy.
Thank you once mor Alan,
I follow your nice how-to related to nginx installation. It works like a charm! I´m using Nginx 1.2.0 the last stable version. You can get it following this (http://wiki.nginx.org/Install):
sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
If you get an error about add-apt-repository not existing, you will want to install python-software-properties.
Thank you again for these nice works.
TJC
Hi Alen
Thanks, You were right, I had tried to install the all-in-one..
I removed and re-isntalled.. It works fine…
Just one more query !!
If I wish to make my server avialbel over internet by giving
public ip what care should I take ?
What is negix ?
– Usha
That is a *big* question.
You need to secure your server first, then secure the connection between OpenERP and the outside world.
I have written a how to using nginx as a reverse proxy which supports ssl (https) into OpenERP.
But securing a server for is not a trivial, nor a one-time, exercise.
Posted a easy step guide to install OpenERP on Ubuntu 12.04
http://myexperimentswithcomputer.blogspot.in/2012/05/installing-openerp-on-ubuntu-1204.html
Succinct.
Hi Alan,
might I ask a *big* question also? 😉
I am still debating whether to adopt OpenERP 6.0.x or 6.1+ for my (small) company. The 6.0 series is LTS and already was/is fairly feature packed while the 6.1+ series is cutting edge and probably receives and will continue to receive more attention from the core OpenERP dev folks.
I am currently not sure if and when I will be able to go for a “Publisher Warranty” plan, so I am leaning towards LTS, but I cannot say what LTS actually means with OpenERP. I see a lot of questions on this on the forum, but the answers are mostly all or nothing, like “be safe go for LTS” or “always go for the latest and thus most stable”. I understand both stanzas, but they don’t help…
For instance, the Outlook plugin for OERP 6.0.x does not work with OL 2010 and the Thunderbird plugin currently does not work with the more recent versions of TB either and there has not been much recent movement on Launchpad on these issues as far as I can see. Now, I am of course not writing to gripe, but from your past experience, would you say that LTS means that the OEP devs will get back to such issues when the OEP 6.1.1+ hustle blows over or does it mainly/only cover bug/security issue fixing ?
If it is the latter, then LTS would mean being left behind as third party technology advances and then LTS would probably not be the best choice and I would rather go for cutting edge and speculate on being able to afford a migration plan sooner or later.
This is an immensely difficult decision to make without knowledge of the true meaning of LTS in this context and I and I am sure many others would value your opinion and voice on this, of course not to be taken as a firm rule, but as guidance based on experience.
Thanks in Advance,
Ingmar
If I was starting from a “clean sheet ” I would choose 6.1 right now. It is, very simply, just better than 6.0 in many ways.
But obviously you have other factors to bear in mind too: http://doc.openerp.com/v6.1/contribute/14_release_cycle.html
Hello,
When upgrading to the next version, to repeat the same copy command:
cp -a openerp.new.version server
will result in an openerp.new.version to be copied into the existing opt/openerp/server/ directory. In order that new files may overwrite the older files and the config paths retained, I should have to do the following after extracting the new openerp.new.version tarball in the /opt/openerp/ directory:
cp -r openerp.new.version/* server
Is is correct?
Many thanks,
aatshi
cp -a
is better.Look at the man page for
cp
to see why.Thanks man for your post.
I am Using the SSL-Proxy via Apache as described in your How-To referred to version 6.0.x
In sites-available/openerp-ssl i changed http://127.0.0.1:8080/ to Port 8069, but when i request https://DOmain i am redirected to https://Domain/web/webclient/home with an “not found” error.
Even when i change the proxy to redirect to :8069/web/webclient/home it won’t find the content.
Do i have the permissions wrong? Because Vmin has an HTTP-User for apache an
I’m sorry for the post before, the solution to use apache Proxy https is to use
ProxyPass / http://127.0.0.1:8069/
Then OpenERP is available via
https://DOMAIN_OR_IP/web/webclient/home
or
https://DOMAIN_OR_IP/web_mobile/static/src/web_mobile.html
Regards
Hi Alan:
I have installed too in Linux Ubuntu 12.04 LTS with Postgresql 9.1 without any issue. All the process to install the application you describe is excellent. Thanks for this great contribution.
In my case it worked fine.
According to some doubts of the community I may clarify with my own words, and as a little contribution, some tips.
Firstly, the step 7, where it says to create the openerp-server file, user must do it from the root, obviously, with the permission as superuser using nano (for instance), otherwise the file cannot be created.
Secondly, the script to insert is the same one of the link “Here’s a link” line above.
Many users find the step 7 as critical and it is, but there can’t be other confusion.
Thanks again.
hi, on ubuntu 10.4 I had sucessfully installed openerp and now
after few days it is giving me error code 501 unsupported get method
ps aux | grep openerp shows service running
the log file says waiting for connection..
when i check ports 8069 and 8070 show python running
even shutdown and start, no help…
STUCK !! Usha
Hi Alan
Now after re-installation, I get yet another error no 127
– Usha
thank you 😉 works fine in 12.04 lts.
i still have a question : what are the good pratices to secure access to an openerp instance ?
Gosh, that’s a question with lots of possible answers depending on what your needs are.
I do show you how to use nginx as a reverse proxy and ssl terminator so only https (encrypted) access to OpenERP is allowed in this how to. But there are many other aspects of securing the server and applications that are way beyond what I can answer here.
executing:
“sudo apt-get install postgresql”
prompt for a password:
“[sudo] password for openerp:”
what is the password? sorry for the question, I am a newbie…
Thanks
Sounds like you are still running as the openerp user. type “exit” first so will drop back to your normal user.
The openerp user does not (and should not) have sudo privileges.
I followed the steps and it works like charm. Good job with this post. Definitely better than original installation manual.
Hi Alan,
I have followed your instructions (twice), everything went fine both times but the script didn’t work, nothing happens when I write “sudo /etc/init.d/openerp-server start”, no errors but the server doesn’t start. I have extract the start command from the script
start-stop-daemon –start –quiet –pidfile /var/run/openerp-server.pid \
–chuid openerp –background –make-pidfile \
–exec /opt/openerp/server/openerp-server — -c /etc/openerp-server.conf
If I use that command, then the server starts fine… I’m using Ubuntu Server 12.04 LTS, I have read that at least one guy use your tutorial with this Ubuntu and he said it worked well, so I don’t know what is wrong with mine. I feel bad about asking you after you have wrote this fabulous tutorial, but I´ve been trying to figure out for three days now what is the problem, also I have read almost all the comments and your replies… I think I could use a little help… do you have an idea what could be the problem?
Regards,
Ernesto
Hi Ernesto,
Can you check the /var/log/openero/openerp-server.log file to see what it says when you try and run the init script? Also make sure you have made the startup script 755 (rwx-r-xr-x) and that it is owned by root.
The only other thing I can think of is to make sure you haven’t edited on a Windows computer before copying it to the server – Windows uses different line ending characters (CR+LF) then unix and this might be another possible cause of a problem.
Also make sure you have followed the instructions exactly. For example, if you have decided to install the openerp-server app in a different directory then the init script will need to be edited to reflect that.
Hi Alan,
I edited your script on a Windows computer… I just downloaded directly form the link and it worked right away, I even put now the SSL. I can’t believe what a hard time this thing gave me.
Thanks!,
Ernesto
Wow,
I’m surprised that idea helped, it was a bit of a “shot-in-the-dark”. Thanks for letting everyone know. It may be helpful to others too.
I’m delighted it is all working for you now. Have fun!