Apache2, userdir, index.html: keine Links

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
ALU
Beiträge: 29
Registriert: 19.11.2016 20:21:41

Apache2, userdir, index.html: keine Links

Beitrag von ALU » 25.10.2017 02:58:09

Aufgabenstellung: apache2, so konfiguriert, daß index.html oder index.php aus /home/user/software/php gelesen wird.

Mir ist aufgefallen, dass wenn die Datei index.php heißt, gehen Links ("a href"), heißt sie aber index.html, werden Links als Text (schwarze Farbe, nicht klickbar) dargestellt. Mich interessiert, warum dieser kleine Unterschied so viel ausmacht. (In /var/www/ ist alles normal, index.php und index.html verhalten sich gleich).

/etc/group:

Code: Alles auswählen

user:x:1000:www-data
/etc/apache/sites-avaliable/002-user.conf:

Code: Alles auswählen

<VirtualHost localhost:80>
	ServerAdmin user@localhost
	ServerName localhost
	DocumentRoot "/home/user/software/php"

<Directory /home/user/software/php>
	Options None
	AllowOverride All
	Require all granted
	<IfModule mod_userdir.c>
        	php_admin_flag engine on
		php_admin_flag safe_mode off	
	</IfModule>
</Directory>
</VirtualHost>
/etc/apache2/mods-available/userdir.conf:

Code: Alles auswählen

<IfModule mod_userdir.c>
	UserDir software/php
	UserDir disabled root

	<Directory /home/user/>
		AllowOverride All
		Options MultiViews Indexes SymLinksIfOwnerMatch
		<Limit GET POST OPTIONS>
			Order allow,deny
			Allow from all
			Require all granted
		</Limit>
		<LimitExcept GET POST OPTIONS>
			Order deny,allow
			Deny from all
			Require all denied
		</LimitExcept>
	</Directory>		
</IfModule>
index.html:

Code: Alles auswählen

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="description" content="Web">
    <meta charset="utf-8">
    <title>Web</title>
  </head>
  <body>
    <h3>
      <h href="help.html">Help links</h>
    </h3>
  </body>
</html>
netstat -tulpe:

Code: Alles auswählen

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
tcp        0      0 localhost:mysql         0.0.0.0:*               LISTEN      mysql      16244      743/mysqld          
tcp        0      0 localhost:http          0.0.0.0:*               LISTEN      root       94004      19070/apache2       
Warum läuft apache2 als root?

ALU
Beiträge: 29
Registriert: 19.11.2016 20:21:41

Re: Apache2, userdir, index.html: keine Links

Beitrag von ALU » 25.10.2017 06:02:31

In der index.html steht statt <a href> <h href>:

Code: Alles auswählen

      <h href="help.html">Help links</h>
So einfach ist manchmal die Lösung.

Antworten