Router steuert Apache nicht an!!!

Senf

Well-Known Member
Hallo zusammen, ich habe ein Problem mit dem Zugriff auf meinen Apache Server.
Zuerst ein paar Infos.

Ich habe einen Router, hinter dem hängt der Server mit dem Apache Server und an dem Server hängt ein kleines Netzwerk.
Also etwa so:


Router-----(Netzwerkkate1)Server(Netzwerkkarte2)----Netzwerk

Von meinem Netzwerk aus funktioniert der Apache Server. Ich kann auch die Seiten betrachten wenn ich bewusst die Netzwerkkarte1 ansteuere. Nur wenn ich versuche von Aussen über den Router zu kommen funktioniert nichts. Obwohl ich im SUA – Menu des Routers eingestellt habe, dass er alles auf die Netzwerkkarte1 umleiten soll.
Meiner Meinung nach liegt es am Router. Was mein ihr??? Hat einer eine Idee?
Surfen kann ich z.B. auch aus dem Netzwerk via Server. Nur von ausen rein komm ich irgendwie nicht.

Denke schon mal im Voraus
Senf
 
Vielleicht horcht Apache nur auf einem Interface. netstat -a gibt da mehr Auskunft.

Zu Diagnosezwecken kannst Du aber auch mal kurz mit Deinem Netz auf die andere Netzwerkkarte.
 
Morgen morgen ...

Den Port 80 habe ich gemapt.
Aber ob er auf beiden interfaces hört, da bin ich mir nicht so sicher. Den netstat –a gibt folgendes aus:

Tcp4 0 0 *.http *.* Listen
Tcp4 0 0 *.ssh *.* Listen
Tcp46 0 0 *.ssh *.* Listen

Kann es sein, dass ssh auf 3 interface horcht und apache nur auf eines? Das könnte auch erklären warum ich mich nicht mehr über ssh zum server verbinden kann.
 
Okey hier ist sie:



PidFile /var/run/httpd.pid


ScoreBoardFile /var/run/httpd.scoreboard


Timeout 300


KeepAlive On


MaxKeepAliveRequests 100


KeepAliveTimeout 15


MinSpareServers 5
MaxSpareServers 10


StartServers 5


MaxClients 150


MaxRequestsPerChild 0


LoadModule mmap_static_module libexec/apache/mod_mmap_static.so
LoadModule vhost_alias_module libexec/apache/mod_vhost_alias.so
LoadModule env_module libexec/apache/mod_env.so
LoadModule config_log_module libexec/apache/mod_log_config.so
LoadModule mime_magic_module libexec/apache/mod_mime_magic.so
LoadModule mime_module libexec/apache/mod_mime.so
LoadModule negotiation_module libexec/apache/mod_negotiation.so
LoadModule status_module libexec/apache/mod_status.so
LoadModule info_module libexec/apache/mod_info.so
LoadModule includes_module libexec/apache/mod_include.so
LoadModule autoindex_module libexec/apache/mod_autoindex.so
LoadModule dir_module libexec/apache/mod_dir.so
LoadModule cgi_module libexec/apache/mod_cgi.so
LoadModule asis_module libexec/apache/mod_asis.so
LoadModule imap_module libexec/apache/mod_imap.so
LoadModule action_module libexec/apache/mod_actions.so
LoadModule speling_module libexec/apache/mod_speling.so
LoadModule userdir_module libexec/apache/mod_userdir.so
LoadModule alias_module libexec/apache/mod_alias.so
LoadModule rewrite_module libexec/apache/mod_rewrite.so
LoadModule access_module libexec/apache/mod_access.so
LoadModule auth_module libexec/apache/mod_auth.so
LoadModule anon_auth_module libexec/apache/mod_auth_anon.so
LoadModule db_auth_module libexec/apache/mod_auth_db.so
LoadModule digest_module libexec/apache/mod_digest.so
LoadModule proxy_module libexec/apache/libproxy.so
LoadModule cern_meta_module libexec/apache/mod_cern_meta.so
LoadModule expires_module libexec/apache/mod_expires.so
LoadModule headers_module libexec/apache/mod_headers.so
LoadModule usertrack_module libexec/apache/mod_usertrack.so
LoadModule unique_id_module libexec/apache/mod_unique_id.so
LoadModule setenvif_module libexec/apache/mod_setenvif.so


ClearModuleList
AddModule mod_mmap_static.c
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_digest.c
AddModule mod_proxy.c
AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c


Port 80


User www
Group www


DocumentRoot "/usr/local/www/data"


<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


<Directory "/usr/local/www/data">


Options Indexes FollowSymLinks MultiViews


AllowOverride None


Order allow,deny
Allow from all
</Directory>


<IfModule mod_userdir.c>
UserDir public_html
</IfModule>


