RockingRolli
27.01.07, 06:07
Hi.
Habe mir grade testweise 2 DynDNS Adressen registriert und wollte mal gucken ob ich den Apache so einrichten kann, dass er die VHosts auch bearbeitet... scheinbar kann ich das nicht, folgendes:
Ich habe dns1.dyndns.org und dns2.dyndns.org. Standard DocumentRoot ist in /www/htdocs
Die beiden vhosts sollen /www/users/dns1 und /www/users/dns2 als Docroot haben.
Wenn ich nun die Adressen in den Browser eingebe lande ich auf dem in der httpd.conf angegebenen (Standard) DocumentRoot und nicht, wie gewünscht, in dem richtigen Ordner.
Server version: Apache/2.1.9
Die relevanten config-dateien:
cat /usr/local/etc/apache21/httpd.conf | grep -vh '^[ ]*#' "$@" | grep -v '^[ ]*$'
ServerRoot "/usr/local"
Listen 80
LoadModule authn_file_module libexec/apache21/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache21/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache21/mod_authn_anon.so
LoadModule authn_default_module libexec/apache21/mod_authn_default.so
LoadModule authz_host_module libexec/apache21/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache21/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache21/mod_authz_user.so
LoadModule authz_dbm_module libexec/apache21/mod_authz_dbm.so
LoadModule authz_owner_module libexec/apache21/mod_authz_owner.so
LoadModule authz_default_module libexec/apache21/mod_authz_default.so
LoadModule auth_basic_module libexec/apache21/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache21/mod_auth_digest.so
LoadModule file_cache_module libexec/apache21/mod_file_cache.so
LoadModule cache_module libexec/apache21/mod_cache.so
LoadModule disk_cache_module libexec/apache21/mod_disk_cache.so
LoadModule include_module libexec/apache21/mod_include.so
LoadModule filter_module libexec/apache21/mod_filter.so
LoadModule charset_lite_module libexec/apache21/mod_charset_lite.so
LoadModule deflate_module libexec/apache21/mod_deflate.so
LoadModule log_config_module libexec/apache21/mod_log_config.so
LoadModule logio_module libexec/apache21/mod_logio.so
LoadModule env_module libexec/apache21/mod_env.so
LoadModule mime_magic_module libexec/apache21/mod_mime_magic.so
LoadModule cern_meta_module libexec/apache21/mod_cern_meta.so
LoadModule expires_module libexec/apache21/mod_expires.so
LoadModule headers_module libexec/apache21/mod_headers.so
LoadModule usertrack_module libexec/apache21/mod_usertrack.so
LoadModule unique_id_module libexec/apache21/mod_unique_id.so
LoadModule setenvif_module libexec/apache21/mod_setenvif.so
LoadModule ssl_module libexec/apache21/mod_ssl.so
LoadModule mime_module libexec/apache21/mod_mime.so
LoadModule dav_module libexec/apache21/mod_dav.so
LoadModule status_module libexec/apache21/mod_status.so
LoadModule autoindex_module libexec/apache21/mod_autoindex.so
LoadModule asis_module libexec/apache21/mod_asis.so
LoadModule info_module libexec/apache21/mod_info.so
LoadModule cgi_module libexec/apache21/mod_cgi.so
LoadModule dav_fs_module libexec/apache21/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache21/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache21/mod_negotiation.so
LoadModule dir_module libexec/apache21/mod_dir.so
LoadModule imagemap_module libexec/apache21/mod_imagemap.so
LoadModule actions_module libexec/apache21/mod_actions.so
LoadModule speling_module libexec/apache21/mod_speling.so
LoadModule userdir_module libexec/apache21/mod_userdir.so
LoadModule alias_module libexec/apache21/mod_alias.so
LoadModule rewrite_module libexec/apache21/mod_rewrite.so
<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
User www
Group www
</IfModule>
</IfModule>
ServerAdmin RockingRolli@web.de
ServerName *.dns.dyndns.org:80
DocumentRoot "/www/htdocs"
<Directory />
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/www/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>
ErrorLog /var/log/httpd-error.log
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog /var/log/httpd-access.log combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/www/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig etc/apache21/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include etc/apache21/Includes/*.conf
cat /usr/local/etc/apache21/extra/httpd-vhosts.conf | grep -vh '^[ ]*#' "$@" | grep -v '^[ ]*$'
NameVirtualHost *
<VirtualHost *.dns1.dyndns.org:80>
ServerAdmin ka@ka.de
ServerName dns1.dyndns.org
ServerAlias *.dns1.dyndns.org
DocumentRoot /www/users/dns1/htdocs
</VirtualHost>
<VirtualHost *.dns2.dyndns.org:80>
ServerAdmin kA@kA.de
DocumentRoot /www/users/dns2/htdocs
ServerName dns2.dyndns.org
ServerAlias *.dns2.dyndns.org
</VirtualHost>
Die Ordner existieren alle. Ein paar andere Schreibweisen habe ich auch getestet. Bislang alles ohne Erfolg. Der Rechner ist hinter einem Router und port80 wird auf den Rechner weitergeleitet.
Kann mir jemand erklären warum das nicht funktioniert und mit ggf. helfen?
BTW: ist FreeBSD wo der Apache drauf läuft, aber das sollte ja die Konfiguration nicht großartig beeinflussen
Habe mir grade testweise 2 DynDNS Adressen registriert und wollte mal gucken ob ich den Apache so einrichten kann, dass er die VHosts auch bearbeitet... scheinbar kann ich das nicht, folgendes:
Ich habe dns1.dyndns.org und dns2.dyndns.org. Standard DocumentRoot ist in /www/htdocs
Die beiden vhosts sollen /www/users/dns1 und /www/users/dns2 als Docroot haben.
Wenn ich nun die Adressen in den Browser eingebe lande ich auf dem in der httpd.conf angegebenen (Standard) DocumentRoot und nicht, wie gewünscht, in dem richtigen Ordner.
Server version: Apache/2.1.9
Die relevanten config-dateien:
cat /usr/local/etc/apache21/httpd.conf | grep -vh '^[ ]*#' "$@" | grep -v '^[ ]*$'
ServerRoot "/usr/local"
Listen 80
LoadModule authn_file_module libexec/apache21/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache21/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache21/mod_authn_anon.so
LoadModule authn_default_module libexec/apache21/mod_authn_default.so
LoadModule authz_host_module libexec/apache21/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache21/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache21/mod_authz_user.so
LoadModule authz_dbm_module libexec/apache21/mod_authz_dbm.so
LoadModule authz_owner_module libexec/apache21/mod_authz_owner.so
LoadModule authz_default_module libexec/apache21/mod_authz_default.so
LoadModule auth_basic_module libexec/apache21/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache21/mod_auth_digest.so
LoadModule file_cache_module libexec/apache21/mod_file_cache.so
LoadModule cache_module libexec/apache21/mod_cache.so
LoadModule disk_cache_module libexec/apache21/mod_disk_cache.so
LoadModule include_module libexec/apache21/mod_include.so
LoadModule filter_module libexec/apache21/mod_filter.so
LoadModule charset_lite_module libexec/apache21/mod_charset_lite.so
LoadModule deflate_module libexec/apache21/mod_deflate.so
LoadModule log_config_module libexec/apache21/mod_log_config.so
LoadModule logio_module libexec/apache21/mod_logio.so
LoadModule env_module libexec/apache21/mod_env.so
LoadModule mime_magic_module libexec/apache21/mod_mime_magic.so
LoadModule cern_meta_module libexec/apache21/mod_cern_meta.so
LoadModule expires_module libexec/apache21/mod_expires.so
LoadModule headers_module libexec/apache21/mod_headers.so
LoadModule usertrack_module libexec/apache21/mod_usertrack.so
LoadModule unique_id_module libexec/apache21/mod_unique_id.so
LoadModule setenvif_module libexec/apache21/mod_setenvif.so
LoadModule ssl_module libexec/apache21/mod_ssl.so
LoadModule mime_module libexec/apache21/mod_mime.so
LoadModule dav_module libexec/apache21/mod_dav.so
LoadModule status_module libexec/apache21/mod_status.so
LoadModule autoindex_module libexec/apache21/mod_autoindex.so
LoadModule asis_module libexec/apache21/mod_asis.so
LoadModule info_module libexec/apache21/mod_info.so
LoadModule cgi_module libexec/apache21/mod_cgi.so
LoadModule dav_fs_module libexec/apache21/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache21/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache21/mod_negotiation.so
LoadModule dir_module libexec/apache21/mod_dir.so
LoadModule imagemap_module libexec/apache21/mod_imagemap.so
LoadModule actions_module libexec/apache21/mod_actions.so
LoadModule speling_module libexec/apache21/mod_speling.so
LoadModule userdir_module libexec/apache21/mod_userdir.so
LoadModule alias_module libexec/apache21/mod_alias.so
LoadModule rewrite_module libexec/apache21/mod_rewrite.so
<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
User www
Group www
</IfModule>
</IfModule>
ServerAdmin RockingRolli@web.de
ServerName *.dns.dyndns.org:80
DocumentRoot "/www/htdocs"
<Directory />
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/www/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>
ErrorLog /var/log/httpd-error.log
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog /var/log/httpd-access.log combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/www/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig etc/apache21/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include etc/apache21/Includes/*.conf
cat /usr/local/etc/apache21/extra/httpd-vhosts.conf | grep -vh '^[ ]*#' "$@" | grep -v '^[ ]*$'
NameVirtualHost *
<VirtualHost *.dns1.dyndns.org:80>
ServerAdmin ka@ka.de
ServerName dns1.dyndns.org
ServerAlias *.dns1.dyndns.org
DocumentRoot /www/users/dns1/htdocs
</VirtualHost>
<VirtualHost *.dns2.dyndns.org:80>
ServerAdmin kA@kA.de
DocumentRoot /www/users/dns2/htdocs
ServerName dns2.dyndns.org
ServerAlias *.dns2.dyndns.org
</VirtualHost>
Die Ordner existieren alle. Ein paar andere Schreibweisen habe ich auch getestet. Bislang alles ohne Erfolg. Der Rechner ist hinter einem Router und port80 wird auf den Rechner weitergeleitet.
Kann mir jemand erklären warum das nicht funktioniert und mit ggf. helfen?
BTW: ist FreeBSD wo der Apache drauf läuft, aber das sollte ja die Konfiguration nicht großartig beeinflussen