You can use the same steps for any web application using Apache Tomcat as its web server.
Welcome to this blog, where I'll guide you through running Liferay Community Edition over HTTPS. This method applies to Liferay and any web application served through an Apache Tomcat web server. Don't worry if you still need to get a valid SSL certificate. This blog will use a self-signed certificate that is acceptable for testing or development environments.
you will need a valid SSL certificate with its private key if you're configuring a production environment. You can purchase one through any domain registrar, such as GoDaddy.
mkdir ssl && cd ssl
openssl genrsa -out private-key.pem 2048
openssl req -new -key private-key.pem -out
certificate-signing-request.csr
openssl x509 -req -days 3650 -in
certificate-signing-request.csr -signkey private-key.pem
-out signed-certificate.crt
tomcat-{version-number}/conf
directory and open the file
server.xml
to
modify it.
org.apache.coyote.http11.Http11AprProtocol
and do the following:
org.apache.coyote.http11.Http11AprProtocol
to
org.apache.coyote.http11.Http11NioProtocol
certificateKeyFile
to
certificateKeyFile="ssl/private-key.pem"
certificateFile
to
certificateFile="ssl/signed-certificate.crt"
tomcat-{version-number}/bin
and run:
./catalina run
.
https://localhost:8443
.
In this blog, we used a self-signed certificate to run Liferay on HTTPS in a development environment. You can follow the same steps (excluding the steps where you create the self-signed certificate) when you purchase a valid SSL certificate through any domain registrar, such as GoDaddy, and use it in your production environment.