<IfModule mod_dir.c>
<IfModule mod_php3.c>
<IfModule mod_php4.c>
DirectoryIndex index.php index.php3 index.html
</IfModule>
<IfModule !mod_php4.c>
DirectoryIndex index.php3 index.html
</IfModule>
</IfModule>
<IfModule !mod_php3.c>
<IfModule mod_php4.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule !mod_php4.c>
DirectoryIndex index.html
</IfModule>
</IfModule>
</IfModule>


AccessFileName .htaccess


<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>


UseCanonicalName On


<IfModule mod_mime.c>
TypesConfig /usr/local/etc/apache/mime.types
</IfModule>


DefaultType text/plain


<IfModule mod_mime_magic.c>
MIMEMagicFile /usr/local/etc/apache/magic
</IfModule>


HostnameLookups Off


ErrorLog /var/log/httpd-error.log


LogLevel warn


LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


CustomLog /var/log/httpd-access.log combined


ServerSignature On


<IfModule mod_alias.c>


Alias /icons/ "/usr/local/www/icons/"

<Directory "/usr/local/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


Alias /manual/ "/usr/local/share/doc/apache/"

<Directory "/usr/local/share/doc/apache">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"


<Directory "/usr/local/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

</IfModule>

<IfModule mod_autoindex.c>


IndexOptions FancyIndexing

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README
HeaderName HEADER

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>

<IfModule mod_mime.c>


AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage he .he
AddCharset ISO-8859-8 .iso8859-8
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage kr .kr
AddCharset ISO-2022-KR .iso-kr
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cs .cz .cs
AddLanguage ru .ru
AddLanguage zh-TW .zh-tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8

<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>

<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .php3s
</IfModule>
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz

#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
#AddType application/x-compress .Z
#AddType application/x-gzip .gz .tgz

#
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
#AddHandler cgi-script .cgi

#
# To use server-parsed HTML files
#
#AddType text/html .shtml
#AddHandler server-parsed .shtml

#
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#
#AddHandler send-as-is asis

#
# If you wish to use server-parsed imagemap files, use
#
#AddHandler imap-file map

#
# To enable type maps, you might want to use
#
#AddHandler type-map var

</IfModule>
# End of document types.

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

#
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#
#MetaDir .web

#
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#
#MetaSuffix .meta

#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the single leading (") marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# N.B.: You can redirect to a script or a document using server-side-includes.
#
# 3) external redirects
#ErrorDocument 402 http://some.other-server.com/subscription_info.html
# N.B.: Many of the environment variables associated with the original
# request will *not* be available to such a script.

#
# Customize behaviour based on the browser
#
<IfModule mod_setenvif.c>

#
# The following directives modify normal HTTP response behavior.
# The first directive disables keepalive for Netscape 2.x and browsers that
# spoof it. There are known problems with these browser implementations.
# The second directive is for Microsoft Internet Explorer 4.0b2
# which has a broken HTTP/1.1 implementation and does not properly
# support keepalive when it is used on 301 or 302 (redirect) responses.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

#
# The following directive disables HTTP/1.1 responses to browsers which
# are in violation of the HTTP/1.0 spec by not being able to grok a
# basic 1.1 response.
#
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

</IfModule>
# End of browser customization directives

#
# Allow server status reports, with the URL of http://servername/server-status
# Change
 
Ich habe nun dem httpd.conf file noch 2 listen zeilen hinzugefügt. Nun horcht er auf beide netzwerkkarten. Doch leider kommt man von aussen immer noch nicht auf den Server
 
So, ich habe mich nun einmal mit einem Switch vor meinen Server gehängt und versuchte auf ihn zuzugreifen. Doch von da aus kann ich ihn nicht mal pingen.
Zudem habe ich noch etwas seltsames festgestellt.
Wenn ich den Router vom Server trenne, kann ich auch nicht mehr von meinem Netzwerk per ssh auf den Server zugreifen. Apache vom Netzwerk aus funktioniert noch.
(die firewall lies immer alles zu)

Weis einer was das zu bedeuten hat?
 
Senf schrieb:
Morgen morgen ...

Den Port 80 habe ich gemapt.
Aber ob er auf beiden interfaces hört, da bin ich mir nicht so sicher. Den netstat –a gibt folgendes aus:

Tcp4 0 0 *.http *.* Listen
Tcp4 0 0 *.ssh *.* Listen
Tcp46 0 0 *.ssh *.* Listen

Kann es sein, dass ssh auf 3 interface horcht und apache nur auf eines? Das könnte auch erklären warum ich mich nicht mehr über ssh zum server verbinden kann.

*.http ... bedeutet, das der Indianer auf alle konfigurierten IPs horcht.

Das du ohne Router von deinem Netzwerk nicht auf den sshd zugreifen kannst, deutet für mich auf eine ganz schräge Netzwerkkonfiguration hin. Warum das aber beim Apachen funktioniert? Ich würde nochmal penibel die Konfiguration durchgehen, also IP-Adressen, Netzmasken, Routen, Firewall ganz deaktivieren.

Viel Erfolg.

Gruß c.
 
Also auf dem Router ist eine Statische route definiert.
Die den Weg zum Netzwerk beschreibt, also Netzwerkkarte1 als Gateway für alle Packete die zur Netzwerkarte2 weitergeleitet werden müssen.
Ich glaube nun, das egal was ich mache, alles zuerst an den Router geschickt wird. Also das mein Server überhabt nichts routet.
Meinst du ich sollte auf dem Server noch Statische Routen hinzufügen, damit auch er weis was wo ist?
Netstat –r sagt lediglich, das der deflautrouter der Router ist.

Apropo ist es normal das netstat fünf minunten oder so braucht bis es überhaupt etwas augibt??
 
Also bin jetzt alles noch mal durchgegangen. Von aussen kommt man jetzt definitiv auf den Server z.B. mit SSH. Apache sollte nun auch auf zwei interfaces horchen, was auch netstat –a bestätigt. Beim start gibt er nun eine Fehlermeldung aus, ich denke wenn ich diese beheben könnte würde es sicher funktionieren.
Die Meldung ist:

Could not determine the server's fully qualified domain name, using 192.168.2.1 for ServerName

Die in der Fehlermeldung genannte IP ist die, der Netzwerkkarte2.
Wäre es also möglich, das er auch nur auf dieser Karte horcht ?
Und wenn ja, was muss ich als Servername eintragen damit es funktioniert.

Hoffe jemand von euch kennt dieses Problem.
Gruss Senf
 
Senf schrieb:
Also auf dem Router ist eine Statische route definiert.
Die den Weg zum Netzwerk beschreibt, also Netzwerkkarte1 als Gateway für alle Packete die zur Netzwerkarte2 weitergeleitet werden müssen.
Ich glaube nun, das egal was ich mache, alles zuerst an den Router geschickt wird. Also das mein Server überhabt nichts routet.
Meinst du ich sollte auf dem Server noch Statische Routen hinzufügen, damit auch er weis was wo ist?
Netstat –r sagt lediglich, das der deflautrouter der Router ist.

Apropo ist es normal das netstat fünf minunten oder so braucht bis es überhaupt etwas augibt??
Hi,

ich würde folgende Konfig machen:
Die Rechner im Netzwerk bekommen die IP-Adresse der Netzwerkkarte (NIC) 2 vom Server als defaultrouter.
Der Server bekommt die interne IP-Adresse des Routers als defaultrouter.
Der Server muss routen können.
Auf dem Router solltest du ein portforwarding für Port 80 einrichten, also alles was von aussen an Port 80 der öffentl. IP-Adr. des Routers ankommt, an Server-IP (von NIC1) Port 80 forwarden.
Auf dem Router muss eine stat. Route zum 'Netzwerk' gelegt werden, mit der IP-Adresse (von NIC1) des Servers.

Dir ist aber auch klar, das du dir durch die von dir beschriebene Konfiguration einen sogenannten 'Exposed Hosts' ins Netzwerk stellst. Wenn jemand das Ding hackt, hast du den bei dir im Netzwerk.

Gruß c.
 
du meinst wen jemand den Server hackt?? Ja das ist mir schon klar, doch der fungiert auch als firewall. Ohne ihn wäre mein Netz schlechter geschützt als mit ihm. Zudem ist davor ja auch noch der router der nicht alle ports weiterleitet. Der Server hat natürlich auch nur die Ports offen die gebraucht werden.

Mein Netzwerk ist so konfiguriert wie dus gesagt hast. Ich glaube es liegt am Servername.
 
Zuletzt bearbeitet:
Kann es sein, das man aus dem Internet nicht auf meinen Apache kommt weil ich kein DNS eintrag habe?? weis einer da was genaueres?
 
Yeees :-) es funkt!!! Lag tatsächlich am Router. der hat vorkonfigurierte regeln, unter anderem den port 80 zu dropen.

Nur noch eine kleine Frage. Ist es normal, dass ich vom LAN nicht über meine offizielle IP auf den Apache zugreifen kann, sondern nur über die LAN Adressen?
Die offizielle IP funkt nur von aussen.
 
Zuletzt bearbeitet:
Senf schrieb:
Yeees :-) es funkt!!! Lag tatsächlich am Router. der hat vorkonfigurierte regeln, unter anderem den port 80 zu dropen.

Nur noch eine kleine Frage. Ist es normal, dass ich vom LAN nicht über meine offizielle IP auf den Apache zugreifen kann, sondern nur über die LAN Adressen?
Die offizielle IP funkt nur von aussen.

Das kann ich dir garnicht beantworten, das habe ich noch nie ausprobiert. Ich finde es auch nicht so sehr sinnvoll, da ja so die Requests durch den Server zum Router und von diesem zum Server gehen würden. Die Antworten würden entsprechend den Rückweg nehmen.

Gruß c.
 
Zurück
Oben