RE: Special configuration for requests that do not match any particular virtual host? Apache 2.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux