Search code examples
proxydnsapache2odooreverse

Apache2 Ubuntu default page after reverse proxy on example.com instead of Odoo website


How are you?

When I config reverse proxy for the website Odoo works for www.example.com, but not for example.com and then it shows apache2ubuntu default page.

The .conf file:

<VirtualHost *:80>
ServerName example   
ServerAlias www.example.com   
ServerAdmin [email protected]   
ErrorLog /var/log/apache2/error.log   
CustomLog /var/log/apache2/access.log combined   

ProxyRequests Off   
<Proxy *>   
Order deny,allow   
Allow from all    
</Proxy>    

ProxyPass / http://server ip:8069/    
ProxyPassReverse / http://server ip:8069/    

<Location />    
Order allow,deny    
Allow from all    
</Location>    

</VirtualHost>    

What would be the misconfiguration on .conf file?

Thanks for your help, Emilio


Solution

  • Thanks Rose for your quick answer,

    So I'd aupdated Servername with example.com on Apache2Proxy.conf file: After that, I restarted apache with:

    sudo systemctl restart apache2.service
    

    and then, execute the command:

    apache2ctl -S
    
    VirtualHost configuration:
    *:80                   is a NameVirtualHost
             default server example.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost example.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost example.com (/etc/apache2/sites-enabled/Apache2Proxy.conf:1)
                     alias www.example.com
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex watchdog-callback: using_defaults
    Mutex proxy-balancer-shm: using_defaults
    Mutex ssl-stapling-refresh: using_defaults
    Mutex ssl-stapling: using_defaults
    Mutex proxy: using_defaults
    Mutex ssl-cache: using_defaults
    Mutex default: dir="/var/run/apache2/" mechanism=default
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    User: name="www-data" id=33
    Group: name="www-data" id=33
    

    But my knowledge of apache don't let me know if there is something wrong on this configuration.

    Best regards and thanks, Emilio