zockervogel
Goto Top

Debian Webmin - Domains anlegen

Hallo,
ich habe per Webmin 3 Domains auf meinem VServer angelegt.

Bei meinem Provider habe ich die Domains auf den Server umgeleitet.

Wenn ich nun die Domains aufrufe, wird immer nur eine Domain geladen.

Ich habe schon Dr. Google. gefragt aber den Fehler nicht gefunden.

Hat jemand eine spontane Idee was ich falsch gemacht haben kann face-smile

Bzw. welche Angaben werden noch benötigt, damit mir jemand helfen kann ?

Mit freundlichen Grüßen
Peter

Content-Key: 264929

Url: https://administrator.de/contentid/264929

Ausgedruckt am: 29.03.2024 um 14:03 Uhr

Mitglied: broecker
broecker 01.03.2015 um 05:53:36 Uhr
Goto Top
Moin,
Wenn ich nun die Domains aufrufe, wird immer nur eine Domain geladen.
da müßte ich Glaskugeln, was Du meinst:
es kommt immer die gleiche IP bei einem ping- nslookup- oder dig-Aufruf zurück?
was sagt der Server selbst?: dig meinedomain @6649
sind die lokalen Einträge aktiv?
A, AAAA, CN, NS, MX?
HG
Mark
Mitglied: StefanKittel
StefanKittel 01.03.2015 um 09:23:35 Uhr
Goto Top
Moin,

Mal ein paar Denkanstöße:
- 3 Domains
- 1 IP des Servers
- Alle 3 Domains zeigen im A-Record auf die gleiche IP (oder AAA für ipv6)
- Die Domains haben im Webmin alle verschiedene Verzeichnisse und sind nicht als Weiterleitung konfiguriert
- Alle 3 Verzeichniss haben einen unterschiedlichen Inhalt.

So sollte das kein Problem sein.

Stefan
Mitglied: Lochkartenstanzer
Lochkartenstanzer 01.03.2015 um 09:43:17 Uhr
Goto Top
Zitat von @Zockervogel:

Wenn ich nun die Domains aufrufe, wird immer nur eine Domain geladen.

Welches protokoll? Was rufts Du auf? Meine weihnachtskugel, die hier noch rumfährt sagt, Du willst drei verschiedene Webserver laufen haben. Dann mußt Du die auch n apache o.ä. als virtuellen Serevr anlegen und mit daten befüllen. Sofern Du nur die Defaults nimst, shen alle drei Webseiten gleich aus, weil die ja noch die dummy-Einträge haben.

lks
Mitglied: fognet
fognet 01.03.2015 um 10:13:21 Uhr
Goto Top
Hast du die VHosts angelegt? Bin Ich soweit richtig?

LG PPR
Mitglied: Zockervogel
Zockervogel 01.03.2015 um 13:19:53 Uhr
Goto Top
erstmal danke für eure Antworten.

...und danke, dass ihr nicht zu hart mit mir gewesen seid face-smile

Mir ist klar, dass man da nur spekulieren kann.

Ich bin in dem Bereich relativ neu. Ein guter Bekannter hat mir den VServer sicher gemacht und per Hand eine Domain
eingerichtet. Dann hat ein Zweiter noch die anderen beiden Domains per Hand angelegt und mir auch zu Webmin geraten.
Da der Server (wohl) sicher ist, will ich den auch nicht einfach nochmals von grundauf neu machen.

Anfangs habe ich zwei Domains mit der gleichen Weiterleitung des A-Record aufrufen können. Die dritte hat immer auf die
ersteingerichtete Seite gezeigt.

Vorher war im Verzeichnis /etc/apache2/sites-available eine Datei default-000.conf (oder so ähnlich). Hier waren wohl alle 3 Domains eingetragen.
Beim Start des Apache wurde allerdings ein Fehler gefunden und dieser nicht gestartet.

Ich habe dann alle 3 Domains einfach mit Winmin entfernt und exakt so neu angelegt.

danach gibt es für alle Domains eine .conf und eine default.conf.

Ohne überhaupt Ahnung zu haben was anfangs gemacht wurde denke ich, dass in irgendeiner .conf noch etwas manuell eingetragen wurde
was vermutlich kein "Standard" ist.

Ich habe mich gestern Stunden damit beschäftigt und sehr viel gelesen, da ich da auch lernen möchte.

Da das umswitchen der IP per A-Record ja schonmal funktioniert hat denke ich, dass der Fehler mit Sicherheit nicht am Routing sondern
an der Config der VServers liegt. Meine 2 von meinen 3 Domains laufen auf meinem Root-Server im Moment so ohne Probleme weiter.

Auch wenn ich bisher die Glaskugel immer noch in meinem Safe habe und euch nicht zurückgegeben habe wäre es toll, nochmals ein paar
Gedanken hier zu schreiben. Klar weiß ich, dass man nur spekulieren kann.

mfg
Peter
Mitglied: Zockervogel
Zockervogel 01.03.2015 um 14:39:27 Uhr
Goto Top
auch wenn ich nochmals weiter dumm Frage.

In meine apache2.conf steht/stand ganz unten am Schluss:

  1. Include the virtual host configurations:
Include sites-enabled/

ich gehe davon aus, dass da noch etwas fehlt.
Mittlerweile habe ich noch folgendes hinzugefügt

NameVirtualHost *
NameVirtualHost domain-name-1.de
NameVirtualHost domain-name-2.de
NameVirtualHost domain-name-3.de

habe ich die Lösung jetzt selbst gefunden ? Ich habe eine der beiden Domains umgeroutet, dauert aber noch bis ich das Ergebnis sehe face-smile

mfg
Peter
Mitglied: fognet
fognet 01.03.2015 um 14:53:41 Uhr
Goto Top
Du solltest mit a2ensite die Konfigurationen Aktivieren.. Ich kann dir leider nicht sagen ob Webmin das automatisch macht.

LG PPR
Mitglied: Zockervogel
Zockervogel 01.03.2015 um 15:09:40 Uhr
Goto Top
oho...
wenn ich das machen will kommt:


ERROR: Site domain-Name1.de does not exist!

Anscheinend fehlt an entscheidender Stelle noch etwas. Jetzt bin ich sprachlos !

mfg
Peter
Mitglied: broecker
Lösung broecker 01.03.2015, aktualisiert am 05.03.2015 um 21:12:33 Uhr
Goto Top
die Zeile mit * ist eher zuviel - sollte wenn dann die letzte der enableten Sites sein (höchste Nummer bzw. Alphabeth),

Beginn einer funktionsfähigen Virtualhost für http (80):

<Directory /var/www/example.de>
AllowOverride None
Require all denied
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/clients/clientN/webMM/web

ServerName test.example.de
ServerAlias www.example.de
ServerAlias www.example.de
ServerAdmin webmaster@example.de
...

sonst stell'
doch 'mal Deine apache2.conf, ports.conf und eine vhost.conf rein...
HG
Mark
Mitglied: Zockervogel
Zockervogel 01.03.2015 um 19:16:03 Uhr
Goto Top
Hi,
so, ich habe jetzt viel gemacht aber weiterhin nichts erreicht.

Hiermal meine .conf Dateien:

apache2.conf:

  1. This is the main Apache server configuration file. It contains the
  2. configuration directives that give the server its instructions.
  3. See http://httpd.apache.org/docs/2.2/ for detailed information about
  4. the directives and /usr/share/doc/apache2-common/README.Debian.gz about
  5. Debian specific hints.
#
#
  1. Summary of how the Apache 2 configuration works in Debian:
  2. The Apache 2 web server configuration in Debian is quite different to
  3. upstream's suggested way to configure the web server. This is because Debian's
  4. default Apache2 installation attempts to make adding and removing modules,
  5. virtual hosts, and extra configuration directives as flexible as possible, in
  6. order to make automating the changes and administering the server as easy as
  7. possible.

  1. It is split into several files forming the configuration hierarchy outlined
  2. below, all located in the /etc/apache2/ directory:
