Community mailing list archives

community@mail.odoo.com

Re: Muliple Odoo Website on single port

by
redCOR AG, robert rottermann
- 05/18/2016 07:36:24
I wonder whether  rewrite rule or reverse proxy will make a difference.
Here is an other example ..
# redcorkmu
# -------------------
#_robert_
<VirtualHost *:80>
    DocumentRoot /var/www/
    ServerAdmin robert@redcor.net
    ServerName  www.redcorkmu.ch
    ServerAlias redcorkmu.redcor.ch
    ServerAlias redcorkmu.ch
    CustomLog   /var/log/apache2/redcorkmu-access.log combined
    ErrorLog    /var/log/apache2/redcorkmu-error.log
    LogLevel warn

    # don't loose time with IP address lookups
    HostnameLookups Off

    # needed for named virtual hosts
    UseCanonicalName Off

    # configures the footer on server-generated documents
    ServerSignature On
    <IfModule mod_rewrite.c>
      RewriteEngine On

        <Proxy *>
                Order deny,allow
                #deny from all
                allow from *.redcorkmu.ch
        </Proxy>

        <ProxyMatch http://176.9.142.21:[0-9]{2,}?[8|9]0/.*>
                Order deny,allow
                Allow from all
        </ProxyMatch>

      RewriteRule ^/(.*) http://localhost:8073/$1 [R,L,P]
    </IfModule>

</VirtualHost>

On 18.05.2016 10:12, Jos De Graeve wrote:
Hi,

Why are you using multiple ip's for connecting to the same odoo DB ?  Odoo does not check the connection where a request came from, so i don't see the point of doing that.

To use multiple websites in odoo, configure multiple websites in the backend.  odoo will match the website name with the http host headers.  Then have your reverse proxy forward the requests to you odoo instance.

A good idea is probably to get things working without reverse proxy, and then moving forward by adding the reverse proxy.

Regards,


Jos De Graeve - Apertoso business ICT


Guido Gezellelaan 16 - B-9800 Deinze - Belgium
 
Direct: +32 9 381 64 51
General:+32 9 381 64 50
Mobile: +32 475 54 68 80
mail/im/skype: Jos.DeGraeve@apertoso.be - apertoso

2016-05-18 9:42 GMT+02:00 Richard Lehnerdt <richard.lehnerdt@gmail.com>:
Have you tried it with a rewrite rule in apache?

<VirtualHost  iP_of_server:8080>
ServerName site name4
ServerAlias www.sitename4
RewriteEngine on
RewriteRule ^/(.*) http://127.0.0.40:8069/$1 [P]
ProxyPassReverse / http://127.0.0.40/ Keepalive=On

LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/site4.com.access.log combined
</VirtualHost>



On 17 May 2016 at 15:52, zoya patel <zoya27p@gmail.com> wrote:
Thanks robert for your reply.

It is not caching problem.

if i refresh your browser (F5) dos it still load the wrong page.

It is loding wrong page from server itself.

This is somewhat complex and interesting stuff.

On Tue, May 17, 2016 at 4:57 PM, robert rottermann <robert@redcor.ch> wrote:

never done such a configuration.
But this sounds like a caching problem.
if you refresh your browser (F5) dos it still load the wrong page?

robert

On 17.05.2016 11:53, zoya patel wrote:
Hello Community,

We are running four website with different home page and menu in single db on odoo. It works as expected but some time it shows randome behaviour like if i enterd name of site1 and it loads pages of site2. There is no fix behaviour but yes once it load any site in browser it will load same for remaining three if i it open one by one.

Let me show you first what we have done as configuration:
1> we run our server on port 8069, with db filter= our_db_name
2> After login in db we have done configuration for website admin.

for website "site1":
    domain: 127.0.0.10

for website "site2":
    domain: 127.0.0.20

for website "site3":
    domain: 127.0.0.30

for website "site4":
    domain: 127.0.0.40

3> We have created different home pages and menus for each website.

4> Apache configuration:

<VirtualHost iP_of_server:8080>
        ServerName site1.in
        ServerAlias www.site1.in
        ServerAdmin admin@site1.in

        #ProxyPass /longpolling http://127.0.0.10:8072/longpolling
        #ProxyPassReverse /longpolling http://127.0.0.10:8072/longpolling

        ProxyPass / http://127.0.0.10:8069/
        ProxyPassReverse / http://127.0.0.10:8069/

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/site1.in.access.log combined
</VirtualHost>

<VirtualHost iP_of_server:8080>
        ServerName site2.com
        ServerAdmin admin@site2.com
        ServerAlias www.site2.com
        #ProxyPass /longpolling http://127.0.0.20:8072/longpolling
        #ProxyPassReverse /longpolling http://127.0.0.20:8072/longpolling

        ProxyPass / http://127.0.0.20:8069/
        ProxyPassReverse / http://127.0.0.20:8069/

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/site2.com.access.log combined

</VirtualHost>

<VirtualHost iP_of_server:8080>
        ServerName site3.us
        ServerAdmin admin@site3.us
        ServerAlias www.site3.us
        #ProxyPass /longpolling http://127.0.0.30:8072/longpolling
        #ProxyPassReverse /longpolling http://127.0.0.30:8072/longpolling

        ProxyPass / http://127.0.0.30:8069/
        ProxyPassReverse / http://127.0.0.30:8069/

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/site3.us.access.log combined
</VirtualHost>

<VirtualHost iP_of_server:8080>
        ServerName site4.com
        ServerAdmin admin@site4.com
        ServerAlias www.site4.com
        #ProxyPass /longpolling http://127.0.0.40:8072/longpolling
        #ProxyPassReverse /longpolling http://127.0.0.40:8072/longpolling

        ProxyPass / http://127.0.0.40:8069/
        ProxyPassReverse / http://127.0.0.40:8069/

        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/site4.com.access.log combined
</VirtualHost>

Now If i run all sites using differnet ports it works but for same port it creates issue. I dont think we need to run multiple service of odoo for multi website behaviour. I am not sure where i am missing but it can be bacuse of apache or odoo configuration.

Any help or suggestion will be helpful.

Thanks.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe