Redirecting to another port
YMMV, edit /etc/apache2/sites-available/yoursite.conf
<VirtualHost *:80>
ServerAdmin hey@whitehouse.gov
ServerName subdomain.domain.com
ProxyPass / http://localhost:2368/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
then a2ensite subdomain.domain.com
or symlink it to sites-enabled.
For the rest:
<VirtualHost *:80>
ServerName subdomain.domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Caveats: You need to enable the proxy module with a2enmod proxy_http
. Also get rid of all default vhost stuff.