Apache2 www-Verzeichnis?

Apache, Lighttpd, nginx, Cherokee
Post Reply
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Apache2 www-Verzeichnis?

Post by maik »

Hallo,

ich habe mir gerade zu Hause den Apache2 installiert und wollte damit mal ein paar Sachen testen. Allerdings finde ich das www Verzeichnis nicht wo ich die html / php Dateien reinlegen kann.

Wo steht denn in welcher Conf wo sich das befindet?
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote: Wo steht denn in welcher Conf wo sich das befindet?
In der httpd.conf nach "DocumentRoot" suchen, in der Regel macht das der Befehl:

Code: Select all

find /etc -name "httpd.conf" -exec grep -Hni "documentroot" {} ; 
Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Danke leider gibt es keinen Treffer.

BUFFALO:/# find /etc -name "httpd.conf" -exec grep -Hni "documentroot" {} ;
BUFFALO:/#

Im /etc Verzeichnis habe ich auch keine httpd.conf, wo könnte diese liegen?
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote:Danke leider gibt es keinen Treffer.

BUFFALO:/# find /etc -name "httpd.conf" -exec grep -Hni "documentroot" {} ;
BUFFALO:/#

Im /etc Verzeichnis habe ich auch keine httpd.conf, wo könnte diese liegen?
Bei mir liegt sie auf zwei Rechnern unter "/usr/local/etc", auf einem in "/usr/local/apache20"... Aber das ist nicht linuxtypisch.

Such doch zunächst mal in "/". Dauert halt einen Moment:

Code: Select all

find / -name "httpd.conf" -print
Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Also ich habe eine httpd.conf in
etc/apache2/

die sieht so aus:

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

und ich habe auch hier noch welche:

/usr/share/apache/default-configs/apache-perl/httpd.conf
/usr/share/apache/default-configs/apache/httpd.conf
/usr/share/apache/default-configs/apache-ssl/httpd.conf
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

[quote="Maik"]Also ich habe eine httpd.conf in
etc/apache2/

die sieht so aus:

# This is here for backwards compatability reasons and to support
# installing 3rd party modules directly via apxs2, rather than
# through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so


Dann greppe mal!

Code: Select all

grep -Hni "documentroot" /etc/apache2/httpd.conf
Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Hallo Matthias,

ich glaube wir reden aneinader vorbei.
Das was ich dir oben gepostet habe ist die gesamte httpd.conf
Mehr steht dort nicht drin. Oder hat die installation nicht richtig geklappt?

Ich habe bei der Installation von Debian auch WebServer ausgewählt und der webmin läuft ohne probleme, daher dachte ich der apache2 ist installiert oder nicht?
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote:Hallo Matthias,
Ohne "h" bitte.
ich glaube wir reden aneinader vorbei.
Das was ich dir oben gepostet habe ist die gesamte httpd.conf
Mehr steht dort nicht drin. Oder hat die installation nicht richtig geklappt?

Ich habe bei der Installation von Debian auch WebServer ausgewählt und der webmin läuft ohne probleme, daher dachte ich der apache2 ist installiert oder nicht?
Webmin bringt seinen eigenen Webserver mit. Du hast Debian? Dann solltest Du zuerst mal schauen, welcher Apache installiert ist:

Code: Select all

dpkg -l | grep -i apache
Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

BUFFALO:/# dpkg -l | grep -i apache
ii apache-common 1.3.34-1 support files for all Apache webservers
ii apache2 2.0.54-5 next generation, scalable, extendable web se
ii apache2-common 2.0.54-5 next generation, scalable, extendable web se
ii apache2-doc 2.0.54-5 documentation for apache2
ii apache2-mpm-prefork 2.0.54-5 traditional model for Apache2
ii apache2-utils 2.0.54-5 utility programs for webservers
ii libapache-mod-auth-mysql 4.3.9-2 Apache module for MySQL authentication
ii libapache2-mod-perl2 2.0.1-4 Integration of perl with the Apache2 web ser
ii libapache2-mod-php4 4.4.0-4 server-side, HTML-embedded scripting languag
ii libapache2-mod-python 3.1.3-3 An Apache module that embeds Python within t
ii libapache2-mod-python2.3 3.1.3-3 An Apache 2 module that embeds Python 2.3 wi
ii libapr0 2.0.54-5 the Apache Portable Runtime
ii webmin-apache 1.200-1 apache control module for webmin
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote:BUFFALO:/# dpkg -l | grep -i apache
ii apache-common 1.3.34-1 support files for all Apache webservers
ii apache2 2.0.54-5 next generation, scalable, extendable web se
ii apache2-common 2.0.54-5 next generation, scalable, extendable web se
ii apache2-doc 2.0.54-5 documentation for apache2
ii apache2-mpm-prefork 2.0.54-5 traditional model for Apache2
ii apache2-utils 2.0.54-5 utility programs for webservers
ii libapache-mod-auth-mysql 4.3.9-2 Apache module for MySQL authentication
ii libapache2-mod-perl2 2.0.1-4 Integration of perl with the Apache2 web ser
ii libapache2-mod-php4 4.4.0-4 server-side, HTML-embedded scripting languag
ii libapache2-mod-python 3.1.3-3 An Apache module that embeds Python within t
ii libapache2-mod-python2.3 3.1.3-3 An Apache 2 module that embeds Python 2.3 wi
ii libapr0 2.0.54-5 the Apache Portable Runtime
ii webmin-apache 1.200-1 apache control module for webmin



