This question has been flagged
1 Reply
5017 Views

Hi,

I am trying to setup a machine on which I want to host several OpenERP instances.

So I've made 2 servers configuration file for two OpenERP instances running on different ports.

Also I've created two Apache VHost, with proxy_pass in order to redirect :

- `openerp1.domain.com` to `openerp1.domain.com:port1`

- `openerp2.domain.com` to `openerp2.domain.com:port2`

 

But I still can't manage redirections based on subdomain value (openerp1 or openerp2)

When I access openerp2.domain.com, I get content from openerp1.domain.com

 

Here are is one of the vhost file:

 

<VirtualHost test.domain.net:80>
    ServerAdmin technique@domain.fr
    ServerName test.domain.net

    DocumentRoot /var/www
    LogLevel warn
    ErrorLog /var/log/apache2/cap_oe_template.error.log
    CustomLog /var/log/apache2/cap_oe_template.access.log combined

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

    ProxyPass / http://127.0.0.1:9069/
    ProxyPassReverse / http://127.0.0.1:9069/

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    # Fix IE problem (http error 408/409)                                                                                                                                                                           
    SetEnv proxy-nokeepalive 1
</VirtualHost>

 

the other vhost file is similar, the only changes are in :

`VirtualHost test2.domain.net`

`ServerName test2.domain.net`

`ProxyPass / http://127.0.0.1:8069/`
`ProxyPassReverse / http://127.0.0.1:8069/`

 

Have you ever try to host multiple OpenERP instances with redirection of the subdomain on the appropriate port on the same machine  ?

Do you see anything wrong in what I did ?

 

Thanks for your help

Cheers

Avatar
Discard
Author Best Answer

I was missing the directive NameVirtualHost in my Apache configuration so the alphabetically first vhost file was overlapping the next one.

I added in the file /etc/apache2/httpd.conf

NameVirtualHost my.machin.ip:80

NameVirtualHost my.machin.ip:443

Avatar
Discard