This question has been flagged
1 Reply
6165 Views

Hello,

If I want to run openerp for two different customer... company1 and company2 on the same server.. do I have to install openerp twice or do I have to install openerp just one time and create 2 different database?

I would like two different url company1 on company1.com and company2 on company2.com

Is this possible?? or the companies url have to be server.com:8069?

Thank you for your reply

Frank

Avatar
Discard
Best Answer

You can create two separate databases with the same installation.

They can then either choose the database (eg company1) from the drop down list or you can give them the URL that just goes straight to their database .. eg http://openerp.server.com:8069/?db=company1

With the above options people can see what other companies you also be looking after (from the dropdown list).

To get their individual companies pointing to their own url eg openerp.company1.com (of course preferably using https!) by getting their dns entries pointing to your server and using an apache proxy to do some redirects/rewrites to point it at the correct url. The 8069 port hides behind the http proxy.

I haven't tried to do the above http proxy bit, but I use the same process to redirect http://openerp to https://openerp.ourcompany.com [EDIT: err no just the http to https]

Here are the docs I use to do get things working with https ...

The web client doesn't do https so the webclient needs to be configured to listen only to the local host, and we'll use an apache https proxy. The original kick start I used was .. http://doc.openerp.com/v5.0/install/linux/web/index.html#configure-https

Install apache and enable the appropriate modules.

 apt-get install apache2
 a2enmod ssl proxy_http headers rewrite

For certificates you can use the local certificates. Most browsers will probably complain about them, but until you get real certificates ..

 apt-get install ssl-cert
 make-ssl-cert generate-default-snakeoil --force-overwrite

The example site config ..

#####
# /etc/apache2/sites-available/openerp-ssl
<VirtualHost *:443>

SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyVia On

ProxyPass / http://127.0.0.1:8069/
<location / >
ProxyPassReverse /
</location>

RequestHeader set "X-Forwarded-Proto" "https"

# Fix IE problem (httpapache proxy dav error 408/409)
SetEnv proxy-nokeepalive 1

</VirtualHost>
#####

Enable the SSL site with ..

 a2ensite openerp-ssl

We can either disable the port 80 of this site or rewrite to go :443 .. I go with the redirect.

# /etc/apache2/sites-available/default
#..
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
#..

And then restart Apache

 /etc/init.d/apache2 restart
Avatar
Discard
Author

Nice Ian, this is excatly what I am looking for.. could you give me link to 1- use the apache proxy and how to configure it? and 2- how to configure or set up the hhtps please. Frank

Updated my answer with how to configure the https and the redirection from port 80 to port 443 (http -> https). Sorry, haven't actually redirected from one url to another domain and thinking about it further it'll probably cause some problems with certificates.

Author

Hi Ian, I use CentOS. The main question is to know if it is possible to give for each companies a different URL and not a subdomain URL. I'd like to know if it is possible to have http://company1.com for one database and http://company2.com for a second database. Thank you