
The Way Out
A Business focussed Blog on Open Source
| How to install OpenERP 6 on Ubuntu 10.04 LTS Server |
| Written by Alan Lord |
| Tuesday, 19 April 2011 14:06 |
|
Installing OpenERP isn't really that hard, but having seen several other "How Tos" on-line describing various methods where none seemed to do the whole thing in what I consider to be "the right way", I thought I'd explain how we do it. There are a few forum posts that I've come across where the advice is just plain wrong too, so do be careful. As we tend to host OpenERP on servers that are connected to the big wide Internet, our objective is to end up with a system that is:
One of my friends said to me recently, "surely it's just
So although the way I'm installing OpenERP below is manual, it gives us a much more fine-grained level of control. Without further ado then here is my way as it stands currently ("currently" because you can almost always improve things. HINT: suggestions for improvement gratefully accepted). Step 1. Build your serverI 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...]
Now make sure you are running all the latest patches by doing an update:
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 still 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
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 (well it's actually Step 3. Install and configure the database server, PostgreSQL
Then configure the OpenERP user on postgres: First change to the postgres user so we have the necessary privileges to configure the database.
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:
Finally exit from the postgres user account:
Step 4. Install the necessary Python libraries for the server
And if you plan to use the Web client install the following:
Step 5. Install the OpenERP server, and optional web client, codeI 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 files. At the time of writing this it was 6.0.2; I got the download links from their download page.
And if you want the web client:
Now install the code where we need it: cd to the
Next we need to change the ownership of all the the files to the openerp user and group.
And finally, the way I have done this is to copy the server and web client directories to something with a simpler name so that the configuration files and boot scripts don't need constant editing (I call them, rather unimaginatively,
As an example, should OpenERP 6.0.3 come out next, I can extract the tarballs into That's the OpenERP server and web client software installed. The last steps to a working system are to set up the two (server and web client) configuration files and associated Step 6. Configuring the OpenERP applicationThe default configuration file for the server (in
The above commands make the file owned and writeable only by the openerp user 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 Once the config file is edited, you can start the server if you like just to check if it actually runs.
It won't really work just yet as it isn't running as the openerp user. It's running as your normal user so it won't be able to talk to the PostgreSQL database. Just type Step 7. Installing the boot scriptFor 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. Here's a link to the one I'm using currently. Similar to the config file, you need to either copy it or paste the contents of this script to a file in
In the config 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:
Step 8. Testing the serverTo start the OpenERP server type:
You should now be able to view the logfile and see that the server has started.
If there are any problems starting the server now you need to go back and check. There's really no point ploughing on if the server doesn't start...
If you now start up the GTK client and point it at your new server you should see a message like this: Which is a good thing. It means the server is accepting connections and you do not have a database configured yet. I will leave configuring and setting up OpenERP as an exercise for the reader. This is a how to for installing the server. Not a how to on using and configuring OpenERP itself... What I do recommend you do at this point is to change the super admin password to something nice and strong. By default it is "admin" and with that a user can create, backup, restore and drop databases (in the GTK client, go to the file menu and choose the Databases -> Administrator Password option to change it). This password is written as plain text into the /etc/openerp-server.conf file. Hence why we restricted access to just openerp and root. One rather strange thing I've just realised is that when you change the super admin password and save it, OpenERP completely re-writes the config file. It removes all comments and scatters the configuration entries randomly throughout the file. I'm not sure as of now if this is by design or not. Now it's time to make sure the server stops properly too:
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 shutdownIf 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:
You can now try rebooting you server if you like. OpenERP should be running by the time you log back in. If you type
Which shows that the server is running. And of course you can check the logfile or use the GTK client too. Step 10. Configure and automate the Web ClientAlthough it's called the web client, it's really another server-type application which [ahem] serves OpenERP to users via a web browser instead of the GTK desktop client. If you want to use the web client too, it's basically just a repeat of steps 6, 7, 8 and 9. The default configuration file for the web client (can also be found in /opt/openerp/web/doc/openerp-web.cfg) is laid out more nicely than the server one and should work as is when both the server and web client are installed on the same machine as we are doing here. I have changed one line to turn on error logging and point the file at our
Here is a web client boot script. This needs to go into
You should now be able to start the web server by entering the following command:
Check the web client is running by looking in the log file, looking at the process log and, of course, connecting to your OpenERP server with a web browser. The web client by default runs on port 8080 so the URL to use is something like this: Make sure the web client stops properly:
And then configure it to start and stop automatically.
You should now be able to reboot your server and have the OpenERP server and web client start and stop automatically. I think that will do for this post. It's long enough as it is! I'll do a part 2 in a little while where I'll cover using apache, ssl and mod_proxy to provide encrypted access to all services. |
Recent Articles
- How to install OpenERP 6 on Ubuntu 10.04 LTS Server (Part 2 – SSL)
- How to install OpenERP 6 on Ubuntu 10.04 LTS Server
- vtiger CRM 5.2.0
- Announcing vtiger CRM On Demand
- Does Microsoft think "Rip-Off Britain" is an instruction?
- Open Source, Open Standards and Re-Use: Government Action Plan
- BETT 2010 Review





