~openerp-vietnam/openobject-doc/technical-tutorial

« back to all changes in this revision

Viewing changes to source/install/linux/web/index.rst

  • Committer: Najlaâ EL KHAYAT
  • Date: 2009-04-07 12:47:35 UTC
  • Revision ID: nel@tinyerp.com-20090407124735-fvnl6acj42fhff34
doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. index::
 
3
   single: Installation; Open ERP Web (Linux)
 
4
   single: Open ERP Web; Installation (Linux)
 
5
.. 
 
6
 
 
7
.. _installation-linux-web-link:
 
8
 
 
9
===============================================================================
 
10
OpenERP Web Installation
 
11
===============================================================================
 
12
 
 
13
Here is the installation instructions for Debian based Linux distributions.
 
14
Tested on Debian Etch and Ubuntu Hardy. The procedure might work with other 
 
15
Linux or similar distributions. See the docs on how to install the specified 
 
16
Packages on your favourite distribution.
 
17
 
 
18
-------------------------------------------------------------------------------
 
19
Prerequisites
 
20
-------------------------------------------------------------------------------
 
21
 
 
22
#. Python >= 2.4
 
23
#. TurboGears >= 1.0.7, < 1.1b1
 
24
 
 
25
-------------------------------------------------------------------------------
 
26
TurboGears
 
27
-------------------------------------------------------------------------------
 
28
 
 
29
.. code-block:: bash
 
30
 
 
31
    $ sudo apt-get install python-setuptools
 
32
    $ sudo easy_install TurboGears==1.0.8
 
33
    
 
34
or
 
35
 
 
36
.. code-block:: bash
 
37
 
 
38
    $ wget http://peak.telecommunity.com/dist/ez_setup.py
 
39
    $ sudo python ez_setup.py
 
40
    $ sudo easy_install TurboGears==1.0.8
 
41
 
 
42
Check whether TurboGears is properly installed or not...
 
43
 
 
44
.. code-block:: bash
 
45
 
 
46
    $ tg-admin info
 
47
 
 
48
You should see version information of TurboGears and related packages.
 
49
 
 
50
-------------------------------------------------------------------------------
 
51
OpenERP Web
 
52
-------------------------------------------------------------------------------
 
53
 
 
54
.. code-block:: bash
 
55
 
 
56
    $ sudo easy_install -U openerp-web
 
57
 
 
58
-------------------------------------------------------------------------------
 
59
Configuration
 
60
-------------------------------------------------------------------------------
 
61
 
 
62
Locate the *config/default.cfg* in the installed *EGG*, and make appropriate 
 
63
changes, especially:
 
64
 
 
65
.. code-block:: ini
 
66
 
 
67
    [openerp]
 
68
    server = "localhost"
 
69
    port = 8070
 
70
    protocol = "socket"
 
71
 
 
72
where:
 
73
 
 
74
    | ``server`` is the OpenERP server host...
 
75
    | ``port`` is the OpenERP server port...
 
76
    | ``protocol`` is the protocol to be used (socket, http or https)
 
77
 
 
78
Now start the web server with ``start-openerp-web`` command:
 
79
 
 
80
.. code-block:: bash
 
81
 
 
82
    $ start-openerp-web
 
83
 
 
84
If you see message showing ``cherrypy._cperror.NotReady: Port not free.`` then 
 
85
make sure no other application is running on the specified port (8080 is default).
 
86
 
 
87
You can change port for by changing ``server.socket_port`` value in *config/default.cfg*.
 
88
 
 
89
If everything is fine, open your favourite web browser and type http://localhost:8080, 
 
90
and your can see welcome page with login screen.
 
91
 
 
92
Please make sure cookies are enabled in your browser.
 
93
 
 
94
Of course, OpenERP Server must be running at that time. You should create a 
 
95
database from the DBAdmin interface by clicking on Manage button that you can 
 
96
see besides the Database selection box. After creating a new database login 
 
97
with the admin/admin or demo/demo to see OpenERP in action...
 
98
 
 
99
.. warning::
 
100
 
 
101
    Please make sure that the system time is properly set otherwise web browsers
 
102
    might fail to establish sessions. We strongly recommend you to synchronize
 
103
    system clock with NTP...
 
104
 
 
105
-------------------------------------------------------------------------------
 
106
Run as service (daemon)
 
107
-------------------------------------------------------------------------------
 
108
 
 
109
This has been tested on *ubuntu* only.
 
110
 
 
111
.. code-block:: bash
 
112
 
 
113
    $ sudo cp /path/to/openerp_web-5.0-py2.5.egg/scripts/openerp-web /etc/init.d
 
114
    $ sudo cp /path/to/openerp_web-5.0-py2.5.egg/config/default.cfg /etc/openerp-web.cfg
 
115
    $ sudo chmod +x /etc/init.d/openerp-web
 
116
 
 
117
edit */etc/init.d/openerp-web*:
 
118
 
 
119
.. code-block:: ini
 
120
 
 
121
    USER="terp"
 
122
 
 
123
and */etc/openerp-web.cfg*:
 
124
 
 
125
.. code-block:: ini
 
126
 
 
127
    args="('server.log',)" ==> args="('/var/log/openerp-web.log',)"
 
128
 
 
129
Create ``/var/log/openerp-web.log`` with proper ownership
 
130
 
 
131
.. code-block:: bash
 
132
 
 
133
    $ sudo touch /var/log/openerp-web.log
 
134
    $ sudo chown terp /var/log/openerp-web.log
 
135
 
 
136
Now run following command to start the OpenERP Web automatically on system 
 
137
startup (Debian/Ubuntu).
 
138
 
 
139
.. code-block:: bash
 
140
 
 
141
    $ sudo update-rc.d openerp-web defaults
 
142
 
 
143
Start the deamon:
 
144
 
 
145
.. code-block:: bash
 
146
 
 
147
    $ sudo /etc/init.d/openerp-web start
 
148
 
 
149
.. note::
 
150
 
 
151
     The init script is compatible with all major Linux distributions. Please 
 
152
     check docs of your distribution on how to enable services.
 
153
 
 
154
-------------------------------------------------------------------------------
 
155
Configure HTTPS
 
156
-------------------------------------------------------------------------------
 
157
 
 
158
The following text describes how to configure OpenERP Web for production 
 
159
environment over HTTPS with Apache2.
 
160
 
 
161
**mod_proxy + mod_ssl (Apache2)**
 
162
 
 
163
See `Apache manual <http://httpd.apache.org/docs/>`_ for more information. 
 
164
 
 
165
**Apache configuration**
 
166
 
 
167
.. code-block:: apache
 
168
 
 
169
    <VirtualHost *:443>
 
170
 
 
171
        SSLEngine on
 
172
        SSLCertificateFile /etc/apache2/ssl/apache.pem
 
173
 
 
174
        <Proxy *>
 
175
            Order deny,allow
 
176
            Allow from all
 
177
        </Proxy>
 
178
 
 
179
        ProxyRequests Off
 
180
 
 
181
        ProxyPass        /   http://127.0.0.1:8080/
 
182
        ProxyPassReverse /   http://127.0.0.1:8080/
 
183
 
 
184
    </VirtualHost>
 
185
 
 
186
**OpenERP Web configuration**
 
187
 
 
188
.. code-block:: ini
 
189
 
 
190
    base_url_filter.on = True
 
191
    base_url_filter.use_x_forwarded_host = False
 
192
    base_url_filter.base_url = "https://www.example.com"
 
193
 
 
194
**Block the OpenERP Web server port (firewall)**
 
195
 
 
196
.. code-block:: bash
 
197
 
 
198
    $ iptables -A INPUT -i lo -j ACCEPT
 
199
    $ iptables -A INPUT -p tcp --dport 8080 -j REJECT
 
200
 
 
201
.. note:: 
 
202
    
 
203
    Don't block the localhost/121.0.0.1 (the first rule)
 
204
 
 
205
.. note::
 
206
 
 
207
    This method only works if you want your OpenERP Web application at the 
 
208
    root of your server (https://www.example.com) and can't be deployed under 
 
209
    a subdirectory, e.g. http://www.example.com/openerp.
 
210
 
 
211
    To overcome with the issue you can go with `subdomain`, like:
 
212
 
 
213
        https://openerp.example.com
 
214
 
 
215
-------------------------------------------------------------------------------
 
216
Web Browser Compatibilities
 
217
-------------------------------------------------------------------------------
 
218
 
 
219
Supported browsers
 
220
++++++++++++++++++
 
221
 
 
222
*OpenERP Web* is known to work best with *Mozilla* based web browsers. Here is 
 
223
the list of supported browsers.
 
224
 
 
225
#. Firefox >= 1.5
 
226
#. Internet Explorer >= 6.0
 
227
#. Safari >= 3.0
 
228
#. Google Chrome >= 1.0
 
229
#. Opera >= 9.0
 
230
 
 
231
Flash plugin
 
232
++++++++++++
 
233
 
 
234
Your browser should have the Flash plugin installed because *OpenERP Web* uses
 
235
some Flash components.
 
236
 
 
237
Here is how to install the Flash plugin on an Ubuntu system:
 
238
 
 
239
.. code-block:: bash
 
240
 
 
241
    $ sudo apt-get install flashplugin-nonfree
 
242
 
 
243
-------------------------------------------------------------------------------
 
244
Support
 
245
-------------------------------------------------------------------------------
 
246
 
 
247
#. http://openerp.com
 
248
#. http://axelor.com
 
249