--
You received this message because you are subscribed to a topic in the Google Groups "DSpace Technical Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dspace-tech/6ZTVNgGfBcQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech+unsubscribe@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
I am having the worst time getting tomcat to do https for dspace. I followed the instructions on the dspace site but cannot make heads or tails of the instructions as I am definitely not a certificate expert. The instructions use generic names and don't explain where root ca's come from or generating certificate requests and from what do I generate these. Can someone give me very specific instructions about how to set up the https on tomcat to run dspace. So far I have gotten dspace to run successfully as http://myserver.domain:8080/xmlui. As per instructions on the dspace site I have tried to create the RSA key, and we use incommon for our certs which I can obtain, but have not been able to figure out the beginning to end process for this. I tried using curl to test but no success. I really need a succinct explanation of all the pieces, where to get them or how to generate them in order to run the ssl. HELP!
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://scholarworks.alaska.edu/"><b>https://scholarworks.alaska.edu/</b></a></blockquote></p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at scholarworks.alaska.edu Port 443</address>
</body></html>We are using port 443 for secure connections and securing the site by rewriting
port 80 to also go to port 443. The handle server uses ports 2641 and 8000 and
needs them to to be non-SSL. But something is converting our http://hdl.handle.net/
URI links to https. So, rather than linking to the document page, we get something
like this:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> Reason: You're speaking plain HTTP to an SSL-enabled server port.<br /> Instead use the HTTPS scheme to access this URL, please.<br /> <blockquote>Hint: <a href="https://scholarworks.alaska.edu/"><b>https://scholarworks.alaska.edu/</b></a></blockquote></p> <hr> <address>Apache/2.2.15 (Red Hat) Server at scholarworks.alaska.edu Port 443</address> </body></html>
My best guess at the moment is that the virtualhost configurations are
also somehow catching other ports and rewriting them in the same way.
<VirtualHost *:80>
#
### Redirect insecure ports to secure port 443
ServerAdmin uaf-libra...@alaska.edu
RewriteEngine On
RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
DocumentRoot /dspace/webapps/xmlui
ServerName scholarworks.alaska.edu
ServerAlias scholarworks
ErrorLog logs/scholarworks.alaska.edu-error_log
CustomLog logs/scholarworks.alaska.edu-access_log common
ProxyPass / http://127.0.0.1:443/ retry=10 connectiontimeout=5
### ^ this tells httpd to redirect it's / to localhost port 443
#timeout=300
ProxyPassReverse / http://127.0.0.1:443/ retry=10
### ^ this tells httpd that tomcat's url's should be rewritten to look
### like they're coming from httpd.
ProxyPreserveHost On
### ^ this tells httpd to keep the Host: information from the client and
### pass it on to tomcat.
</VirtualHost>
#<VirtualHost scholarworks.alaska.edu:443>
<VirtualHost *:443>
### ^ this creates a httpd server that listens on port 443.
ServerAdmin uaf-libra...@alaska.edu
DocumentRoot /dspace/webapps/xmlui
ServerName scholarworks.alaska.edu
ServerAlias scholarworks
ErrorLog logs/scholarworks.alaska.edu-https-error_log
CustomLog logs/scholarworks.alaska.edu-https-access_log combinedssl
Include conf.d/ssl.include
Include conf.d/ssl.include.star
### ^ these point to a file which specifies where the ssl certificates
### live on the host.
ProxyPass / http://127.0.0.1:8080/ retry=10 connectiontimeout=5
### ^ this tells httpd to redirect it's / to localhost port 8080
#timeout=300
ProxyPassReverse / http://127.0.0.1:8080/ retry=10
### ^ this tells httpd that tomcat's url's should be rewritten to look
### like they're coming from httpd.
ProxyPreserveHost On
### ^ this tells httpd to keep the Host: information from the client and
### pass it on to tomcat.
#SSLUseStapling on
### Added due to error when starting apache. Dayne Ellanna
</VirtualHost>
We once were trying to do this via Tomcat rewriting 8080 to 443. But when
we gave up on Tomcat I disabled the unneeded ports 8080 and 8443. I also
changed the proxy references to 8080 in <virtualhost *:80> to 443; that won't
work in the <virtualhost *:443> section because it would reroute to itself.
So why do I need the 443 proxy directives at all? I tried commenting out the
entire line but that just breaks the whole site.
Does anyone see anything glaringly wrong with this setup?
I believe the local handle-server process passes the request
to handle.net just fine. But somewhere during the return trip
we're redirected to port 443 and things to south.
On Tuesday, October 24, 2017 at 9:46:58 PM UTC-4, wlruth...@alaska.edu wrote:We are using port 443 for secure connections and securing the site by rewriting
port 80 to also go to port 443. The handle server uses ports 2641 and 8000 and
needs them to to be non-SSL. But something is converting our http://hdl.handle.net/
URI links to https. So, rather than linking to the document page, we get something
like this:<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> Reason: You're speaking plain HTTP to an SSL-enabled server port.<br /> Instead use the HTTPS scheme to access this URL, please.<br /> <blockquote>Hint: <a href="https://scholarworks.alaska.edu/"><b>https://scholarworks.alaska.edu/</b></a></blockquote></p> <hr> <address>Apache/2.2.15 (Red Hat) Server at scholarworks.alaska.edu Port 443</address> </body></html>
I tried following the URI: link at https://scholarworks.alaska.edu/xmlui/handle/11122/6433 using 'curl'. The Handle link there is 'http://hdl.handle.net/11122/6433'. hdl.handle.net responded with a 303 redirect to 'http://scholarworks.alaska.edu:443/xmlui/handle/11122/6433' which is wrong: it should either use 'https:' or omit the port 443. I suspect that you've set 'dspace.url' to 'http://scholarworks.alaska.edu:443' instead of 'https://scholarworks.alaska.edu:443'. The DSpace Handle resolver just appends the object's handle to the value of 'dspace.url' and sends that back to the master resolver at hdl.net.
My best guess at the moment is that the virtualhost configurations are
also somehow catching other ports and rewriting them in the same way.
<VirtualHost *:80>
#
### Redirect insecure ports to secure port 443
ServerAdmin uaf-libra...@alaska.edu
RewriteEngine On
RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
This probably doesn't accomplish anything, since a rewrite to the same host will be stripped down to the localpart. Forcing a redirect, as in the line above it, should evoke a new request to the proper port. Try appending '[R,L]' or '[R=permanent,L]'.
DocumentRoot /dspace/webapps/xmlui
ServerName scholarworks.alaska.edu
ServerAlias scholarworks
ErrorLog logs/scholarworks.alaska.edu-error_log
CustomLog logs/scholarworks.alaska.edu-access_log common
ProxyPass / http://127.0.0.1:443/ retry=10 connectiontimeout=5
### ^ this tells httpd to redirect it's / to localhost port 443
No. This is not a redirect. HTTPD will act like a client and ask the target for the localpart, then send the reply back to *its* client. Above HTTPD is proxying through itself, which is probably not what you want. Here we have no proxy rules at all for port 80, only actual redirects telling HTTPD's client to try again on port 443. All the proxying happens in the port 443 virtual host. I would just take all this proxy stuff out of this vhost.
#timeout=300
ProxyPassReverse / http://127.0.0.1:443/ retry=10
### ^ this tells httpd that tomcat's url's should be rewritten to look
### like they're coming from httpd.
ProxyPreserveHost On
### ^ this tells httpd to keep the Host: information from the client and
### pass it on to tomcat.
</VirtualHost>
#<VirtualHost scholarworks.alaska.edu:443>
<VirtualHost *:443>
### ^ this creates a httpd server that listens on port 443.
ServerAdmin uaf-libra...@alaska.edu
DocumentRoot /dspace/webapps/xmlui
ServerName scholarworks.alaska.edu
ServerAlias scholarworks
ErrorLog logs/scholarworks.alaska.edu-https-error_log
CustomLog logs/scholarworks.alaska.edu-https-access_log combinedssl
Include conf.d/ssl.include
Include conf.d/ssl.include.star
### ^ these point to a file which specifies where the ssl certificates
### live on the host.
ProxyPass / http://127.0.0.1:8080/ retry=10 connectiontimeout=5
### ^ this tells httpd to redirect it's / to localhost port 8080
Again, not a redirect; this causes HTTPD to send a request to whatever is on port 8080 (Tomcat, I presume) and forward its response back to HTTPD's client. This is what you need in order to actually serve user requests.