Ad Widget

Collapse

ZABBIX 6.0.14 under Apache/2.4.29 (Ubuntu) HTTP Redirect to HTTPS Working ....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nuri
    Junior Member
    • Jan 2015
    • 14

    #1

    ZABBIX 6.0.14 under Apache/2.4.29 (Ubuntu) HTTP Redirect to HTTPS Working ....

    Dear Forum Members,

    I have struggled a lot to make it worked but at the end I found a solution that suited my environment.
    I 'ld like to share my findings hoping to be helpful for someone in trouble.

    Before editing the files, place CA domain certificate as of CRT extension and master key file as of KEY extension to the appropriate directory.

    ​1-) First, Let's nano the apache.conf in /etc/zabbix directory.

    i-) Comment out the below lines ;

    #<IfModule mod_alias.c>
    # Alias /zabbix /usr/share/zabbix
    #</IfModule>

    i-) Add in below lines under "VirtualHost";

    <VirtualHost *:80>
    ......

    ServerName zabbix.myzabbixdomain.com.tr

    DocumentRoot /usr/share/zabbix/

    Redirect 301 / https://zabbix.myzabbixdomain.com.tr

    ------

    </VirtualHost>

    ​2-) Then, Let's nano the "000-default.conf" in /etc/apache2/sites-enabled.

    i-) Add in below lines under "VirtualHost" ;

    <VirtualHost *:80>
    .....

    ServerName zabbix.myzabbixdomain.com.tr
    DocumentRoot /usr/share/zabbix
    Redirect permanent / https://zabbix.myzabbixdomain.com.tr

    .....

    </VirtualHost>


    <IfModule mod_ssl.c>

    <VirtualHost _default_:443>

    .....

    ServerName zabbix.myzabbixdomain.com.tr

    DocumentRoot /usr/share/zabbix/

    SSLEngine on
    SSLCertificateFile /etc/zabbix/grafana.crt
    SSLCertificateKeyFile /etc/zabbix/grafana.key

    ......

    # <VirtualHost _default_:443>
    </VirtualHost>

    #<IfModule mod_ssl.c>
    </IfModule>



    2-) Then, Let's nano the "default-ssl.conf" in /etc/apache2/sites-enabled.

    i-) Add in below lines under "VirtualHost" ;

    <VirtualHost _default_:443>
    ....

    ServerName zabbix.myzabbixdomain.com.tr

    DocumentRoot /usr/share/zabbix

    SSLEngine on

    ....

    </VirtualHost>

    3-) Check that you have not made syntax errors in the Apache configuration files:

    $ sudo apache2ctl configtest​

    Restart Apache2 service by the command "sudo service apache2 restart"

    Then, when you type in the zabbix.myzabbixdomain.com.tr to URL field, the response will be https://zabbix.myzabbixdomain.com.tr with a valid CA certificate sign left to the URL.

    Regards.

    Nuri.​
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2

    SSLCertificateFile /etc/zabbix/grafana.crt
    SSLCertificateKeyFile /etc/zabbix/grafana.key​
    ?? :P
    this should be matching to what you refer to as "Before editing the files, place CA domain certificate as of CRT extension and master key file as of KEY extension to the appropriate directory."... You can never know, when someone just copies this and then starts to ask for grafana certs..:P

    Comment

    • nuri
      Junior Member
      • Jan 2015
      • 14

      #3
      Hi,

      /etc/zabbix/grafana.crt and /etc/zabbix/grafana.key​ are the directory names for example.

      grafana.crt is the example file name for the CA certificate.crt file

      grafana.key is the example file name for the CA certificate.crt file's private key file.

      Thanks for the reply.

      Comment

      • felipesorz
        Junior Member
        • Jul 2023
        • 24

        #4
        Hey,
        I am try config my zabbix for HTTPS

        in apache2ctl configtest:
        AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
        Syntax OK

        Comment

        • felipesorz
          Junior Member
          • Jul 2023
          • 24

          #5
          Originally posted by felipesorz
          Hey,
          I am try config my zabbix for HTTPS

          in apache2ctl configtest:
          AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
          Syntax OK
          Resolvido!

          Comment

          Working...