Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Openerp 7 SSL redirect

By
Prakash
on 5/24/13, 6:32 AM 10,559 views

OpenERP 7 Linux Server SSL Setup installed with the below steps given in the url:-

       http://www.teckzilla.net/blogs/item/108-openerp-ssl.html

Working SSL with below url:-

           https://portno:Ip-address/

Issues in the below url:-

           http://portno:Ip-address/

           Not redirect  http into https

How to auto redirect from http into https?

Added following lines to redirct [http into https] (outside of the <directory> config blocks) into the file /etc/apache2/sites-available/default

RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

But the above code is not redirect http into https ?

How to redirect in openerp 7 in linux server?

0

Davide Corio

--Davide Corio--
1822
| 4 3 7
Bricherasio, Italy
--Davide Corio--

Odoo Evangelist and Consultant

Davide Corio
On 5/24/13, 6:38 AM

Try with:

<VirtualHost *:80>
  ServerName myservername
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

If this won't work, Apache is probably ignoring the rule.

Also, replace * with your ip or server name if this is the case.

Thanks for reply added the code /etc/apache2/httpd.conf 1) access url http://servername connection time out error but able to access in https://servername. and unable to redirect http://ipaddress

Prakash
on 5/24/13, 7:10 AM

have you defined the <VirtualHost *:443> directive?

Davide Corio
on 5/24/13, 7:12 AM

Yes Virtual Host defined in the path /etc/apache2/sites-avilable/openerp-ssl

Prakash
on 5/24/13, 7:17 AM

i just noticed that you're typing http://ip:port and https://ip:port. you should just type http://ip and you should get redirected to https://ip. in order to avoid typing :port you need to properly configure a proxy directive

Davide Corio
on 5/24/13, 7:20 AM
0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 5/24/13, 7:19 AM

I followed the steps http://pastebin.com/uGVtBxQ3 but still SSL issues not solved.

Now I tried the below conf code:-

<VirtualHost *:443>
 ServerName openerp.servername.com
 SSLEngine On
 SSLCertificateFile /etc/apache2/ssl/server.crt
 SSLCertificateKeyFile /etc/apache2/ssl/server.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>

But issues is when typed https://openerp.servername.com/ in the browser then the output page open with http://openerp.servername.com/ instead of https.

[Redirect also applied in conf file but no changes]

Suppose i changed conf code

ProxyPass / http://127.0.0.1:8069/
     Changed into 
ProxyPass / http://127.0.0.1:80/

After that typed https://openerp.servername.com/ in the browser then the output page open with https://openerp.servername.com/ but show message It Works! but no content has been added, yet.

In OpenERP 6 version SSL Connection openerp-web.cfg has the following lines:

tools.proxy.on = True
tools.proxy.base = 'http://HOST.com/openerp'
tools.proxy.local = ''

But in OpenERP 7 version openerp-web.cfg file not available where to add the above line in openerp version 7?

Please give me solution how to solve this issue? Thanks

the following is a working conf: http://pastebin.com/uGVtBxQ3

Davide Corio
on 5/24/13, 7:30 AM

Hi Davide, for SSL setup openerp-server.conf file what are the extra lines are add? in both openerp-server.conf? or any one. Code Updated

Prakash
on 5/24/13, 9:28 AM

OpenERP doesn't provide any SSL support, so you don't need to touch the config file.

Davide Corio
on 5/24/13, 1:01 PM

Please see the updated code

Prakash
on 5/27/13, 5:07 AM

look at the configuration i posted previously. you can use it "as is" by just changing the ip of your server.

Davide Corio
on 5/27/13, 5:20 AM

Yes perviously posted also used changed ip address <VirtualHost *:80>

ServerName openerpserver RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

<VirtualHost *:443> ServerName openerpserver

RewriteEngine on RewriteRule ^/(.*) http://192.168.xx.xx:8069/$1 [P] ProxyPassReverse / http://192.168.xx.xx:8069/

SSLEngine On SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key

</VirtualHost> But facing the same issue https:// redirect into http://

Prakash
on 5/27/13, 5:44 AM

Davide Corio You are my HERO! Your pastebin example on May 24 '13 was the answer I have spent many hours looking for. Lots of nginx setup routines...with Apache there's an assumption of knowledge...hard for those who don't know. Thanks Davide!

toot
on 7/29/13, 6:16 PM
0
timrea
On 12/25/13, 10:55 AM

Hi David, I don't quite get which one you meant would work. I'm on Apache2. Where is your config supposed to be? In Apache.conf or 'default' in sites-available or in '.htaccess' in var/www?

Please advice. Thank you. -Timrea.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/24/13, 6:32 AM
Seen: 10559 times
Last updated: 3/16/15, 8:10 AM