Re: vhost Apache Konfiguration

From: <ml(at)ft-c.de>
Date: Sun, 19 Mar 2017 23:08:58 +0100

hallo,

das wichtigste hatte ich vergessen.
hier die httpd.conf

% cat /usr/local/etc/apache24/httpd.conf |
          grep -v -e "^ *#" | grep -v -e "^ *$"

ServerRoot "/usr/local"
Listen 80
LoadModule authn_file_module libexec/apache24/mod_authn_file.so
LoadModule authn_core_module libexec/apache24/mod_authn_core.so
LoadModule authz_host_module libexec/apache24/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache24/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache24/mod_authz_user.so
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule access_compat_module libexec/apache24/mod_access_compat.so
LoadModule auth_basic_module libexec/apache24/mod_auth_basic.so
LoadModule reqtimeout_module libexec/apache24/mod_reqtimeout.so
LoadModule filter_module libexec/apache24/mod_filter.so
LoadModule mime_module libexec/apache24/mod_mime.so
LoadModule log_config_module libexec/apache24/mod_log_config.so
LoadModule env_module libexec/apache24/mod_env.so
LoadModule headers_module libexec/apache24/mod_headers.so
LoadModule setenvif_module libexec/apache24/mod_setenvif.so
LoadModule version_module libexec/apache24/mod_version.so
LoadModule session_module libexec/apache24/mod_session.so
LoadModule session_cookie_module libexec/apache24/mod_session_cookie.so
LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule status_module libexec/apache24/mod_status.so
LoadModule autoindex_module libexec/apache24/mod_autoindex.so
<IfModule !mpm_prefork_module>
        #LoadModule cgid_module libexec/apache24/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
        #LoadModule cgi_module libexec/apache24/mod_cgi.so
</IfModule>
LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
LoadModule dir_module libexec/apache24/mod_dir.so
LoadModule alias_module libexec/apache24/mod_alias.so
LoadModule rewrite_module libexec/apache24/mod_rewrite.so
LoadModule php7_module libexec/apache24/libphp7.so
IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
<IfModule unixd_module>
User www
Group www
</IfModule>
ServerAdmin you(at)example.com
ServerName localhost:80
<Directory />
     AllowOverride none
     Require all denied
</Directory>
DocumentRoot "/server/www"
<Directory "/server/www">
     Options Indexes FollowSymLinks
     AllowOverride All
     Require all granted
</Directory>
<IfModule dir_module>
     DirectoryIndex index.html index.php
</IfModule>
<Files ".ht*">
     Require all denied
</Files>
ErrorLog "/var/log/apache2/error.log"
LogLevel debug
<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/apache2/access.log" common
</IfModule>
<IfModule alias_module>
     ScriptAlias /cgi-bin/ "/usr/local/www/apache24/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "/usr/local/www/apache24/cgi-bin">
     AllowOverride None
     Options None
     Require all granted
</Directory>
<IfModule headers_module>
     RequestHeader unset Proxy early
</IfModule>
<IfModule mime_module>
     TypesConfig etc/apache24/mime.types
     AddType application/x-compress .Z
     AddType application/x-gzip .gz .tgz
</IfModule>
ErrorDocument 500 "Error Doc 500"
ErrorDocument 404 "Error Doc 404"
ErrorDocument 402 "Error Doc 402"
ErrorDocument 400 "Error Doc 400"
Include etc/apache24/extra/httpd-vhosts.conf
<IfModule proxy_html_module>
   Include etc/apache24/extra/proxy-html.conf
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include etc/apache24/Includes/*.conf
<FilesMatch "\.php$">
     SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
     SetHandler application/x-httpd-php-source
</FilesMatch>

On 19.03.2017 22:21, ml(at)ft-c.de wrote:
> Hallo,
>
> seit einigen Monaten akzeptiert der Apache Server die vhosts nicht mehr.
>
> Hier das Verhalten:
> Es sind web_ftimmer (und weitere) als vhosts eingebunden (s.u.).
> Ein ping von der Konsole auf web_ftimmer läuft.
> Ein ping auf localhost läuft auch, obwohl dieser in der Datei /etc/hosts
> auskommentiert ist.
>
> Wenn ich localhost im Webbrowser aufrufe, erscheint der erste Eintrag
> der vhosts.conf Datei. Über phpinfo wird die in vhosts (1. Eintrag)
> angegebene Emailadresse ausgegeben.
>
> Wenn ich web_ftimmer in Firefox oder Chromium aufrufe, erscheint die
> 400-Fehlerseite bzw. die Meldung: Your browser sent a request that this
> server could not understand.
>
>
> Hier die wichtigsten Daten:
>
> Hier ein Auszug aus /usr/local/etc/apache24/extra/htpd_vhosts.conf
> <VirtualHost *:80>
> ServerName web_ftimmer
> DocumentRoot /server/www/web_ftimmer
> ServerAdmin ft(at)ftxxxx.de
> RewriteEngine off
> <Directory />
> Options FollowSymLinks
> AllowOverride All
> </Directory>
> <Directory /server/www/web_ftimmer/>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride All
> Require all granted
> </Directory>
> ErrorLog /var/log/apache2/error.log
> LogLevel info
> CustomLog /var/log/apache2/access.log combined
> </VirtualHost>
>
> Die Datei /etc/hosts beinhaltet:
> 127.0.0.1 web_ftimmer
> .. und weitere (aber nicht localhost)
>
> % apachectl -S
> VirtualHost configuration:
> *:80 is a NameVirtualHost
> default server web_ftimmer
> (/usr/local/etc/apache24/extra/httpd-vhosts.conf:31)
> port 80 namevhost web_ftimmer
> (/usr/local/etc/apache24/extra/httpd-vhosts.conf:31)
> port 80 namevhost web_ft-c
> (/usr/local/etc/apache24/extra/httpd-vhosts.conf:64)
> ... und weitere
> ServerRoot: "/usr/local"
> Main DocumentRoot: "/server/www"
> Main ErrorLog: "/var/log/apache2/error.log"
> Mutex default: dir="/var/run/" mechanism=default
> Mutex mpm-accept: using_defaults
> Mutex rewrite-map: using_defaults
> PidFile: "/var/run/httpd.pid"
> Define: DUMP_VHOSTS
> Define: DUMP_RUN_CFG
> User: name="www" id=80
> Group: name="www" id=80
>
>
> % apachectl -t -D DUMP_INCLUDES
> Included configuration files:
> (*) /usr/local/etc/apache24/httpd.conf
> (503) /usr/local/etc/apache24/extra/httpd-vhosts.conf
> (531) /usr/local/etc/apache24/Includes/no-accf.conf
>
>
> Weitere Informationen:
> Bei einem Update (schon lange her) erhielt ich die Info:
> You may need to manually remove
> /usr/local/etc/apache24/extra/httpd-vhosts.conf if it is no longer needed.
> You may need to manually remove
> /usr/local/etc/apache24/httpd.conf if it is no longer needed.
>
>
> % uname -a
> FreeBSD ftc2 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24
> 06:55:27 UTC 2016
> root(at)amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
>
> Und jetzt die Frage:
> Wo liegt der Fehler? Warum werden die vhosts nicht umgesetzt?
>
> Gruss
> Franz
>
>
> To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
> with "unsubscribe de-bsd-questions" in the body of the message
>

To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sun 19 Mar 2017 - 23:09:23 CET

search this site