Nochmal auf das eigentliche Problem: Debian legt die htdocs normalerweise nach "/var/www", aber welche Konfigurationsdatei verwendet Debians Standard-Konfiguration Apache2? Kein Plan (ich schau später mal), ich arbeite selbst erst seit kurzem mit Linux...

Nachtrag:

Nicht-Linuxer sind nicht immer doof, nur langsam. Ich hab's gefunden:

Code: Select all

find /etc/apache2 -type f -exec grep -Hni documentroot {} ; 
liefert das DocumentRoot-Verzeichnis und die Konfigurationsdatei...

Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Danke das www Verzeichnis liegt in /var/www wenn ich dort jedoch eine index.html hineinlege wird diese nicht angezeigt.

Rufe ich im Browser 192.168.1.88 auf kommt:

"Seite kann nicht angezeigt werden"
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote:Danke das www Verzeichnis liegt in /var/www wenn ich dort jedoch eine index.html hineinlege wird diese nicht angezeigt.

Rufe ich im Browser 192.168.1.88 auf kommt:

"Seite kann nicht angezeigt werden"

Code: Select all

lsof -i :80
Evtl. vorher "lsof" installieren. Wird nix angezeigt, kann es sein, dass der Apache einfach nicht läuft. Softlink in "/etc/rcX.d" vorhanden (X steht für Dein Standard-Runlevel)? Die "/etc/default/apache2" stimmt auch?

Anschließend mit "/etc/init.d/apache2 start" das Ding mal starten.

Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

NARF ;-)

die Kiste war tatsächlich nicht am laufen.

Danke für die Hilfe
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Jetzt habe ich nur noch eine Frage:

wenn ich 192.168.1.88 aufrufe leitet er auf:

192.168.1.88/apache2-default/ weiter obwohl eine index.html in 192.168.1.88 ist wie kann ich das ändern?
mattiass
Userprojekt
Userprojekt
Posts: 608
Joined: 2005-12-16 17:57
 

Re: Apache2 www-Verzeichnis?

Post by mattiass »

Maik wrote:Jetzt habe ich nur noch eine Frage:

wenn ich 192.168.1.88 aufrufe leitet er auf:

192.168.1.88/apache2-default/ weiter obwohl eine index.html in 192.168.1.88 ist wie kann ich das ändern?
So wie ich das beim Ã?berfliegen feststelle, musst Du in

/etc/apache2/sites-enabled/000-default

die Zeile "RedirectMatch" auskommentieren. Sinnvoller dürfte es aber sein (je nachdem, wieviele virtuelle Hosts du pflegst), die Datei

/etc/apache2/sites-enabled/000-default

nach

/etc/apache2/sites-enabled/192.168.1.88

zu kopieren und dort anzupassen. Wie gesagt: ich bin mit Debian's Default-Konfiguration überhaupt nicht vertraut...

Viele Grüße,
Mattias
maik
Posts: 82
Joined: 2003-04-14 19:31
 

Re: Apache2 www-Verzeichnis?

Post by maik »

Vielen Dank,

das reicht mir schon ich habe die Zeile auskommentiert jetzt gehts. Ich habe die Kiste nur aus Testzwecken aufgesetzt ist ganz witzig ein kleiner Debian WebServer auf einer Buffalo Linkstation mit 250GB.

Schöne Grüße

Maik
Post Reply