opsec2022
Goto Top

Apache für HTACCESS konfigurieren

Hallo,

für ein NetgearNAS (Debian) versuche ich für die Nutzung von .htaccess-Dateien zu konfigurieren.
Ähnliche Situation wie Hier.

Der bereitzustellende Share liegt unter /data/Share.

/data/Share/.htaccess

# Apache Autoindex Directives
Options +Indexes
IndexOptions FancyIndexing HTMLTable SuppressRules ShowForbidden
IndexOptions IconsAreLinks ScanHTMLTitles NameWidth=* DescriptionWidth=*

# Autoindex-Strapdown Directives
AddType text/plain .md
HeaderName HEADER.md
ReadmeName README.md

# Customize by setting theme and title
IndexHeadInsert "<script>conf = {theme: 'bootstrap', title: ''};</script> \  
<script src='http://ais.habilis.net/autoindex_strapdown.js'></script> \  
<link rel='stylesheet' href='http://ais.habilis.net/autoindex_strapdown.css'>"  

# Icons using Bootstrap's Glyphicon set  
DefaultIcon http://ais.habilis.net/icons/glyphicon-file.svg
AddIcon http://ais.habilis.net/icons/blank.svg ^^BLANKICON^^
AddIcon http://ais.habilis.net/icons/glyphicon-folder-open.svg ^^DIRECTORY^^
AddIcon http://ais.habilis.net/icons/glyphicon-circle-arrow-up.svg ..
AddIconByType (TXT,http://ais.habilis.net/icons/glyphicon-file.svg) text/*
AddIconByType (IMG,http://ais.habilis.net/icons/glyphicon-picture.svg) image/*
AddIconByType (SND,http://ais.habilis.net/icons/glyphicon-music.svg) audio/*
AddIconByType (VID,http://ais.habilis.net/icons/glyphicon-film.svg) video/*

Ich habe hier lediglich ShowForbidden ergänzt.

000-default.conf dementsprechend

<VirtualHost *:80>

	ServerAdmin webmaster@localhost
	DocumentRoot /data/Share
	<Directory /data/Share>
	  Options Indexes FollowSymLinks MultiViews
	  AllowOverride All
	  Require all granted
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Ob selfhosted oder mit der ursprünglichen Version des Strapdown Autoindex, greift die .htaccess nicht.

auth_basic & rewrite sind aktiv und die 000-default wurde mithilfe von a2ensite als Standard gesetzt.

Im Debugger sucht er lokal unter http://localhost/icons/.. nach den Icons als .gif statt .svg. Ich verstehe auch nicht woher im Referrer aufeinmal die IP des localhost kommt.
apache debug


Evtl. hat hier noch jemand eine Idee

Gruß

OpSec

Content-Key: 3952001812

Url: https://administrator.de/contentid/3952001812

Printed on: April 27, 2024 at 06:04 o'clock

Member: Crusher79
Crusher79 Sep 15, 2022 at 13:13:54 (UTC)
Goto Top
Hallo,

normal schreiben wir doch alles klein "/data/Share" mit großen S?
Member: opsec2022
opsec2022 Sep 15, 2022 at 13:19:20 (UTC)
Goto Top
Hallo,

Zitat von @Crusher79:

Hallo,

normal schreiben wir doch alles klein "/data/Share" mit großen S?

Das ist der Name der Freigabe und der Pfad auf UNIX-Ebene.

Gruß
Mitglied: 3803037559
Solution 3803037559 Sep 15, 2022 updated at 14:15:59 (UTC)
Goto Top
Kein Wunder, das Skript versucht JavaScript-Code von einer Domain zu laden die es mittlerweile nicht mehr gibt ... => 9 Jahre alt sagt ja schon alles face-big-smile.

Ersetze den Link http://strapdownjs.com/v/0.2/strapdown.js im Code in der autoindex_strapdown.js z.B. durch https://cdn.jsdelivr.net/gh/Naereen/StrapDown.js@master/strapdown.min.js oder lad das runter und verlinke es lokal dann klappts auch mit dem Nachbarn, hier erfolgreich getestet face-wink.

Cheers
certguy
Member: opsec2022
opsec2022 Sep 16, 2022 at 12:25:58 (UTC)
Goto Top
Zitat von @3803037559:

Kein Wunder, das Skript versucht JavaScript-Code von einer Domain zu laden die es mittlerweile nicht mehr gibt ... => 9 Jahre alt sagt ja schon alles face-big-smile.

Ersetze den Link http://strapdownjs.com/v/0.2/strapdown.js im Code in der autoindex_strapdown.js z.B. durch https://cdn.jsdelivr.net/gh/Naereen/StrapDown.js@master/strapdown.min.js oder lad das runter und verlinke es lokal dann klappts auch mit dem Nachbarn, hier erfolgreich getestet face-wink.

Cheers
certguy

Hallo,

der Hinweis war schon richtig, allerdings scheint auf dem NAS trotz Factory-Reset eine .htaccess steckengeblieben zu sein, welche auf .gifs verweist. Auf einem frischen Debian-Based Linux klappte das ganze, mit der selben config auf Anhieb.

Gruß OpSec