Standartverzeichnis ist in httpd.conf
DocumentRoot:
Der Server benutzt nur Dateien und unterverzeichnisse im dem Angebenden Verzeichniss in DocumentRoot in der httpd.conf
Falls keine Index.htm oder andere startdatei vorhanden ist wird der path gelistet angezeigt.
Das ist schrecklich blöd , da man seine Dateien im Homeverzeichniss hat und nicht im Rootverzeichniss ohne zugriffsrechte.
Xampp: DocumentRoot "/opt/lampp/htdocs"
apache2 allein install path ist:DocumentRoot "/var/www/html"
Die folgenden beispiele beziehen sich auf einer xampp Installation.
DocumentRoot finden unter debian /Lunbuntu :
grep -i 'DocumentRoot' /etc/apache2/sites-available/000-default.conf
grep -i 'DocumentRoot' /etc/apache2/sites-available/default-ssl.conf
Es gibt 2 Möglichkeiten das Homeverzeichniss einzubinden.
1.) man erstellt eine Verkünfung "symbollink" zum DocumentRoot
Bespiel bei xampp Installation : sudo ln -s /home/ /opt/lampp/htdocs/
Dann muss man noch unter
Options FollowSymLinks
die Options FollowSymLinks eintragen sonst irgnoriert apache das .
2.) man benutzt die Alias funktion
direkt unter der section DocumentRoot steht bereits eine Directory anweisung , die sich auf das verzeichnis
/opt/lampp/htdocs/ bezieht.
Darunter nach
Das eintragen:
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
dann weiter Alias suchen
und Alias /home /home/benutzer/Homepage/
einfügen
*Benutzer mit ihrem kontonamen ersetzen!
Dann apache2 neu starten mit :
sudo /opt/lampp/lampp stop
sudo /opt/lampp/lampp start
Aufruf mit sudo leafpad /opt/lampp/etc/httpd.conf
Auszug aus meiner httpd.conf bei xampp installation:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/opt/lampp/htdocs"
# DocumentRoot "/home/ronny/Homepage"
#
Options FollowSymLinks
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/trunk/mod/core.html#options
# for more information.
#
#Options Indexes FollowSymLinks
# XAMPP
Options Indexes FollowSymLinks ExecCGI Includes
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
#AllowOverride None
# since XAMPP 1.4:
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
###########ALIAS:#########################
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a section to allow access to
# the filesystem path.
# Alias "/ xampp" "/ opt / lampp / htdocs"
# Alias /xampp /opt/lampp
# Alias /home /home/ronny
Alias /home /home/ronny/Homepage/
link:https://wiki.archlinux.org/index.php/XAMPP
testen:
netstat -a -n