httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Millikan" <gmilli...@t1shopper.com>
Subject RE: [users@httpd] Special configuration for requests that do not match any particular virtual host? Apache 2.2
Date Thu, 02 Jun 2011 05:00:15 GMT
> Eric C: You can't make the catch-all vhost also be a reachable name-based 
> vhost, with those rewrite rules.  Create an additional one 
> solely for that purpose.

> Jeroen G: Get rid of all the rewrite junk and just set a dummy servername; 
> this will catch ALL undefined hostnames.
> Then Redirect / to the correct vhost.

Ah ha! The issue was that doing "ServerAlias *" crashes Apache with no error log. ServerAlias
apparently needs more than just a
single wildcard character.  Putting the below <VirtualHost> entry after the last <VirtualHost>
works great!  Sweet.

<VirtualHost *:80>
      ServerName     my-catch-all-dummy-domain.com
      ServerAlias    *.com *.net *.org *.co *.mobi *.info *.me *.us *.biz *.tv *.ws
      RewriteEngine  On
      RewriteRule    .* http://www.mydomain.com%{REQUEST_URI} [L,R=301]
      ErrorLog       /var/log/httpd/error_log
      CustomLog      /var/log/httpd/access_log combined
</VirtualHost>

Now I cannot do the same thing for the 443 virtual host section - adding the below <VirtualHost>
section crashes Apache with the
below strange error:

[Thu Jun 02 04:55:13 2011] [error] Illegal attempt to re-initialise SSL for server (theoretically
shouldn't happen!)

<VirtualHost *:443>
      ServerName     my-catch-all-dummy-domain-SSL.com
      ServerAlias    *.com *.net *.org *.co *.mobi *.info *.me *.us *.biz *.tv *.ws
      RewriteEngine  On
      RewriteRule    .* https://www.mydomain.com%{REQUEST_URI} [L,R=301]
      ErrorLog       /var/log/httpd/error_log
      CustomLog      /var/log/httpd/access_log combined
</VirtualHost>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message