PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Konfiguration von Apache2 (+mod_proxy) und bind9



godmod
21.02.10, 17:10
Hallo liebe Linuxer,

ich bin hier neu und das ist mein erster Post und mein erstes Thema.
Ich kenne mich leider noch nicht all zu gut mit Linux aus und komme durch alleiniges stöbern und lesen hier oder in anderen Foren sowie im Web bei meinem Problem leider nicht weiter.

Ich habe einen root Server auf den ich via SSH zugreife. OS ist Debian Lenny 5.0.4. Der Server soll folgende Dienste bereitstellen: Zimbra Collaboration Suite, ein paar wenige und unaufwendige Webseiten und FTP zum Upload größerer Dateien.

Zimbra läuft fein und jetzt habe ich aber folgende zwei Probleme:

1. sollen unter den verschiedenen subdomains auch verschiedene seiten erreichbar sein:
http://www.server.at => normale webseite
http://mail.server.at => das zimbra client interface (sowohl http...)
https://mail.server.at => das zimbra client interface (...als auch https)
https://acp.server.at => das zimbra admin interface (NUR über https)
http://foo.server.at => irgendeine testseite für die IT abteilung

Zimbra ist über den eigenen tomcat erreichbar, deshalb habe ich das client interface auf port 81 gelegt.
* Jetzt will ich per mod_proxy erreichen, dass eben server.at:81 aufgerufen und geladen wird wenn man mail.server.at bzw. https://mail.server.at als url aufruft.
* Das admin interface hat einen fest zugewiesenen port (7071) und soll analog dazu per https://acp.server.at erreichbar sein und die (eigentliche adresse) https://server.at:7071 anzeigen / laden (=> mod_proxy oder?)


2. habe ich das Problem, dass ich einfach unfähig bin eine Subdomain einzurichten. Meinen recherchen nach sollte man im Apache2 einen VHost konfigurieren können und dem named dienst (bei bind9 dabei) die subdomain auch mitteilen. Leider bekomme ich das nicht ganz gebacken und würde mich riesig über etwas hilfe freuen.

ich will hier keines wegs arbeit an euch abwälzen, ich brauche einfach nur fachkundigen rat und etwas nachhilfe dabei, da ich anstehe :(

Config dateien (falls welche fehlen bitte sagen, dann kommen die natürlich auch hier rein):

APACHE2
apache2.conf


### Section 1: Global Environment

ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

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

AccessFileName .htaccess

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

DefaultType text/plain
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
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/apache2/other_vhosts_access.log vhost_combined
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

httpd.conf

ServerName mail.static.xx.xx.xx.xx.clients.your-server.de
NameVirtualHost *:80

<VirtualHost *:80>
ServerName static.xx.xx.xx.xx.clients.your-server.de
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
ServerName mail.static.xx.xx.xx.xx.clients.your-server.de
DocumentRoot /var/www/html/subtest
</VirtualHost>

ports.conf

# NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>

ssl.conf

NameVirtualHost *:443

<VirtualHost *:443>
ServerName static.xx.xx.xx.xx.clients.your-server.de
ServerAdmin admin@static.xx.xx.xx.xx.clients.your-server.de
ErrorLog /var/log/zimbra-ssl-error.log
CustomLog /var/log/zimbra-ssl-access.log common
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/zimbra.crt
SSLCertificateKeyFile /etc/pki/tls/private/zimbra.key
SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
Redirect / https://static.xx.xx.xx.xx.clients.your-server.de:7071/
</VirtualHost>


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

<VirtualHost *:80>
ServerAdmin admin@static.xx.xx.xx.xx.clients.your-server.de

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

/etc/apache2/sites-available/default

<VirtualHost *:80>
ServerAdmin admin@static.xx.xx.xx.xx.clients.your-server.de

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

/etc/apache2/sites-available/default-ssl ist unverändert.

BIND

db.0, db.127, db.255, db.empty und db.root in /etc/bind unverändert.
ab hier im dir /etc/bind/
db.local

;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2010022004 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS static.xx.xx.xx.xx.clients.your-server.de.
@ IN A xx.xx.xx.xx
; @ IN AAAA ::1

mail IN A xx.xx.xx.xx


named.conf

logging {
channel default_log {
file "/var/log/named.log";
severity warning;
print-category yes;
print-severity yes;
print-time yes;
};
category warning { default_log; };
};

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";

// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};

named.conf.local

zone "static.xx.xx.xx.clients.your-server.de" {
type master;
file "/etc/bind/zones/server.at.zone";
// allow-transfer { 213.133.100.100; };
};

//The next is the reverse DNS entry.
zone "xx.xx.xx.in-addr.arpa" {
type master;
file "/etc/bind/zones/zone.xx.xx.xx.db";
};

named.conf.options

options {
directory "/var/cache/bind";
listen-on-v6 { any; };

auth-nxdomain no; # conform to RFC1035

allow-transfer { none; } ;
listen-on { xx.xx.xx.xx; } ; # interface BIND 9 listens on
forward only;

forwarders
{
213.133.98.98;
213.133.99.99;
213.133.100.100;
};

};

ab hier im dir /etc/bind/zones
server.at.zone

$TTL 3h
@ IN SOA ns.static.xx.xx.xx.xx.clients.your-server.de. admin.static.xx.xx.xx.xx.clients.your-server.de. (
2010022002 ; Serial
14400 ; Refresh
1800 ; Retry
604800 ; Expire
86400 ) ; Minimum

@ IN NS ns1-coloc.hetzner.de.
@ IN NS ns2-coloc.hetzner.de.
@ IN NS ns3-coloc.hetzner.de.

localhost IN A 127.0.0.1
@ IN A xx.xx.xx.xx
mail IN A xx.xx.xx.xx
wiki IN A xx.xx.xx.xx
www IN A xx.xx.xx.xx

loopback IN CNAME localhost

@ IN MX 10 mail

it IN A xx.xx.xx.xx
ns IN A xx.xx.xx.xx

$ORIGIN static.xx.xx.xx.xx.clients.your-server.de.

zone.xx.xx.xx.db

empty

falls du es bis hier her geschafft hast ein großes dankeschön!!

Liebe Grüße,
Michael

marce
22.02.10, 07:41
damit der Apache-vHost sich für einen Domainnamen zuständig fühlt sollte der exakte Domainname, den er vom Client übergeben bekommt als Servername oder Serveralias in der entsprechenden vHost-Config stehen - lies Dir einfach mal den Bereich named-virtual-Hosting in der Doku auf der Apache-Seite durch.

Einen Nameserver brauchst Du dafür nicht - solange Du die DNS-Einträge nicht selbst verwalten willst.

Es muss natürlich irgendwo einen DNS-Eintrag für die Subdomain geben, damit die Client überhaupt beim Server ankommt...

NamedVirtualHosts und ssl sind übrigens per se problematisch...