The installation of Open ERP¶
Whether you’re from a small company investigating how Open ERP works, or on the IT staff of a larger organization and have been asked to assess Open ERP’s capabilities, your first requirement is to install it or to find a working installation.
The table below summarizes the various installation methods that will be described in the following sections.
|Method||Average Time||Level of Complexity||Notes|
|All-in-one Windows Installer||A few minutes||Simple||Very useful for quick evaluations because it installs all of the components pre-configured on one computer (using the GTK client).|
|Independent installation on Windows||Half an hour||Medium||Enables you to install the components on different computers. Can be put into production use.|
|Ubuntu Linux packages||A few minutes||Simple||Simple and quick but the Ubuntu packages aren’t always up to date.|
|From source, for all Linux systems||More than half an hour||Medium to slightly difficult||This is the method recommended for production environments because it’s easy to keep it up to date.|
Each time a new release of Open ERP is made, Tiny supplies a complete Windows auto-installer for it. This contains all of the components you need – the PostgreSQL database server, the Open ERP application server and the GTK application client.
This auto-installer enables you to install the whole system in just a few mouse-clicks. The initial configuration is set up during installation, making it possible to start using it very quickly as long as you don’t want to change the underlying code. It’s aimed at the installation of everything on a single PC, but you can later connect GTK clients from other PCs, Macs and Linux boxes to it as well.
The first step is to download the Open ERP installer. At this stage you must choose which version to install – the stable version or the development version. If you’re planning to put it straight into production you’re strongly advised to choose the stable version.
Stable versions and development versions
Open ERP development proceeds on two parallel tracks: stable versions and development versions.
New functionality is integrated into the development branch. This branch is more advanced than the stable branch, but it can contain undiscovered and unfixed faults. A new development release is made every month or so, and Tiny have made the code repository available so you can download the very latest revisions if you want.
The stable branch is designed for production environments. Releases of new functionality there are made only about once a year after a long period of testing and validation. Only fault fixes are released through the year on the stable branch.
To download the version of Open ERP for Windows, follow these steps:
- Navigate to the site http://openerp.com.
- Click Downloads on the menu at the left then, under Windows Installers, All in One.
- This brings up the demonstration version Windows installer, currently openerp-allinone-setup-5.0.0-3.
- Save the file on your PC - it’s quite a substantial size because it downloads everything including the PostgreSQL database system, so will take some time.
To install Open ERP and its database you must be signed in as an Administrator on your PC. Double- click the installer file to install it and accept the default parameters on each dialog box as you go.
If you had previously tried to install the all-in-one version of Open ERP, you have to uninstall that first because various elements of a previous installation could interfere with your new installation. Make sure that all Tiny ERP, Open ERP and PostgreSQL applications are removed: you’re likely to have to restart your PC to finish removing all traces of them.
The Open ERP client can be opened, ready to use the Open ERP system, once you have completed the all–in-one installation. The next step consists of setting up the database, and is covered in the final section of this chapter Creating the database.
Independent installation on Windows¶
System administrators can have very good reasons for wanting to install the various components of a Windows installation separately. For example, your company may not support the version of PostgreSQL or Python that’s installed automatically, or you may already have PostgreSQL installed on the server you’re using, or you may want to install the database server, application server and web server on separate hardware units.
For this situation you can get separate installers for the Open ERP server and client from the same location as the all-in-one auto-installer. You’ll also have to download and install a suitable version of PostgreSQL independently.
You must install PostgreSQL before the Open ERP server, and you must also set it up with a user and password so that the Open ERP server can connect to it. Tiny’s web-based documentation gives full and current details.
Connecting users on other PCs to the Open ERP server¶
To connect other computers to the Open ERP server you must set the server up so that it’s visible to the other PCs, and install a GTK client on each of the those PCs:
- Make your Open ERP server visible to other PCs by opening the Windows Firewall in the Control Panel, then asking the firewall to make an exception of the Open ERP server. In the Exceptions tab of Windows Firewall click on Add a program... and choose Open ERP Server in the list provided. This step enables other computers to see the Open ERP application on this server.
- Install the Open ERP client (openerp-client-5.X.exe), which you can download in the same way as you downloaded the other Open ERP software, onto the other PCs.
You must make sure that the version of the client matches that of the server. The version number is given as part of the name of the downloaded file. Although it’s possible that some different revisions of client and server will function together, there’s no certainty about that.
To run the client installer on every other PC you’ll need to have administrator rights there. The installation is automated, so you just need to guide it through its different installation steps.
To test your installation, start by connecting through the Open ERP client on the server machine while you’re still logged in as administrator.
Why sign in as a PC Administrator?
You’d not usually be signed on as a PC administrator when you’re just running the Open ERP client, but if there have been problems in the installation it’s easier to remain as an administrator after the installation so that you can make any necessary fixes than to switch user as you alternate between roles as a tester and a software installer.
Start the GTK client on the server through the Windows Start menu there. The main client window appears, identifying the server you’re connected to (which is localhost – your own server PC – by default). If the message No database found, you must create one appears then you’ve successfully connected to an Open ERP server containing, as yet, no databases.
In its default configuration at the time of writing, the Open ERP client connects to port 8069 on the server using the XML-RPC protocol (from Linux) or port 8070 using the NET-RPC protocol instead (from Windows). You can use either protocol from either operating system. NET-RPC is quite a bit quicker, although you may not notice that on the GTK client in normal use. Open ERP can run XML-RPC, but not NET-RPC, as a secure connection.
Resolving errors with a Windows installation¶
If you can’t get Open ERP to work after installing your Windows system you’ll find some ideas for resolving this below:
- Is the Open ERP Server working? Signed in to the server as an administrator, stop and restart the service using Stop Service and Start Service from the menu Start ‣ Programs ‣ OpenERP Server .
- Is the Open ERP Server set up correctly? Signed in to the server as Administrator, open the file openerp-server.conf in C:\Program Files\OpenERP AllInOne and check its content. This file is generated during installation with information derived from the database. If you see something strange it’s best to entirely reinstall the server from the demonstration installer rather than try to work out what’s happening.
- Is your PostgreSQL running? Signed in as administrator, select Stop Service from the menu Start ‣ Programs ‣ PostgreSQL. If, after a couple of seconds, you can read The PostgreSQL4OpenERP service has stopped then you can be reasonably sure that the database server was working. Restart PostgreSQL.
- Is the database accessible? Still in the PostgreSQL menu, start the pgAdmin III application which you can use to explore the database. Double-click on the PostgreSQL4OpenERP connection. You can find the password in the Open ERP server configuration file. If the database server is accessible you’ll be able to see some information about the empty database. If it’s not then an error message will appear.
- Are your client programs correctly installed? If your Open ERP GTK clients haven’t started then the swiftest approach is to reinstall them.
- Can remote client computers see the server computer at all? Check this by opening a command prompt window (enter cmd in the window Start ‣ Run... ) and enter ping <address of server> there (where <address of server> represents the IP address of the server). The server should respond with a reply.
- Have you changed any of the server’s parameters? At this point in the installation the port number of the server must be 8069 using the protocol XML-RPC.
- Is there anything else in the server’s history that can help you identify the problem? Open the file openerp-server.log in C:\Program Files\OpenERP AllInOne(which you can only do when the server is stopped) and scan through the history for ideas. If something looks strange there, contributors to the Open ERP forums can often help identify the reason.
Installation on Linux (Ubuntu)¶
This section guides you through installing the Open ERP server and client on Ubuntu, one of the most popular Linux distributions. It assumes that you’re using a recent release of Desktop Ubuntu with its graphical user interface on a desktop or laptop PC.
Other Linux distributions
Installation on other distributions of Linux is fairly similar to installation on Ubuntu. Read this section of the book so that you understand the principles, then use the online documentation and the forums for your specific needs on another distribution.
For information about installation on other distributions, visit the documentation section by following Product ‣ Documentation on http://www.openerp.com. Detailed instructions are given there for different distributions and releases, and you should also check if there are more up to date instructions for the Ubuntu distribution as well.
Technical procedure: Initial installation and configuration¶
Upgrade of Ubuntu packages and installation of openerp and pgadmin:
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install openerp-server openerp-client pgadmin3
To avoid having some of the labels untranslated in the GTK client, install the language-pack-gnome-YOURLANG-base package. The following command installs the spanish language pack:
$ sudo apt-get install language-pack-gnome-es-base
Postgres Database configuration:
$ sudo vi /etc/postgresql/8.3/main/pg_hba.conf
Replace the following line:
# “local” is for Unix domain socket connections only local all all ident sameuser
#”local” is for Unix domain socket connections only local all all md5
$ sudo /etc/init.d/postgresql-8.3 restart * Restarting PostgreSQL 8.3 database server [ OK ]
The following two commands will avoid problems with /etc/init.d/openerp-web INIT script:
$ sudo mkdir /home/openerp $ sudo chown openerp.nogroup /home/openerp
Create a user account called openerp with password “openerp” and with privileges to create Postgres databases:
$ sudo su postgres $ createuser openerp -P Enter password for new role: (openerp) Enter it again: Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) y Shall the new role be allowed to create more new roles? (y/n) n
Quit from user postgres:
$ exit exit
Edit OpenERP configuration file:
$ sudo vi /etc/openerp-server.conf
Replace the following two lines (we don’t force to use a specific database and we add the required password to gain access to postgres):
db_name = db_user = openerp db_password = openerp
Troubles with Python releases: Python 2.6 is not yet supported by OpenERP 5.0, but it is the default Python release on Ubuntu 9.0.4. We need to launch OpenERP 5.0 with Python 2.5 or earlier. There’s also a problem with python-xml package in Ubuntu so we will reinstall it.
Python 2.5 setting up:
$ sudo apt-get install python2.5 python2.5-dev python-profiler
$ wget http://freefr.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.4.tar.gz $ tar xvzf PyXML-0.8.4.tar.gz $ cd PyXML-0.8.4/ $ sudo python2.5 setup.py install
Make the following symbolic link:
$ sudo ln -s /usr/lib/python2.6/dist-packages/oldxml/_xmlplus/utils/boolean.so /usr/lib/python2.5/site-packages/oldxml/_xmlplus/utils/
Force openerp-server to be launched with Python2.5:
$ cd /usr/bin/ $ sudo cp openerp-server openerp-server.ORIG $ sudo vi openerp-server
Replace the following line:
exec /usr/bin/python ./openerp-server.py $@
exec /usr/bin/python2.5 ./openerp-server.py $@
We can now restart openerp-server:
$ sudo /etc/init.d/openerp-server restart Restarting openerp-server: openerp-server.
Check out the logs:
$ sudo cat /var/log/openerp.log [2009-06-14 21:06:39,314] INFO:server:version – 5.0.0 [2009-06-14 21:06:39,314] INFO:server:addons_path – /usr/lib/openerp-server/addons [2009-06-14 21:06:39,314] INFO:server:database hostname – localhost [2009-06-14 21:06:39,315] INFO:server:database port – 5432 [2009-06-14 21:06:39,315] INFO:server:database user – openerp [2009-06-14 21:06:39,315] INFO:objects:initialising distributed objects services [2009-06-14 21:06:39,502] INFO:web-services:starting XML-RPC services, port 8069 [2009-06-14 21:06:39,502] INFO:web-services:starting NET-RPC service, port 8070 [2009-06-14 21:06:39,502] INFO:web-services:the server is running, waiting for connections…
OpenERP is now up and running, connected to Postgres database on port 5432 and listening on ports 8069 and 8070
$ ps uaxww | grep -i openerp root 2276 0.0 2.3 185576 23708 ? Sl 13:09 0:00 /usr/bin/python2.5 ./openerp-server.py –config=/etc/openerp-server.conf
$ sudo lsof -i :8069 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME python2.5 2276 openerp 3u IPv4 6515 TCP localhost:8069 (LISTEN)
$ sudo lsof -i :8070 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME python2.5 2276 openerp 5u IPv4 6520 TCP *:8070 (LISTEN)
Start the Open ERP GTK client by clicking its icon in the Applications menu, or by opening a terminal window and typing tinyerp-client . The Open ERP login dialog box should open and show the message No database found you must create one!.
Although this installation method is simple and therefore an attractive option, it’s better to install Open ERP using a version downloaded from http://openerp.com. The downloaded revision is likely to be far more up to date than that available from a Linux distribution.
Maintaining packages is a process of development, testing and publication that takes time. The releases in Open ERP (or Tiny ERP) packages are therefore not always the latest available. Check the version number from the information on the website before installing a package. If only the third digit group differs (for example 5.0.1 instead of 5.0.2) then you may decide to install it because the differences may be minor – fault fixes rather than functionality changes between the package and the latest version.
Manual installation of the Open ERP server¶
In this section you’ll see how to install Open ERP by downloading it from the site http://openerp.com, and how to install the libraries and packages that Open ERP depends on, onto a desktop version of Ubuntu. Here’s a summary of the procedure:
- Navigate to the page http://openerp.com with your web browser,
- Click Downloads on the left menu,
- Download the client and server files from the Sources (Linux) section into your home directory (or some other location if you’ve defined a different download area).
To download the PostgreSQL database and all of the other dependencies for Open ERP from packages:
- Start Synaptic Package Manager, and enter the root password as required.
- Check that the repositories main universe and restricted are enabled.
- Search for a recent version of PostgreSQL (such as postgresql-8.3 then select it for installation along with its dependencies.
- Select all of Open ERP’s dependences, an up-to-date list of which should be found in the installation documents on Tiny’s website, then click Update Now to install them.
Python programming language
Python is the programming language that’s been used to develop Open ERP. It’s a dynamic, non-typed language that is object-oriented, procedural and functional. It comes with numerous libraries that provide interfaces to other languages and has the great advantage that it can be learnt in only a few days. It’s the language of choice for large parts of NASA’s, Google’s and many other enterprises’ code.
For more information on Python, explore http://www.python.org.
Once all these dependencies and the database are installed, install the server itself using the instructions on the website.
Open a terminal window to start the server with the command sudo -i -u postgres openerp-server , which should result in a series of log messages as the server starts up. If the server is correctly installed, the message [...] waiting for connections... should show within 30 seconds or so, which indicates that the server is waiting for a client to connect to it.
Manual installation of Open ERP GTK clients¶
To install an Open ERP GTK client, follow the steps outline on the website installation document for your particular operating system.
Survey: Don’t Cancel!
When you start the GTK client for the first time, a dialog box appears asking for various details that are intended to help the Tiny company assess the prospective user base for its software.
If you click the Cancel button, the window goes away – but Open ERP will ask the same questions again next time you start the client. It’s best to click OK, even if you choose to enter no data, to prevent that window reappearing next time.
Open a terminal window to start the client using the command openerp-client. When you start the client on the same Linux PC as the server you’ll find that the default connection parameters will just work without needing any change. The message No database found, you must create one! shows you that the connection to the server has been successful and you need to create a database on the server.
Creating the database¶
You can connect other GTK clients over the network to your Linux server. Before you leave your server, make sure you know its network address – either by its name (such as mycomputer.mycompany.net ) or its IP address (such as 192.168.0.123 ).
Communications between an Open ERP client and server are based on standard protocols. You can connect Windows clients to a Linux server, or vice versa, without problems. It’s the same for Mac versions of Open ERP – you can connect Windows and Linux clients and servers to them.
To install an Open ERP client on a computer under Linux, repeat the procedure shown earlier in this section. You can connect different clients to the Open ERP server by modifying the connection parameters on each client. To do that, click the Change button on the connection dialog and set the following field as needed:
- Server : name or IP address of the server over the network,
- Port : the port, whose default is 8069 or 8070,
- Connection protocol : XML-RPC or NET-RPC .
It’s possible to connect the server to the client using a secure protocol to prevent other network users from listening in, but the installation described here is for direct unencrypted connection.
- If your Linux server is protected by a firewall you’ll have to provide access to port
- 8069or 8070for users on other computers with Open ERP GTK clients.
Installation of an Open ERP web server¶
Just as you installed a GTK client on a Linux server, you can also install the Open ERP client-web server. You can install it from sources after installing its dependencies from packages as you did with the Open ERP server, but Tiny have provided a simpler way to do this for eTiny – using a system known as ez_setup.
Before proceeding, confirm that your Open ERP installation is functioning correctly with a GTK client. If it’s not you’ll need to go back now and fix it, because you need to be able to use it fully for the next stages.
To install client-web follow the up-to-date instructions in the installation document on the website.
Ez is the packaging system used by Python. It enables the installation of programs as required just like the packages used by a Linux distribution. The software is downloaded across the network and installed on your computer by ez_install.
ez_setup is a small program that installs ez_install automatically.
The Open ERP Web server connects to the Open ERP server in the same way as an Open ERP client using the NET-RPC protocol. Its default setup corresponds to that of the Open ERP server you’ve just installed, so should connect directly at startup.
- At the same console as you’ve just been using, go to the Openerp web directory by typing cd openerp-web-5.X.
- At a terminal window type start-openerp-web to start the Open ERP Web server.
You can verify the installation by opening a web browser on the server and navigating to http://localhost:8080 to connect to eTiny as shown in the figure Open ERP web client at startup. You can also test this from another computer connected to the same network if you know the name or IP address of the server over the network – your browser should be set to http://<server_address>:8080 for this.
Verifying your Linux installation¶
You’ve used default parameters so far during the installation of the various components. If you’ve had problems, or you just want to set this up differently, the following points provide some indicators about how you can set your installation up.
psql and pgAdmin tools
psql is a simple client, executed from the command line, that’s delivered with PostgreSQL. It enables you to execute SQL commands on your Open ERP database.
If you prefer a graphical utility to manipulate your database directly you can install pgAdmin III (it is commonly installed automatically with PostgreSQL on a windowing system, but can also be found at http://www.pgadmin.org/ ).
The PostgreSQL database starts automatically and listens locally on port 5432 as standard: check this by entering sudo netstat -anpt at a terminal to see if port 5432 is visible there.
The database system has a default role of postgres accessible by running under the Linux postgres user: check this by entering sudo su postgres -c psql at a terminal to see the psql startup message – then type \q to quit the program.
Start the Open ERP server from the postgres user (which enables it to access the PostgreSQL database) by typing sudo su postgres -c tinyerp-server.
If you try to start the Open ERP server from a terminal but get the message socket.error: (98, 'Address already in use') then you might be trying to start Open ERP while an instance of Open ERP is already running and using the sockets that you’ve defined (by default 8069 and 8070). If that’s a surprise to you then you may be coming up against a previous installation of Open ERP or Tiny ERP, or something else using one or both of those ports.
Type sudo netstat -anpt to discover what is running there, and record the PID. You can check that the PID orresponds to a program you can dispense with by typing ps aux | grep <PID> and you can then stop the program from running by typing sudo kill <PID>. You need additional measures to stop it from restarting when you restart the server.
The Open ERP server has a large number of configuration options. You can see what they are by starting the server with the argument –help By efault the server configuration is stored in the file .terp_serverrc in the user’s home directory (and for the postgres user that directory is /var/lib/postgresql .
You can delete the configuration file to be quite sure that the Open ERP server is starting with just the default options. It is quite common for an upgraded system to behave badly because a new version server cannot work with options from a previous version. When the server starts without a configuration file it will write a new one once there is something non-default to write to it – it will operate using defaults until then.
To verify that the system works, without becoming entangled in firewall problems, you can start the Open ERP client from a second terminal window on the server computer (which doesn’t pass through the firewall). Connect using the XML-RPC protocol on port 8069 or NET-RPC on port 8070. The server can use both ports simultaneously. The window displays the log file when the client is started this way.
The client setup is stored in the file .terprc in the user’s home directory. Since a GTK client can be started by any user, each user would have their setup defined in a configuration file in their own home directory.
You can delete the configuration file to be quite sure that the Open ERP client is starting with just the default options. When the client starts without a configuration file it will write a new one for itself.
The web server uses the NET-RPC protocol. If a GTK client works but the web server doesn’t then the problem is either with the NET-RPC port or with the web server itself, and not with the Open ERP server.
One server for several companies
You can start several Open ERP application servers on one physical computer server by using different ports. If you have defined multiple database roles in PostgreSQL, each connected through an Open ERP instance to a different port, you can simultaneously serve many companies from one physical server at one time.