0

I'm pulling my hard on this configuration, which probably is simply. I have a wildcard ssl certificate which is working. I have the website setup to run on domain.com under SSL.

Now, I'm in need to run many subdomains (*.domain.com) on the same server with the same SSL certificate. Shouldn't be that hard, right? Well, I can't get it going.

Point is, that the first config is another Tomcat server that serves another site and listens to domain.com and www.domain.com. The other config listens to *.domain.com and pulls the content from another Tomcat server.

I already tried this whole setup with mod_rewrite, but simply don't see what I'm doing wrong. Any help very much appreciated.

Here is my conf in Apache 2.2:

<VirtualHost *:443> SSLEngine on SSLCertificateFile ... SSLCertificateKeyFile ... SSLCertificateChainFile ... ServerName domain.com ServerAlias www.domain.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On ProxyPass / ajp://localhost:8010/ ProxyPassReverse / ajp://localhost:8010/ </VirtualHost> <VirtualHost *:443> SSLEngine on SSLCertificateFile ... SSLCertificateKeyFile ... SSLCertificateChainFile ... ServerName domain.com ServerAlias *.domain.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On ProxyPass / ajp://localhost:8009/ ProxyPassReverse / ajp://localhost:8009/ </VirtualHost> 

Thanks.

4
  • What exactly is going wrong? Are you getting a browser certificate check error? If so, post the details of that message. It usually shows why the check failed. (eg: Cert for foo.domain.com, actual domain: bar.domain.com) Commented Sep 21, 2010 at 13:37
  • I somehow did not get an notify eMail to your reply... Commented Sep 24, 2010 at 14:30
  • What is going wrong is that the SSL cert is working fine, but I can either have *.domain.com working and not www.domain.com (which points to another server) or vice-versa. Commented Sep 24, 2010 at 14:31
  • In the meantime, I could get it to work 90%, that means that I can forward https requests to the wildcard domain (*.domain.com) but since it is under another documentroot, images, css, etc. don't really work. This is how I could it get to work RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] RewriteCond %1 !^(www)$ [NC] RewriteRule ^.*$ ajp://localhost:8009/$1 [P,L] Commented Sep 24, 2010 at 14:35

1 Answer 1

1

Fixed it. Was an issue that my Apache 2.2 did not have VirtualHostName *:443 set. Apache did only set this for port 80.

For Ubuntu users this is in the ports.conf file!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.