Ad Widget

Collapse

.htaccess file do not work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NormanW
    Junior Member
    • Feb 2024
    • 6

    #1

    .htaccess file do not work

    Dear members,

    I've tried to protect my Zabbix Web page with an Login before the Zabbix login web page is coming up, with a .htaccess file in the directory: /usr/share/zabbix (where the index.php is)

    the content of that .htaccess is:
    cat .htaccess
    # .htaccess-Datei für Passwortschutz
    AuthType Basic
    AuthName "Geschützter Bereich - Bitte geben Sie ein Passwort ein!"
    AuthUserFile /opt/.htpasswd
    Require valid-user

    However, it seems that .htaccess will not be recognized.

    Therefore I've changed the /etc/zabbix/apache.conf file: (as well in /etc/apache2/sites-enabled/zabbix.conf)

    <Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride Options <= changed None to Options, however also ALL didn't work
    Order allow,deny
    Allow from all​

    I use apache2 2.4.57-2

    My system:

    OS: Debian GNU/Linux 12 (bookworm) x86_64
    Kernel: 6.5.0-0.deb12.1-amd64
    Shell: zsh 5.9
    Memory: 3587MiB / 7844MiB
    GPU Driver: i915
    CPU Usage: 43%
    Disk (/): 213G / 915G (25%)

    The reason is: I have several web servers subdirectories, and just one IP. So I would like to protect the access to each of the other subdirectories.
    That .htaccess works fine for the pihole /admin subdiretory

    is there any area where I have not looked?

    Thank you all in advanced.

    Norman
  • solution
    Senior Member
    • Jun 2020
    • 269

    #2
    remove the .htaccess and try this:
    apache/conf-enable/zabbix.conf

    Code:
    <Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    AuthType Basic
    AuthName "Restricted Access"
    AuthUserFile /opt/.filename
    Require valid-user
    Restart Apache


    Wellington

    Comment

    • NormanW
      Junior Member
      • Feb 2024
      • 6

      #3
      Brilliant. Your solution works fine. I was not sure if this works in the zabbix.conf file directly.

      Many Thanks.

      Comment

      Working...