httpd.conf: ich sehe alles doppelt ?

Post Reply
Message
Author
tuxic trace

httpd.conf: ich sehe alles doppelt ?

#1 Post by tuxic trace »

So - lange drum gedrückt, nun hilft es nichts, ich muß an den alten Indianer ran.

Beim Studium der (standard) httpd.conf fallen mir einige Punkte auf, die das gleiche zu machen scheinen:

Listen 12.34.56.78:80

BindAddress *

Port 80

<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>

Ich hab die Kommentare jetzt wegelassen, aber wo ist der Unterschied zwischen Bindadresss und Listen IP:port sowie der Unterschied zwischen Listen 80 und Port 80 ?

Die directiven stehen alle in der globalen Sektion, also nichts mit Virtual Hosts. Die Liste mit den directiven auf apache.org hat danciht viel mehr Licht reingebracht als die Kommentare in der default httpd.conf

moses

Re: httpd.conf: ich sehe alles doppelt ?

#2 Post by moses »

Hi!
Wenn du mit "#" zeichen posten würdest, wäre das hilfreicher <img src="http://www.pl-forum.de/UltraBoard/Images/Wilk.gif" border="0" align="middle">
Listen xx.yy.zz.ww:port sagt das indianer an explizit an dieser adresse lauschen soll.
BindAddress * sagt dass server an aller moglichen IP's an port 80(default)lauschen soll.
Port bla das Server an dem Port lauschen soll.
<IfDefine SSL ...

>
Falls server mit option SSL gestartet soll der auf 80(http) und 443 (https) lauschen.
Alles klar? Ansonsten RTFM!!!! Da sind alle Variablen gut beschrieben.

CU
moses

tuxic trace

Re: httpd.conf: ich sehe alles doppelt ?

#3 Post by tuxic trace »

Danke, damit hast Du genau mein Problem wiederholt. Du kannst BindAdress auch einen Namen übergeben, macht damit das gleiche wie Listen.
Und "port 80" macht das gleiche wie "listen 80".

Hat sich mein Problem auch mit RTFM nicht geändert, außer, das BindAdress wohl bald obsolet sein wird. Bleibt noch der Unterschied zwischen "port xx" und "listen xx"

moses

Re: httpd.conf: ich sehe alles doppelt ?

#4 Post by moses »

---------------
Bind directive

BindAddress directive
Syntax: BindAddress *|IP-address|domain-name
Default: BindAddress *
Context: server config
Status: core
Compatibility: BindAddress is deprecated and will be eliminated in Apache 2.0.

A Unix® http server can either listen for connections to every IP address of the server machine, or just one IP address of the server machine. If the argument to this directive is *, then the server will listen for connections on every IP address. Otherwise, the server can listen to only a specific IP-address or a fully-qualified Internet domain-name.

For example:
BindAddress 192.168.15.48

Only one BindAddress directive can be used.

This directive is deprecated and will be eliminated in Apache 2.0. Equivalent functionality and more control over the address and ports Apache listens to is available using the Listen directive.

BindAddress can be used as an alternative method for supporting virtual hosts using multiple independent servers, instead of using <VirtualHost> sections.
------------------------
Listen directive
Syntax: Listen [IP-address:]port
Context: server config
Status: core
Compatibility: Listen is only available in Apache 1.1 and later.

The Listen directive instructs Apache to listen to more than one IP address or port; by default it responds to requests on all IP interfaces, but only on the port given by the Port directive.
Listen can be used instead of BindAddress and Port. It tells the server to accept incoming requests on the specified port or address-and-port combination. If the first format is used, with a port number only, the server listens to the given port on all interfaces, instead of the port given by the Port directive. If an IP address is given as well as a port, the server will listen on the given port and interface.

Note that you may still require a Port directive so that URLs that Apache generates that point to your server still work.

Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.

For example, to make the server accept connections on both port 80 and port 8000, use:

Listen 80
Listen 8000

To make the server accept connections on two specified interfaces and port numbers, use

Listen 192.170.2.1:80
Listen 192.170.2.5:8000
-------------------------------------

Port directive
Syntax: Port number
Default: Port 80
Context: server config
Status: core

Number is a number from 0 to 65535; some port numbers (especially below 1024) are reserved for particular protocols. See /etc/services for a list of some defined ports; the standard port for the http protocol is 80.

The Port directive has two behaviors, the first of which is necessary for NCSA backwards compatibility (and which is confusing in the context of Apache).

* In the absence of any Listen or BindAddress directives specifying a port number, a Port directive given in the "main server" (i.e., outside any <VirtualHost> section) sets the network port on which the server listens. If there are any Listen or BindAddress directives specifying :number then Port has no effect on what address the server listens at.
* The Port directive sets the SERVER_PORT environment variable (for CGI and SSI), and is used when the server must generate a URL that refers to itself (for example when creating an external redirect to itself). This behavior is modified by UseCanonicalName.

The primary behavior of Port should be considered to be similar to that of the ServerName directive. The ServerName and Port together specify what you consider to be the canonical address of the server. (See also UseCanonicalName.)

Port 80 is one of Unix's special ports. All ports numbered below 1024 are reserved for system use, i.e., regular (non-root) users cannot make use of them; instead they can only use higher port numbers. To use port 80, you must start the server from the root account. After binding to the port and before accepting requests, Apache will change to a low privileged user as set by the User directive.

If you cannot use port 80, choose any other unused port. Non-root users will have to choose a port number higher than 1023, such as 8000.

SECURITY: if you do start the server as root, be sure not to set User to root. If you run the server as root whilst handling connections, your site may be open to a major security attack.
-----------------------------------

Also. Mit diesen flotten dreiern kannst beliebige configurationen schafen
BindAddress verstehtst beides (ip und fqdn) kann aber nicht mit Portnumber umgehen. FQDN ist sehr wichtig für namebased-virtual-server
Listen kann mit ip und port umgehen aber nicht mit FQDN
Und ports kann nur ... du ahnst schon was <img src="http://www.pl-forum.de/UltraBoard/Images/Wilk.gif" border="0" align="middle">

Ich hoffe ich konnte dir helfen
CU
moses

tuxic trace

Re: httpd.conf: ich sehe alles doppelt ?

#5 Post by tuxic trace »

Danke. Ich denke, ich habs jetzt. Sowohl "port" als auch "bindadress" sind beide veraltet und nur wegen der Rückwärtskompatibilität noch vorhanden. "Port" dient dazu, den port festzulegen für "bindadress", da letzteres das nicht kann. Frage ich mich nur, warum sowohl "port" als auch "bindadress" noch in der default httpd.conf erwähnt werden neben dem "listen" - andere Directriven sind ja auch nicht aufgeführt.

Auf jeden Fall werden werden/sollen beide durch "listen" ersetzt werden. Und "listen" akzeptiert durchaus FQDN.

Post Reply