Skip to content

Instantly share code, notes, and snippets.

@syci
Created February 19, 2018 21:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save syci/076dbedc2c7190fd55b5b20442917c0a to your computer and use it in GitHub Desktop.
Save syci/076dbedc2c7190fd55b5b20442917c0a to your computer and use it in GitHub Desktop.
Apache2 Odoo Config
<VirtualHost *:443>
ServerAdmin webmaster@example.com
ServerName odoo.example.com
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/ssl/wildcard.example.com/public.crt
SSLCertificateKeyFile /etc/ssl/wildcard.example.com/private.pem
RequestHeader set X-Forwarded-Proto "https"
<IfModule mod_rewrite.c>
RewriteEngine On
# Permanent redirect (301 HTTP) if no canonical domain name
RewriteCond %{HTTP_HOST} !^odoo.example.com
RewriteRule ^/(.*)$ https://odoo.example.com/$1 [R=301,NE,L]
</IfModule>
<Location "/" >
Order deny,allow
Deny from all
Allow from all
</Location>
<Location "/web/database/manager" >
Order deny,allow
Deny from all
Allow from 192.168.122.0/24 127.0.0.0/255.0.0.0 ::1/128
</Location>
<Location "/website/info" >
Order deny,allow
Deny from all
Allow from 192.168.122.0/24 127.0.0.0/255.0.0.0 ::1/128
</Location>
# Comment to disable proxy
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPassReverse /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/ retry=0
ErrorLog /var/log/apache2/odoo.example.com-ssl.error.log
LogLevel warn
CustomLog /var/log/apache2/odoo.example.com-ssl.access.log combined
</VirtualHost>
</IfModule>
@sascha-seyfert
Copy link

Delete the last line ;)

@stashell
Copy link

thanks your longpolling configuration solve my problem, I spend a week trying to find out why my longpolling wasnt working

@anoureldin
Copy link

thanks

@edsonblwolf
Copy link

It worked for me too, thank you very much.

@dfvm7632
Copy link

Thanks for your longpollong configuration on Apache, it was really useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment