Hi Matus,
Your frontend is trying to reach the backend on
"'http://repozitar.fhv.uniza.sk:8080/server/" which should not happen
because of how you tell it to reach the backend in local.cfg. Follow the
steps you see below it should fix it for you.
** Your local.cfg and config.prod.yml is O.K so don't change them.
# Only follow these steps if DSpace is the only site configured in apache
in your server.
1) echo "dspace-server-private-ip repozitar.fhv.uniza.sk" >> /etc/hosts
2) a2enmod proxy_http ssl headers
3) rm -rf /etc/apache2/sites-enabled/*.conf
4) edit /etc/apache2/sites-available/dspace.conf ... Copy and past what's
in the attached file into dspace.conf.
5) a2ensite dspace.conf
6) systemctl restart apache2
# Test & Build the Frontend
1) yarn test:rest
RESPONSE: 200
<--- You should get the 200 response for a
successful connection.
Checking JSON returned for validity...
"dspaceVersion" = DSpace 7.4
"dspaceUI" = https://repozitar.fhv.uniza.sk
<--- should match dspace.ui.url in local.cfg or dspace.cfg
"dspaceServer" = https://repozitar.fhv.uniza.sk/server
<--- should match dspace.server.url in local.cfg or dspace.cfg
"dspaceServer" property matches UI's "rest" config? true
<--- Should be true before proceeding to the building step
Does "/api" endpoint have HAL links ("_links" section)? true
<--- Should be true before proceeding to the building step
2) yarn start:prod
*** Make sure tomcat is running on port 8080 and SSL is not enabled in
Tomcat server.xml config file. SSL termination will be done on Apache
instead.
Good luck
On Monday, February 6, 2023 at 1:48:10 PM UTC+3 [email protected] wrote:
> Hi!
>
> Please, I need technical support... My Dspace 7.4 works properly on IP
> address (without domain name). Then, I got domain name a wanted to enable
> HTTPS (according to steps in Dspace manual). I used Certbot automatic HTTPS
> installation. Currently, I use http proxy for front-end as well as for
> backend, but I always get 500 error when accessing frontend (
> https://repozitar.fhv.uniza.sk/ ).
> Debugging console from Chrome shows me these errors messeges:
>
>
>
>
> *polyfills.5216e8b00933a73e.js:1 Mixed Content: The page at
> 'https://repozitar.fhv.uniza.sk/ <https://repozitar.fhv.uniza.sk/>' was
> loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
> 'http://repozitar.fhv.uniza.sk:8080/server/api
> <http://repozitar.fhv.uniza.sk:8080/server/api>'. This request has been
> blocked; the content must be served over HTTPS.main.5740e328184b19c8.js:1
> Error: x {headers: h, status: 0, statusText: 'Unknown Error', url:
> 'http://repozitar.fhv.uniza.sk:8080/server/api
> <http://repozitar.fhv.uniza.sk:8080/server/api>', ok:
> false, …}main.5740e328184b19c8.js:1 {statusCode: 0, statusText: 'Unknown
> Error', message: 'Http failure response for
> http://repozitar.fhv.uniza.sk:8080/server/api
> <http://repozitar.fhv.uniza.sk:8080/server/api>: 0 Unknown Error'}*
>
> It seems that backend (proxy to backend) works fine (
> https://repozitar.fhv.uniza.sk/server ). I suppose that my frontend and
> backend are not correctly connected. Please, check my configuration:
>
> *dspace backend local.cfg contains:*
>
> dspace.server.url = https://repozitar.fhv.uniza.sk/server
> dspace.ui.url = https://repozitar.fhv.uniza.sk
> solr.server = http://localhost:8983/solr
>
> *apache2.... /sites-enabled/000-default-le-ssl.conf:*
> ProxyPass /server http://localhost:8080/server
> ProxyPassReverse /server http://localhost:8080/server
> ProxyPass / http://localhost:4000/
> ProxyPassReverse / http://localhost:4000/
> SSLCertificateFile /etc/letsencrypt/live/
> repozitar.fhv.uniza.sk/fullchain.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/
> repozitar.fhv.uniza.sk/privkey.pem
> SSLCertificateChainFile /etc/letsencrypt/live/
> repozitar.fhv.uniza.sk/chain.pem
> Include /etc/letsencrypt/options-ssl-apache.conf
> RequestHeader set X-Forwarded-Proto "https"
> RequestHeader set X-Forwarded-Port "443"
>
> *Dspace front-end config.prod.yml contains:*
>
> ui:
> ssl: false
> host: localhost
> port: 4000
> rateLimiter:
> windowMs: 60000 # 1 minute
> max: 500 # limit each IP to 500 requests per windowMs
> # Trust X-FORWARDED-* headers from proxies (default = true)
> useProxies: true
>
> rest:
> ssl: true
> host: repozitar.fhv.uniza.sk
> port: 443
> nameSpace: /server
>
> I feel consternated. ... :( Enabling HTTPS on 6.3 was much easier.
> Thank you so much for any advice on this matter.
>
> Matus
>
>
>
>
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/4a600398-d6b3-4ced-91ef-58240a7a6f3fn%40googlegroups.com.
<VirtualHost *:80>
ServerName repozitar.fhv.uniza.sk
Redirect / https://repozitar.fhv.uniza.sk
</VirtualHost>
<VirtualHost *:443>
ServerName repozitar.fhv.uniza.sk
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/repozitar.fhv.uniza.sk.error.log
CustomLog ${APACHE_LOG_DIR}/repozitar.fhv.uniza.sk.access.log combined
ProxyRequests on
SSLEngine on
SSLProxyEngine on
SSLCertificateFile
/etc/letsencrypt/live/repozitar.fhv.uniza.sk/fullchain.pem
SSLCertificateKeyFile
/etc/letsencrypt/live/repozitar.fhv.uniza.sk/privkey.pem
SSLCertificateChainFile
/etc/letsencrypt/live/repozitar.fhv.uniza.sk/chain.pem
SSLCompression off
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder off
SSLSessionTickets off
ProxyPreserveHost on
RequestHeader set X-Forwarded-Proto https
<Proxy *>
AddDefaultCharset Off
Require all granted
</Proxy>
ProxyPass /server http://localhost:8080/server
ProxyPassReverse /server http://localhost:8080/server
ProxyPass / http://localhost:4000/
ProxyPassReverse / http://localhost:4000/
</VirtualHost>