To configure Apache to act as an SSL proxy to an OpenERP 7 (now known as Odoo) server running in a Virtual Machine (VM), you need to set up with Apache SSL and configure it as a reverse proxy.
Here’s a step-by-step guide:
Step 1: Install Apache and Enable Necessary Modules
- Install Apache if it’s not already installed:
sudo apt-get update
sudo apt-get install apache2
- Enable the required Apache modules:
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_http
- Restart Apache to apply the changes:
sudo systemctl restart apache2
Step 2: Obtain an SSL Certificate
You need a valid SSL certificate to configure HTTPS. You can either use a self-signed certificate (for testing purposes) or obtain one from a certificate authority (for production use).
- Generate a Self-Signed SSL Certificate (for testing):
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
Follow the prompts to enter your details.
Step 3: Configure Apache Virtual Host
- Create a new Virtual Host configuration file for the OpenERP instance. For example, create a file named
openerp-ssl.conf
:
sudo nano /etc/apache2/sites-available/openerp-ssl.conf
- Add the following configuration to the file:
<VirtualHost *:443>
ServerName yourdomain.com # Replace with your domain name
SSLEngine On
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://VM_IP_ADDRESS:8069/
ProxyPassReverse / http://VM_IP_ADDRESS:8069/
ErrorLog ${APACHE_LOG_DIR}/openerp-error.log
CustomLog ${APACHE_LOG_DIR}/openerp-access.log combined
</VirtualHost>
Replace yourdomain.com
with your actual domain name and VM_IP_ADDRESS
with the IP address of the VM where OpenERP 7 is running.
- Enable the new Virtual Host:
sudo a2ensite openerp-ssl.conf
- Restart Apache to apply the new configuration:
sudo systemctl restart apache2
Step 4: Adjust Firewall Settings
Make sure your firewall allows traffic on port 443 (HTTPS):
sudo ufw allow 443/tcp
Step 5: Test the Configuration
- Open your web browser and navigate to
https://yourdomain.com
. - If everything is set up correctly, you should see the OpenERP 7 login page.
Additional Tips
- If you are using a self-signed certificate, your browser will warn you about the certificate being untrusted. This is normal for a self-signed certificate.
- For production environments, consider using Let’s Encrypt to obtain a free SSL certificate.
This setup will secure communication between your Apache server and the OpenERP server running in a VM using SSL.
Conclusion
To simply configure Apache to work as an SSL proxy to an OpenERP 7 (at present famous as Odoo) server running specifically in a dedicated Virtual Machine (VM), you just need to set up Apache SSL and also configure it as an opposite proxy. Infinitive Host provides the best managed ODOO server solutions.