# Icinga web 2 on https

**URL:** <https://community.icinga.com/t/icinga-web-2-on-https/1359>\
**Category:** Icinga Web\
**Created:** [May 30, 2019, 4:46am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359 "2019-05-30T04:46:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxwell207](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@maxwell207](https://community.icinga.com/u/maxwell207)\
**Post date:** [May 30, 2019, 4:46am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/1 "2019-05-30T04:46:28Z")

</div>

Hi there,

Current icinga2 weburl is running on Http by default. Is there any supported/simpler way to run it on Https?  
I could not find any documentation of Https configuration on web. It sounds like apache related. Apology, I am not too familiar with Linux and apache.

regards,  
Max

---

<div class="post-metadata">

**Author:** ![anon66228339](https://community.icinga.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@anon66228339](https://community.icinga.com/u/anon66228339)\
**Post date:** [May 30, 2019, 4:52am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/2 "2019-05-30T04:52:07Z")

</div>

Hello,

you have to do the configuration in apache. There are plenty howto on the web if you google for it.

Regards,  
Carsten

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [June 3, 2019, 7:26am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/3 "2019-06-03T07:26:04Z")

</div>

Hi,

enable the default VHost to listen on port 443 as well, also ensure that TLS certificates are created and configured in there.

Depending on how you’d like to reach Icinga Web 2 then, either create a rewrite rule for port 80 which enforces https with a redirect, or just allow only 443.

Here’s an example on the docs for a [VHost configuration](https://icinga.com/docs/icingaweb2/latest/doc/20-Advanced-Topics/#virtualhost-configuration-for-apache).

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![maxwell207](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@maxwell207](https://community.icinga.com/u/maxwell207)\
**Post date:** [July 2, 2019, 4:12am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/4 "2019-07-02T04:12:00Z")

</div>

Here is how to configure Apache to redirect to Https. Mine is on Centos.

1. Install mod\_ssl module  
_yum install mod\_ssl_
2. Redirect HTTP to HTTPs  
vim /etc/httpd/conf.d/icingaweb2.conf  
Add RewriteCond and Rewriterule

`RewriteCond %{HTTPS} off`  
`RewriteRule ^.*$ https:` `//%{HTTP_HOST}%{REQUEST_URI}/$1 [R,L]`  
[![](https://community.icinga.com/uploads/default/original/1X/3be58dece1df168643097a2170b50a42537bad6f.png)](https://imgbb.com/)

3)Restart the httpd service  
service httpd restart

---

<div class="post-metadata">

**Author:** ![radioactive9](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@radioactive9](https://community.icinga.com/u/radioactive9)\
**Post date:** [March 12, 2020, 5:29am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/5 "2020-03-12T05:29:29Z")

</div>

Hello

I do not want to open a new thread on this. As my question is in line with the topic

I am on SLES  
I have my own cert and key and pkcs loadbalancer.

Where do I put the key and cert to configure the web to open via load balancer on port 443

vim /etc/sysconfig/apache2

> APACHE\_MODULES=“actions alias auth\_basic authn\_file authz\_host authz\_groupfile authz\_core authz\_user autoindex cgi dir env expires include log\_config mime negotiation setenvif ssl socache\_shmcb userdir reqtimeout wsgi authn\_core rewrite php7 status”  
> …  
> …  
> .  
> APACHE\_SERVER\_FLAGS=“SSL”

Copied the .crt file and .key file  
cp icinga-monitoring.net.key /etc/apache2/ssl.key/  
cp icinga-monitoring.net.crt /etc/apache2/ssl.crt/

Updated the global ssl  
vim /etc/apache2/ssl-global.conf  
SSLCertificateChainFile /etc/apache2/ssl.crt/icinga-monitoring.net.crt  
SSLCertificateKeyFile /etc/apache2/ssl.key/icinga-monitoring.net.key

As next step I think vhost need to updated with crt and key files. But I don’t have them. What am I missing

---

<div class="post-metadata">

**Author:** ![twidhalm](https://community.icinga.com/user_avatar/community.icinga.com/twidhalm/32/18_2.png) [@twidhalm](https://community.icinga.com/u/twidhalm)\
**Post date:** [March 12, 2020, 8:15am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/6 "2020-03-12T08:15:47Z")

</div>

The location of the certificate and the key is not relevant. You can point your apache configuration to the right place.

If you have a loadbalancer you should have a look into TLS offloading and decide whether the loadbalancer should have the certificate for all hosts behind it. The next step would be secure traffic between the loadbalancer and the upstream (in this case your Icinga servers).

I think this question is a bit beyond the focus of this board because it is completely about TLS configuration of webservers and loadbalancers and it has nothing to do with Icinga specifically. We can still try to help but I think it would be better placed into some board about webserver configuration.

---

<div class="post-metadata">

**Author:** ![radioactive9](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@radioactive9](https://community.icinga.com/u/radioactive9)\
**Post date:** [March 12, 2020, 11:48am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/7 "2020-03-12T11:48:24Z")

</div>

Hello I have further configured as below.  
vim /etc/apache2/ssl-global.conf

> SSLCertificateFile /etc/apache2/ssl.crt/icinga-monitoring.net.crt  
> SSLCertificateKeyFile /etc/apache2/ssl.key/icinga-monitoring.net.key  
> SSLCertificateChainFile /etc/apache2/ssl.crt/icinga-monitoring.net.crt

Copying the default template to create specific vhost

cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/icingaweb2ssl.conf  
vim /etc/apache2/vhosts.d/icingaweb2ssl.conf

Added the following as attached  
[config.txt](https://community.icinga.com/uploads/short-url/4SR2GoQb5bLOEkBjmXitKlWryQH.txt) (2.6 KB)

But getting this page cannot be displayed when calling  
[https://icinga-monitoring.net](https://icinga-monitoring.net)

---

<div class="post-metadata">

**Author:** ![twidhalm](https://community.icinga.com/user_avatar/community.icinga.com/twidhalm/32/18_2.png) [@twidhalm](https://community.icinga.com/u/twidhalm)\
**Post date:** [March 12, 2020, 1:07pm UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/8 "2020-03-12T13:07:52Z")

</div>

> [@radioactive9](#):
>
> But getting this page cannot be displayed when calling  
> [https://icinga-monitoring.net](https://icinga-monitoring.net)

Did you update your local DNS to point this URL to your Icinga host?

---

<div class="post-metadata">

**Author:** ![radioactive9](https://community.icinga.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@radioactive9](https://community.icinga.com/u/radioactive9)\
**Post date:** [March 13, 2020, 3:34am UTC](https://community.icinga.com/t/icinga-web-2-on-https/1359/9 "2020-03-13T03:34:11Z")

</div>

Hello Thomas

Yes I did. Config.txt for the vhost looks good to you right? I was worried about that. Another thing - am I suppose to use both chain and normal entry for certificate? I will check with the local network team in the mean time to see if there is something blocking
