sudo apt-get install apache2
sudo a2enmod proxy proxy_http
Now go to the directory, “/etc/apache2/sites-available” and create a file with <domain-name>.conf. Here I am going to use “demo.surekhatech.com” domain for my odoo server. So the file name will be “demo.surekhatech.conf”. Add the below content into this file.
<VirtualHost *:80>
ServerName demo.surekhatech.com
ServerAlias demo.surekhatech.com
LogLevel warn
ErrorLog /var/log/apache2/demo.surekhatech.com.error.log
CustomLog /var/log/apache2/demo.surekhatech.com.access.log combined
ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
</VirtualHost>
After adding the virtual host for odoo server, you need to enable site using the following command.
sudo a2ensite demo.surekhatech.conf
sudo service apache2 restart
vim /etc/hosts
Add to the file 127.0.0.1 demo.surekhatech.com
If you need to use SSH keys see the article
Create SSH Key
openssl req -newkey rsa:2048 -nodes -keyout pydeveloper.tk.key -out pydeveloper.tk.csr
Create Certificate
openssl req -newkey rsa:2048 -nodes -keyout domain.key -x509 -days 365 -out domain.crt
Enable ssl
a2enmod ssl
Setup SSH in /etc/apache2/sites-available/demo.surekhatech.com adding
<VirtualHost *:443>
ServerName demo.surekhatech.com
ServerAlias demo.surekhatech.com
LogLevel warn
ErrorLog /var/log/apache2/demo.surekhatech.com.error.log
CustomLog /var/log/apache2/demo.surekhatech.com.access.log combined
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/apache2/ssl/demo.surekhatech.com.cert
SSLCertificateKeyFile /etc/apache2/ssl/demo.surekhatech.com.key
ProxyPreserveHost On
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/
</VirtualHost>
Restart Apache
service apache2 restart
Complete guide:
https://computingforgeeks.com/how-to-install-odoo-on-debian-10-linux/
https://antiun.github.io/odoo-reverse-proxy-howto