It is currently Tue May 22, 2012 9:51 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: How-to: Basic Installation on Ubuntu 10.04 for beginners
PostPosted: Mon Jul 26, 2010 3:33 pm 
Offline

Joined: Wed Feb 04, 2009 1:07 pm
Posts: 42
Location: Berne, Suisse/Switzerland
Here are some basic installation instructions and a few other basics (quite a lot of text, I know!) which may help real bloody beginners (perhaps at the same time Ubuntu beginners) get OpenERP up and running. So, nothing for advanced users. Some information comes from the manuals, outdated info should be accounted for. Perhaps it would be better to help keep the official manual updated (I've never tried), though probably more time consuming. But better yet, you as expert may first
- comment, ok/nok?
- suggest corrections
- suggest improvements etc.

This worked for me, i. e. new OpenERP 5.0.12 installation on a newly installed Ubuntu 10.04, then migrating the exported database file from a OpenERP 5.0.6 on a Ubuntu 09.04.

Basic OpenERP installation on Ubuntu 10.04 Lucid Lynx for beginners on a single workplace

==> OpenERP server and GTK-client (Web client not covered, only useful for multi-user settings anyway) on a Gnome desktop (KDE should actually work as well).

1. Install PostgreSQL

==> Ubuntu with GUI:
System > Administration > Synaptic Package Manager
Select postgresql and mark for installation, then apply. Other dependent packages may be installed alongside.
==> or command in terminal:
Code:
sudo apt-get install postgresql


2. Change PostgreSQL Configuration File pg_hba.conf

==> command in terminal:
Code:
sudo cp /etc/postgresql/8.4/main/pg_hba.conf /etc/postgresql/8.4/main/pg_hba.conf.bck01
Code:
gksudo gedit /etc/postgresql/8.4/main/pg_hba.conf

The first command will make a backup copy of the original configuration file, then the second command starts the text editor gedit (possibly replace gedit by your favoured text editor; if your desktop is KDE instead of Gnome the command may be: kdesudo kate /etc/postgresql/8.4/main/pg_hba.conf).
Change the following two lines
Code:
# "local" is for Unix domain socket connections only
local   all         all                               ident

to
Code:
# "local" is for Unix domain socket connections only
# local   all         all                               ident
local   all         all                               md5

Save and close the changed text file.

3. Create Database-User "openuser"

==> command in terminal:
Code:
johndoe$ sudo su - postgres
password: password_of_johndoe
postgres$ createuser --createdb --username postgres --no-createrole --pwprompt openuser
Enter password for new role: your_password_of_openuser
Enter it again: your_password_of_openuser
Shall the new role be a superuser? (y/n) n
postgres$

Quit from user postgres:
Code:
postgres$ exit
logout
johndoe$

==> Explanations:
With sudo su - postgres you log in to the *Unix* (Linux/Ubuntu) user postgres which is the "superuser" allowing you to do many things with PostgreSQL. See https://help.ubuntu.com/community/PostgreSQL if you want to set a password for user "postgres" for security reasons.
--createdb : the new user will be able to create new databases
--username postgres : createuser will use the postgres user (superuser)
--no-createrole : the new user will not be able to create new users
--pwprompt : createuser will ask you the new user’s password
openuser : the new user name
If asked "Shall the new role be a superuser? (y/n)" then say no by typing n and then click enter, y is not necessary (possibly even a security risk).
exit : please use exit to logout from user "postgres"

Now restart PostgreSQL:
==> command in terminal:
Code:
sudo /etc/init.d/postgresql-8.4 restart


You may check
https://help.ubuntu.com/community/PostgreSQL
if you want to run PostgreSQL with your Linux user rather than openuser (only on a single user workplace).

4. Install the necessary packages that OpenERP depends on

==> Ubuntu with GUI:
System > Administration > Synaptic Package Manager
Select the packages OpenERP server needs, they are listed here
http://doc.openerp.com/install/linux/server/
under "Example on Ubuntu", and mark for installation, then apply. Other dependent packages may be installed alongside. Note: the python version should usually be 2.6 (not 2.5 or lower).
==> or command in terminal (may be a bit different in other distributions than K/Ubuntu):
Code:
sudo apt-get install python python-psycopg2 python-reportlab python-egenix-mxdatetime python-tz python-pychart python-pydot python-lxml python-vobject

Note: Other dependent packages may be installed alongside (e. g. python-reportlab will install python-imaging).

Now repeat the same with packages OpenERP client needs which are listed here
http://doc.openerp.com/install/linux/client/
Note that as from Ubuntu 10.04 the package "python-xml" is no longer available in the repository and neither is it required for OpenERP to run.
==> or command in terminal (may be a bit different in other distributions than K/Ubuntu):
Code:
sudo apt-get install python-gtk2 python-glade2 python-matplotlib python-hippocanvas

Note: Other dependent packages may be installed alongside.

5. Download and unpack OpenERP Server

Download the server file: http://openerp.com/downloads.html

Unpack the downloaded server file, change into the unpacked directory (cd):
==> command in terminal:
Code:
tar -zxvf openerp-server-5.0.12.tar.gz
cd openerp-server-5.0.12

Test before installing (optional):
==> command in terminal:
Code:
cd bin
python openerp-server.py

Upon this test command you should see a few lines of information starting with the date/time, then INFO, such as
[date/time] INFO:server:version - 5.0.12
etc., plus the last line says
[date/time] INFO:web-services:the server is running, waiting for connections...
Also note that the default database user may be shown as your Unix (Linux/Ubuntu) user and not "openuser" we created above. If so we'll have to remember that further down when starting the server after installation.
If these lines are not shown, you should probably check if you really followed the steps above correctly before continuing.

Now shutdown the OpenERP server testing with Ctrl + c and change directory back to your openerp-server-5.0.12 folder with:
==> command in terminal:
Code:
cd ..


6. Installing the OpenERP Server

Assuming you are still in the directory of the unpacked server file (i. e. openerp-server-5.0.12 if you followed the above), do:
==> command in terminal:
Code:
sudo python setup.py install


7. Download and unpack OpenERP Client

Download the client file: http://openerp.com/downloads.html

Unpack the downloaded client file, change into the unpacked directory (cd):
==> command in terminal:
Code:
tar -zxvf openerp-client-5.0.12.tar.gz
cd openerp-client-5.0.12


Test before installing (optional):
==> command in terminal:
Code:
cd bin
python openerp-client.py

The OpenERP client should start, i. e. the GUI you will normally be working with. If the GUI does not start, you should probably check if you really followed the steps above correctly before continuing. Before installing (see below) you don't want to do much and you are not connected to the database anyway. So quit now and and change directory back to your openerp-client-5.0.12 folder with:
==> command in terminal:
Code:
cd ..


8. Installing the OpenERP Client

Assuming you are still in the directory of the unpacked client file (i. e. openerp-client-5.0.12 if you followed the above), do:
==> command in terminal:
Code:
sudo python setup.py install


9. Start OpenERP

Start the OpenERP server with
==> command in terminal:
Code:
openerp-server --db_user=openuser --db_password=your_password_of_openuser

where --db_password is the password of the PostgreSQL database user "openuser" we created above (which may be a bit confusing).
Then you get several lines with some information similar to
[date/time] INFO:[some info]
such as shown here http://doc.openerp.com/_images/terps_startup_log.png
which will stay permanent.

Open a new terminal tab and enter
==> command in terminal:
Code:
openerp-client


If you get errors like
Quote:
WARNING:common.options:Config file /home/your_user/.openerprc does not exist !
CRITICAL:init:Failed to open file 'openerp-icon.png': No such file or directory
CRITICAL:init:Ensure that the file /home/your_user/.openerprc is correct

don't panic. Disregard "config file ... does not exist", since by now .openerprc will have been generated automatically. Open that file (in /home/johndoe) and change the conflicting lines, for example in case of the above errors change

Code:
[path]
pixmaps = /usr/share/pixmaps/openerp-client
share = /usr/share/openerp-client

to
Code:
[path]
pixmaps = /usr/local/share/pixmaps/openerp-client
share = /usr/local/share/openerp-client

if your paths point to these folders, of course you would first check!, and start the client again. It should now work: The GUI should start and the first form may be the "OpenERP Survey". Click ok, not cancel.

Continue by first creating a new database (File > Databases > New Databases) or by restoring one from a previous installation.
More information about actually running and using OpenERP is quite well explained in the manual http://doc.openerp.com/book/index.html , starting with database creation.
If you are new to OpenERP - obviously - you should really get used to the ERP by setting up a test database and a test company. It's all explained in the manual.

10. Create or Change configuration file openerp-server.conf

Note: openerp-server.conf is normally not (no longer) created with the standard installation script. But if you want to create one, then start your favoured text editor with admin rights, in Ubuntu (Gnome) you may type
Code:
gksudo gedit /etc/openerp-server.conf

in a new terminal tab.
Replace or insert the lines as follows
Code:
db_name =
db_user = openuser
db_password = your_password_of_openuser

Note that if you have a file with only those three lines it will not run, you have to add [options] on top! I. e.:
Code:
[options]
db_name =
db_user = openuser
db_password = your_password_of_openuser

Starting the server with such a configuration file (then of course omit the other options mentioned above):
Code:
openerp-server --config=/etc/openerp-server.conf

That file should have at least read rights for group/other (should be the default when you do it as suggested), else you would have to start the server with sudo.
For security reasons this is IMO better than creating a server configuration file ( http://doc.openerp.com/developer/1_1_In ... ation.html ), although in both cases the file contains the db password in plain text. For multi user settings you will have to think about this and other security issues.

11. Shutdown OpenERP

Client: Quite obvious, in menu "File" select quit or Ctrl + q
Server: Go to your terminal window where you started the server: Ctrl + c. If this doesn't stop the server immediately wait for threads to close or see
http://doc.openerp.com/developer/1_1_In ... erver.html
(replace tiny with openerp, if manual still not updated).

12. Backup Database

If you use the configuration from above when starting openerp-server you may have to enter the openuser database password on the terminal window (!) where you started the server when backing up or restoring a database. Otherwise you may run into a timeout after minutes of waiting in front of your GUI without you knowing why ...

13. Launch OpenERP on System Start (Autostart)

When installing the PostgreSQL database a startup script is automatically added in /etc/init.d/postgresql-8.4. The OpenERP install script doesn't seem to do that. I suspect the reason is that OpenERP server should start after PostgreSQL is up and running. Bear this in mind if you want to create a startup script. But it's probably easiest to add a launcher (Gnome) as you would for other software. Either right-click on a panel and "add to panel" or, similarly, right-click on Applications > Edit Menus. You may do this for the OpenERP server and of course also for the client.

14. Trouble Shooting

When you have errors like "Could not connect to server!" then OpenERP server may want to connect to the database not using "openuser" (or whatever) but rather your current Linux/Ubuntu user. Check if you have really started OpenERP server as indicated above.

See also:
http://doc.openerp.com/book/1/1_1_Inst_ ... stallation
http://sisalp.fr/index.php/post/OpenERP ... au-serveur
etc. [helpful trouble shooting links?]

*****************************************************************
edit 1: 2010-07-26, 17:58: section 3: Separate "Quit from user postgres:", it's not a command ...
edit 2: 2010-07-26, 21:50: added apt-get commands in section 4, thanks to Bounaberdi. A few other minor corrections.


Last edited by wuergler on Mon Jul 26, 2010 10:00 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2010 4:41 pm 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2575
Location: Annecy & Toulon,France
Excellent !

can you confirm you need to pre-create a first database by command ?
do you know why ?
regards

_________________
SISalp's free openerp hosting http://openerp-online.fr/1-openerp-on-l ... atuit.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2010 6:14 pm 
Offline

Joined: Wed Feb 04, 2009 1:07 pm
Posts: 42
Location: Berne, Suisse/Switzerland
@ Bounaberdi
Thanks.
No, in my opinion it is not necessary to create a database before you log in to OpenERP by GUI and create it there ...
That's why in section 3 above I would only create the user "openerp" (or whatever).

Or was the text unclear somewhere else?
Bob


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2010 7:05 pm 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2575
Location: Annecy & Toulon,France
Ok, I agree, this shouldn't be required.
I read the title of 3. a bit too fast.
very precise tutorial
the best documentation I know about this.
Wouldn't be useful to copy the apt-get commands needed instead of pointing to the messed official doc ?
Thank you

_________________
SISalp's free openerp hosting http://openerp-online.fr/1-openerp-on-l ... atuit.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2010 10:14 pm 
Offline

Joined: Wed Feb 04, 2009 1:07 pm
Posts: 42
Location: Berne, Suisse/Switzerland
Bounaberdi, you are right, I added the apt-get commands.

You are (or anybody is) welcome to suggest more inaccuracies, thanks!


Top
 Profile  
 
 Post subject: All-in-one
PostPosted: Tue Jul 27, 2010 2:39 pm 
Offline

Joined: Sun Apr 11, 2010 5:48 pm
Posts: 26
I used this script to install on Ubuntu 10.04

http://openerpappliance.com/2009/09/15/ ... r-dummies/


Top
 Profile  
 
 Post subject: Re: All-in-one
PostPosted: Tue Jul 27, 2010 4:54 pm 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2575
Location: Annecy & Toulon,France
stoltoguzzi wrote:
I used this script to install on Ubuntu 10.04

http://openerpappliance.com/2009/09/15/ ... r-dummies/

Whichever script you use, you have to perfectly understand what is to be done if you want to maintain the solution over time. This is the benefit from this tutorial.
This is true also with xoe script which I publish for a similar purpose.
regards

_________________
SISalp's free openerp hosting http://openerp-online.fr/1-openerp-on-l ... atuit.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2010 6:20 pm 
Offline

Joined: Wed Jan 28, 2009 12:58 pm
Posts: 159
Location: Spain
Hi

To generate the .openerprc that later is renamed to a .conf file you can use the command:

$ ./openerp-server.py -r oerp_user -w oerp_password -s

I will also remark that the installation of openerp-server and openerp-client is optional in development/testing enviroments.

Best regards.

_________________
Carlos Liébana Anero
www.ting.es


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2010 8:13 pm 
Offline

Joined: Wed Feb 16, 2005 12:26 pm
Posts: 2575
Location: Annecy & Toulon,France
You are right
as an exemple, this is command generated for starting http://dev5.sisalp.net
Code:
echo "[options]" >  /home/sisalpuser/openerp/dev5/config_file/server_dev5.conf

echo "admin_passwd = admin" >>  /home/sisalpuser/openerp/dev5/config_file/server_dev5.conf

nohup /home/sisalpuser/openerp/dev5/server/bin/openerp-server.py --config=/home/sisalpuser/openerp/dev5/config_file/server_dev5.conf --save --db_user=pg-dev5 --interface=10.0.0.101 --port=8073 --net_port=8074 --pidfile=/home/sisalpuser/openerp/dev5/pid_file/server_dev5.pid  --log-level=info --email-from=contact.sisalp@gmail.com --smtp=smtp.gmail.com --smtp-port=587 --smtp-user=contact.xxxxx@gmail.com --smtp-password=xxxxxx --smtp-ssl=True  --logfile=/home/sisalpuser/openerp/dev5/log/server_dev5.log &


The only thing you cannot put as parameter is a strong openerp super_admin password which must be there before you start your server so you never have an "admin" password on line. Not in the case above of course ;-)
regards

_________________
SISalp's free openerp hosting http://openerp-online.fr/1-openerp-on-l ... atuit.html


Top
 Profile  
 
 Post subject: Error loading image
PostPosted: Thu Aug 05, 2010 9:46 pm 
Offline

Joined: Thu Aug 05, 2010 8:08 pm
Posts: 5
Hi to everybody!
After making all according to wuergler instructions, I've done all as instructed but on point no.9. Start OpenERP I'm stuck. While testing opening openerp-client I've had the same error as stay in instructions:
Quote:
WARNING:common.options:Config file /home/your_user/.openerprc does not exist !
CRITICAL:init:Failed to open file 'openerp-icon.png': No such file or directory
CRITICAL:init:Ensure that the file /home/my_user/.openerprc is correct
.
Then I've changed code in /home/my_user/.openerprc inserting "local" and started the openerp-client again. Than received two errors:
Quote:
(openerp-client.py:1310): libglade-WARNING **: Error loading image: Failed to open file '/usr/local/share/openerp-client/pixmaps/openerp_logo.png': No such file or directory.

(openerp-client.py:1310): libglade-WARNING **: could not convert string to type `GdkPixbuf' for property `pixbuf'


I've checked .openerprc again but there were corrected paths with "local"
Quote:
pixmaps = /usr/local/share/pixmaps/openerp-client
share = /usr/local/share/openerp-client


After restarting computer there was no change, still same errors. I tried again open client like test in bin folder with"python openerp-client.py" and client was open with logo.
Tried again using "openerp-client" in /home/my_user and again I had, as mentioned above, two warnings.

Could somebody help me? What's wrong?

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 07, 2010 6:32 pm 
Offline

Joined: Wed Feb 04, 2009 1:07 pm
Posts: 42
Location: Berne, Suisse/Switzerland
If I understand you correctly, the client starts when testing (section 7), but you get the error after installation when starting with the command "openerp-client"?

Same thing with
Code:
python /usr/local/lib/python2.6/dist-packages/openerp-client/openerp-client.py
?

Do you have any other configuration files? Like /home/your_user/.openerp_serverrc or /etc/openerp-server.conf

What versions are you using: OpenERP, python, OS?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 11:14 am 
Offline

Joined: Thu Aug 05, 2010 8:08 pm
Posts: 5
First of all, I wish to thank you for your answer.
Yes, I received the same two warnings adding the full path after calling python interpreter and there is no logo on opened OpenERP Survey form.
I don't have any configuration file under /etc/ which belongs to openerp neither to server nor to the client.
Under /home/my_user/ is only one file belonging to OpenERP. That is ".openerprc" where I've inserted "local" in those two paths of "pixmaps" and "share" under [path] according your direction under step no. 9.
Versions of: - openerp 5.0.12 (server, client and web)
- python 2.6
- OS Ubuntu 10.04


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 11:49 am 
Offline

Joined: Thu Aug 05, 2010 8:08 pm
Posts: 5
Problem is solved!
After restarting computer and openerp-server with openuser I don,t have OpenERP Survey form and suddenly everything goes fine without any warning or error.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 8:37 pm 
Offline

Joined: Wed Feb 04, 2009 1:07 pm
Posts: 42
Location: Berne, Suisse/Switzerland
Good that you got it solved!

To me it seemed a bit like .openerprc could not be found, perhaps by mistakenly (re)starting openerp-client with another user than the user the home folder of the correct .openerprc is associated with.

The survey form is normal though upon first launch.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2010 6:13 pm 
Offline

Joined: Wed Jul 07, 2010 12:02 pm
Posts: 23
Location: Landes
Hi there

Good tuto, I can test OpenERP 6 now. But after creating a database, the Modules Management is missing. I can't add any modules! I put the addons in /usr/local/lib/python2.6/dist-packages/openerp-server/addons.

What's wrong?
Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP