My current setup is like this. I have a registered domain name. Through my domain provider I have pointed my domain to a dynamic IP address. So mysite.com points to 97.89.120.x
I have dd-wrt router and it is keeping my dynamic IP updated and port forwarding all port 80 and 443 request to my apache server IP of 192.168.121.50 ( Nothing real crazy here)
My apache server redirects all port 80 request to port 443 cat /etc/apache2/sites-available/default
<VirtualHost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
cat /etc/apache2/sites-available/default-ssl
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mycloud
</VirtualHost>
This all works like a champ and is very straight forward.
I want to add a subdomain of cloud.mysite.com. So that mysite.com and cloud.mysite.com both point to the same dynamic IP 97.89.120.x From my dd-wrt router I am port forwarding all port 80 and 443 request to a new server in my environment 192.168.121.60
I want the apache server on this new host to host mysite.com and to forward request for cloud.mysite.com to the other server 192.168.121.50 and be redirected to https / ssl / ports 443.
So how exactly do I setup the virtual server to do this? I have tried similar to this without success.
NameVirtualHost *
<VirtualHost *:80>
ServerName www.mysite.com
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
ServerName www.cloud.mysite.com
ServerAlias 192.168.121.50
DocumentRoot /var/www/mycloud
</VirtualHost>
How can I redirect the subdomain to a different server and get this to work?