#
  • `-- sites-enabled
  • #
    #
    1. * apache2.conf is the main configuration file (this file). It puts the pieces
    2. together by including all remaining configuration files when starting up the
    3. web server.
    #
    1. In order to avoid conflicts with backup files, the Include directive is
    2. adapted to ignore files that:
    3. - do not begin with a letter or number
    4. - contain a character that is neither letter nor number nor _-:.
    5. - contain .dpkg
    #
    1. Yet we strongly suggest that all configuration files either end with a
    2. .conf or .load suffix in the file name. The next Debian release will
    3. ignore files not ending with .conf (or .load for mods-enabled).
    #
    1. * ports.conf is always included from the main configuration file. It is
    2. supposed to determine listening ports for incoming connections, and which
    3. of these ports are used for name based virtual hosts.
    #
    1. * Configuration files in the mods-enabled/ and sites-enabled/ directories
    2. contain particular configuration snippets which manage modules or virtual
    3. host configurations, respectively.
    #
    1. They are activated by symlinking available configuration files from their
    2. respective *-available/ counterparts. These should be managed by using our
    3. helpers a2enmod/a2dismod, a2ensite/a2dissite. See
    4. their respective man pages for detailed information.
    #
    1. * Configuration files in the conf.d directory are either provided by other
    2. packages or may be added by the local administrator. Local additions
    3. should start with local- or end with .local.conf to avoid name clashes. All
    4. files in conf.d are considered (excluding the exceptions noted above) by
    5. the Apache 2 web server.
    #
    1. * The binary is called apache2. Due to the use of environment variables, in
    2. the default configuration, apache2 needs to be started/stopped with
    3. /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
    4. work with the default configuration.


    1. Global configuration
    #

    #
    1. ServerRoot: The top of the directory tree under which the server's
    2. configuration, error, and log files are kept.
    #
    1. NOTE! If you intend to place this on an NFS (or otherwise network)
    2. mounted filesystem then please read the LockFile documentation (available
    3. at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
    4. you will save yourself a lot of trouble.
    #
    1. Do NOT add a slash at the end of the directory path.
    #
    #ServerRoot "/etc/apache2"

    #
    1. The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
    #
    LockFile ${APACHE_LOCK_DIR}/accept.lock

    #
    1. PidFile: The file in which the server should record its process
    2. identification number when it starts.
    3. This needs to be set in /etc/apache2/envvars
    #
    PidFile ${APACHE_PID_FILE}

    #
    1. Timeout: The number of seconds before receives and sends time out.
    #
    TimeOut 300

    #
    1. KeepAlive: Whether or not to allow persistent connections (more than
    2. one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive on

    #
    1. MaxKeepAliveRequests: The maximum number of requests to allow
    2. during a persistent connection. Set to 0 to allow an unlimited amount.
    3. We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 100

    #
    1. KeepAliveTimeout: Number of seconds to wait for the next request from the
    2. same client on the same connection.
    #
    KeepAliveTimeout 5

    ##
    ## Server-Pool Size Regulation (MPM specific)
    ##

    1. prefork MPM
    2. StartServers: number of server processes to start
    3. MinSpareServers: minimum number of server processes which are kept spare
    4. MaxSpareServers: maximum number of server processes which are kept spare
    5. MaxClients: maximum number of server processes allowed to start
    6. MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>

    1. worker MPM
    2. StartServers: initial number of server processes to start
    3. MinSpareThreads: minimum number of worker threads which are kept spare
    4. MaxSpareThreads: maximum number of worker threads which are kept spare
    5. ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
    6. graceful restart. ThreadLimit can only be changed by stopping
    7. and starting Apache.
    8. ThreadsPerChild: constant number of worker threads in each server process
    9. MaxClients: maximum number of simultaneous client connections
    10. MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
    StartServers 2
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadLimit 64
    ThreadsPerChild 25
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>

    1. event MPM
    2. StartServers: initial number of server processes to start
    3. MinSpareThreads: minimum number of worker threads which are kept spare
    4. MaxSpareThreads: maximum number of worker threads which are kept spare
    5. ThreadsPerChild: constant number of worker threads in each server process
    6. MaxClients: maximum number of simultaneous client connections
    7. MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_event_module>
    StartServers 2
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadLimit 64
    ThreadsPerChild 25
    MaxClients 150
    MaxRequestsPerChild 0
    </IfModule>

    1. These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}

    #
    1. AccessFileName: The name of the file to look for in each directory
    2. for additional configuration directives. See also the AllowOverride
    3. directive.
    #

    AccessFileName .htaccess

    #
    1. The following lines prevent .htaccess and .htpasswd files from being
    2. viewed by Web clients.
    #
    <Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
    </Files>

    #
    1. DefaultType is the default MIME type the server will use for a document
    2. if it cannot otherwise determine one, such as from filename extensions.
    3. If your server contains mostly text or HTML documents, "text/plain" is
    4. a good value. If most of your content is binary, such as applications
    5. or images, you may want to use "application/octet-stream" instead to
    6. keep browsers from trying to display binary files as though they are
    7. text.
    #
    1. It is also possible to omit any default MIME type and let the
    2. client's browser guess an appropriate action instead. Typically the
    3. browser will decide based on the file's extension then. In cases
    4. where no good assumption can be made, letting the default MIME type
    5. unset is suggested instead of forcing the browser to accept
    6. incorrect metadata.
    #
    DefaultType None


    #
    1. HostnameLookups: Log the names of clients or just their IP addresses
    2. e.g., www.apache.org (on) or 204.62.129.132 (off).
    3. The default is off because it'd be overall better for the net if people
    4. had to knowingly turn this feature on, since enabling it means that
    5. each client request will result in AT LEAST one lookup request to the
    6. nameserver.
    #
    HostnameLookups Off

    1. ErrorLog: The location of the error log file.
    2. If you do not specify an ErrorLog directive within a <VirtualHost>
    3. container, error messages relating to that virtual host will be
    4. logged here. If you *do* define an error logfile for a <VirtualHost>
    5. container, that host's errors will be logged there and not here.
    #
    ErrorLog ${APACHE_LOG_DIR}/error.log

    #
    1. LogLevel: Control the number of messages logged to the error_log.
    2. Possible values include: debug, info, notice, warn, error, crit,
    3. alert, emerg.
    #
    LogLevel warn

    1. Include module configuration:
    Include mods-enabled/*.load
    Include mods-enabled/*.conf

    1. Include list of ports to listen on and which to use for name based vhosts
    Include ports.conf

    #
    1. The following directives define some format nicknames for use with
    2. a CustomLog directive (see below).
    3. If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
    #
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent

    1. Include of directories ignores editors' and dpkg's backup files,
    2. see the comments above for details.

    1. Include generic snippets of statements
    Include conf.d/

    1. Include the virtual host configurations:
    Include sites-enabled/
    NameVirtualHost domain1.de
    NameVirtualHost domain2.de
    NameVirtualHost domain3.de

    Hier die ports.conf:

    1. If you just change the port or add more ports here, you will likely also
    2. have to change the VirtualHost statement in
    3. /etc/apache2/sites-enabled/000-default
    4. This is also true if you have upgraded from before 2.2.9-3 (i.e. from
    5. Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
    6. README.Debian.gz

    1. NameVirtualHost *:80
    2. Listen *:80

    <IfModule mod_ssl.c>
            1. If you add NameVirtualHost *:443 here, you will also have to change
            2. the VirtualHost statement in /etc/apache2/sites-available/default-ssl
            3. to <VirtualHost *:443>
            4. Server Name Indication for SSL named virtual hosts is currently not
            5. supported by MSIE on Windows XP.
    Listen *:443
    Listen 5.192.xxx.xxx:80
    </IfModule>

    <IfModule mod_gnutls.c>
    Listen 443
    </IfModule>

    domain1.de.conf

    <VirtualHost *:80>
    DocumentRoot "/var/www/domain1.de"
    ServerName domain1.de
    <Directory "/var/www/domain1.de">
    allow from all
    Options None
    </Directory>
    </VirtualHost>


    mfg
    Peter
    Mitglied: broecker
    broecker 01.03.2015 um 19:47:24 Uhr
    Goto Top
    auch wenn die fehlgedeuteten Kommentare viel verkleistern, sieht es m.E. richtig aus,
    A-Records gibt's auf alle drei "Domains" resp. FQDNs? - nicht Weiterleitungen von den Webseiten des ursprünglichen Hosters?
    HG
    Mark
    Mitglied: Zockervogel
    Zockervogel 01.03.2015 um 23:42:44 Uhr
    Goto Top
    ja, es gibt für alle 3 Domains A-Records.

    Kann irgendwo etwas manuell noch eingetragen sein was raus muss ?

    in der ports.conf war unsprünglich auch noch was mit port :80 drinnen was rauszulöschen war.

    Peter
    Mitglied: Zockervogel
    Zockervogel 02.03.2015 um 19:35:11 Uhr
    Goto Top
    Hallo,
    auch wenn alles richtig aussieht, es funktioniert immer noch nicht.

    Hat noch jemand eine Idee was ich ändern muss ?

    Peter
    Mitglied: Zockervogel
    Zockervogel 02.03.2015 um 21:10:12 Uhr
    Goto Top
    ich habe Apache wie folgt neu gestartet.

    Es gibt folgenden Fehler:

    service apache2 reload
    [....] Reloading web server config: apache2[Mon Mar 02 21:05:14 2015] [error] VirtualHost 5.xxx.xx.xx:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    [Mon Mar 02 21:05:14 2015] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Mon Mar 02 21:05:14 2015] [warn] NameVirtualHost domain2.de:0 has no VirtualHosts
    [Mon Mar 02 21:05:14 2015] [warn] NameVirtualHost domain3.de 0 has no VirtualHosts


    Heißt, dass ich wohl irgendwo einen Fehler doch in der Config habe.

    schaut doch bitte nochmals.

    mfg
    Peter
    Mitglied: broecker
    Lösung broecker 03.03.2015, aktualisiert am 05.03.2015 um 21:11:53 Uhr
    Goto Top
    das beschreibt's doch gut:
    000-default.conf o.ä. aus /etc/apache2/sites-enabled rausnehmen,
    statt VirtualHost 5.xxx:80 *:80 (auch) in der domain1-vhost.conf schreiben, dann geht's?!
    HG
    Mark
    Mitglied: Zockervogel
    Zockervogel 05.03.2015 um 21:11:38 Uhr
    Goto Top
    erstmal danke für eure Hilfe.

    ich habe jetzt meinen Vserver nochmals neu installiert und alles ohne Webmin aufgesetzt.
    Man sieht, ich habe einiges gelernt in den letzten Tagen face-smile

    Ich habe meine Seiten einfach mit domain.de aufgerufen.

    Irgendwann habe ich den tollen Befehl ServerAlias entdeckt.

    Ich habe jetzt Servername mit www.domain.de angegeben.
    Als weitere Zeile habe ich noch ServerAlias domain.de eingesetzt.

    Und siehe da... jetzt funktionieren alle 3 Seiten ohne Probleme.

    mfg
    Peter
    Mitglied: broecker
    broecker 05.03.2015 um 22:16:07 Uhr
    Goto Top
    prima face-smile -
    dann noch flink DNS, Mail und Provider-Preisliste aufsetzen!
    HG
    Mark