Ad Widget

Collapse

remove /zabbix path from apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • X4V1
    Junior Member
    • Mar 2024
    • 9

    #1

    remove /zabbix path from apache

    Hello,

    I'm new to Zabbix and I just did the setup (Apache)
    I have a reverse proxy and a domain name and I would like to remove the /zabbix path from the url to access the web interface.
    I would like to be able to reach Zabbix with a direct url like: zabbix.mydomain.com instead of zabbix.mydomain.com/zabbix.

    Could you please help me to find the correct way to do that ? Is it possible directly from the UI ? Or should I change the apache config ? Any idea what must be changed in order to do that ?

    I already searched on the forum and I found multiple threads that are not working anymore (quite old threads).

    I tried to edit "DocumentRoot" from /etc/apache2/sites-available/000-default.conf
    DocumentRoot /var/www/html => DocumentRoot /usr/share/zabbix

    It seems ok at first sight but I think I might have broke something. Could you please tell me if it's a correct way to do it of if it will break other things ?


    Last edited by X4V1; 05-03-2024, 14:16.
  • X4V1
    Junior Member
    • Mar 2024
    • 9

    #2
    It's running since yesterday, everything seems to work fine I'll see if it stays like that

    Comment

    • lbm
      Member
      • Feb 2020
      • 36

      #3
      As long as the rest is in place/loaded, like aliases and stuff, I really see no issues.

      And I guess this is the most easy way, if you havent antyhing else running, you would like to default to.

      Comment

      • irontmp
        Member
        • Sep 2023
        • 36

        #4
        Originally posted by X4V1
        Hello,

        I'm new to Zabbix and I just did the setup (Apache)
        I have a reverse proxy and a domain name and I would like to remove the /zabbix path from the url to access the web interface.
        I would like to be able to reach Zabbix with a direct url like: zabbix.mydomain.com instead of zabbix.mydomain.com/zabbix.

        Could you please help me to find the correct way to do that ? Is it possible directly from the UI ? Or should I change the apache config ? Any idea what must be changed in order to do that ?

        I already searched on the forum and I found multiple threads that are not working anymore (quite old threads).

        I tried to edit "DocumentRoot" from /etc/apache2/sites-available/000-default.conf
        DocumentRoot /var/www/html => DocumentRoot /usr/share/zabbix

        It seems ok at first sight but I think I might have broke something. Could you please tell me if it's a correct way to do it of if it will break other things ?

        To remove the /zabbix path from the URL and access Zabbix directly via zabbix.mydomain.com, follow these steps:
        1. Edit Apache Config: Open your Apache virtual host configuration file.
          bash
          Copy code
          sudo nano /etc/apache2/sites-available/000-default.conf
        2. Update DocumentRoot: Change DocumentRoot to point directly to Zabbix.
          apache
          Copy code
          <VirtualHost *:80> ServerName zabbix.mydomain.com DocumentRoot /usr/share/zabbix <Directory "/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/zabbix_error.log CustomLog ${APACHE_LOG_DIR}/zabbix_access.log combined </VirtualHost>
        3. Restart Apache:
          bash
          Copy code
          sudo systemctl restart apache2

        Now, Zabbix will be accessible via zabbix.mydomain.com without /zabbix.

        Comment

        Working...