Installation

SSL setup on CentOS 8 WeBWork 2.16

SSL setup on CentOS 8 WeBWork 2.16

by Nicoli Stupinski -
Number of replies: 5

Hi,

Could someone point me to the doc on setting up SSL.  I'm running CentOS 8, WW 2.16.

Thanks!

-Nic

In reply to Nicoli Stupinski

Re: SSL setup on CentOS 8 WeBWork 2.16

by Arnold Pizer -
In reply to Arnold Pizer

Re: SSL setup on CentOS 8 WeBWork 2.16

by Nicoli Stupinski -

Thanks, Arnold.

I got SSL working but I haven't figured out how to redirect 80 to 443.  The Ubuntu doc says to edit 000-default.conf in "cd /etc/apache2/sites-available" which doesn't exist on my CentOS server.  I did find a /opt/webwork/webwork2/docker-config/apache/000-default.conf on my system.  Is this the file to edit?  I'm not using docker, well, that I know of.

-Nic

In reply to Nicoli Stupinski

Re: SSL setup on CentOS 8 WeBWork 2.16

by Arnold Pizer -
I don't have CentOS so it would be better to get info from someone who really knows. I would grep for "VirtualHost *:80" in the apache conf files and I assume that would be the file to add the redirect to. Googling "redirect http to https apache centos" brings up several items that I haven't looked at.

Arnie
In reply to Nicoli Stupinski

Re: SSL setup on CentOS 8 WeBWork 2.16

by L Ng -

modify

$ vi /etc/httpd/conf/httpd.conf


add this module

LoadModule rewrite_module modules/mod_rewrite.so


then add these


 <IfModule mod_rewrite.c>

 RewriteEngine On

 RewriteCond %{HTTPS} off

 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 RewriteCond %{REQUEST_METHOD} ^TRACE

 RewriteRule .* - [F]

 </IfModule>


<VirtualHost *:80>

ServerName test.com

<Location />

Redirect permanent / https://test.com/

</Location>

</VirtualHost>



<VirtualHost *:443>

ServerName example.com

DocumentRoot /var/www/html/test.com

SSLEngine On

SSLCertificateFile /etc/yourpath/ssl/test.com.crt

SSLCertificateKeyFile /etc/yourpath/ssl/test.com.key

SSLCertificateChainFile /etc/yourpath/ssl/test.com.ca-bundle

</VirtualHost>


Restart your httpd


Then navigate to http://www.yoursite.com ... it should automatically be HTTPS now.




In reply to Nicoli Stupinski

Re: SSL setup on CentOS 8 WeBWork 2.16

by L Ng -
don't forget to remove unsupported protocols and ciphers as well for security.