I am gettting this error when I try to access the site.
No web page was found for the web address: HTTP ERROR 404
After reading your comments I ended up with this config, but still no luck.
Is my Enonic vhost file correct?
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
<VirtualHost *:443>
ServerName abc.com.br
ServerAlias www.abc.com.br
DocumentRoot /var/www/html/
RequestHeader set X-Forwarded-Proto "https"
Header always set Strict-Transport-Security "max-age=15768000"
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/abc.com.br/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/abc.com.br/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/abc.com.br/chain.pem
ProxyRequests Off
ProxyPreserveHost On
SSLProxyEngine on
ProxyPass / http://142.93.118.89:8080/ timeout=5
ProxyPassReverse / http://142.93.118.89:8080/ timeout=5
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteCond %{REQUEST_URI} /admin [NC]
RewriteRule /admin/(.*) ws://142.93.118.89:8080/admin/$1 [P,L]
RewriteCond %{HTTP_HOST} !^abc\.com\.br$
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) https://abc.com.br/$1 [L,R]
</VirtualHost>
SSLProtocol all -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
SSLHonorCipherOrder on
SSLUseStapling on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLStaplingCache shmcb:/var/run/ocsp(128000)
------------------------------
Enonic Vhost file
enabled = true
mapping.api.host = localhost
mapping.api.source = /api
mapping.api.target = /api
mapping.a.host = 142.93.118.89
mapping.a.source = /admin
mapping.a.target = /admin
mapping.a.userStore = system
mapping.b.host = 142.93.118.89
mapping.b.source = /
mapping.b.target = /portal/master/abc
Server is running as seen here.
root@ubuntu-suppliers:/home/xp/enonic/xp/config# sudo service xp status
● xp.service - SYSV: Enonic XP server daemon
Loaded: loaded (/etc/init.d/xp; generated)
Active: active (exited) since Tue 2019-10-29 19:34:08 UTC; 3 weeks 1 days ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 2362)
CGroup: /system.slice/xp.service
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
try to set ProxyPreserveHost Off
(OR use host names in vhost file)
When enabled, ProxyPreserveHost option will pass the Host: line from the incoming request to the proxied host, instead of the hostname specified in the ProxyPass line.
IMHO you should start with a minimalistic apache config with proxy, get that working, and then add rewrites, ssl and whatnot. That would help you figure out where things are failing.
Also, if you are using XP7, you can safely drop this line from the vhost config:
I managed to get it working thanks to you. So… Apache virtual host file was fine all along, the issue was with this line mapping.b.host = 142.93.118.89. Changing it to mapping.b.host = abc.com.br solved the problem.