I'm running Ubuntu Server 14.10 which has an apache2 install hosting a couple of websites. I also have some other web services installed which are accessible on other ports. Here's a layout (sorry I can't post more than 2 links):
- https :// www.example.com
- https :// www.example.com/ttrss = Tiny Tiny RSS
- https :// www.example.com/pydio = Pydio
- http :// www.example.com:720 = Gitlab
- http :// www.example.com:4040 = Subsonic
I have an ssl cert for www.example.com. I want to make the services on other ports resolve from subdirectories AND respect the SSL cert, so for example, https :// www.example.com/subsonic/ -> http :// www.example.com:4040
I've Googled a lot. It's some combination of alias, reverse proxy, and virtual hosts...but I can't seem to get it to work right. Is this possible? Am I just nuts? I have a /etc/apache2/sites-available/subsonic.conf file but the syntax is so wrong I'm not gonna even bother posting it. Web root for subsonic is /var/subsonic/jetty/4428/webapp/ .
Thoughts?
EDIT:
Some details of iterations I tried. I didn't save my configs, so I'm going back and trying to do this from memory. I tried to approach each of my problems 1 at a time:
Attempts to get http :// hda.surfrock66.com/subsonic to resolve to http :// hda.surfrock66.com:4040
Attempt 1
<VirtualHost *:80>
ServerName http :// hda.surfrock66.com/subsonic
ProxyPass/ http :// localhost:4040/
ProxyPassReverse / http :// localhost:4040/
</VirtualHost>
Attempt 2
<VirtualHost *:80>
ServerName hda.surfrock66.com/subsonic
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http :// 127.0.0.1:4040
ProxyPassReverse http :// hda.surfrock66.com/subsonic
</Location>
DocumentRoot /var/subsonic/jetty/4428/webapp
</VirtualHost>
Attempt to get SSL to work 1
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/realcert.crt
SSLCertificateKeyFile /etc/apache2/ssl/realcert.key
SSLProxyEngine on
ServerAdmin surfrock66@surfrock66.com
DocumentRoot /var/www
ServerName hda.surfrock66.com/subsonic
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/subsonic-access.log combined
ErrorLog ${APACHE_LOG_DIR}/subsonic-error.log
ProxyHTMLStripComments on
<Location /subsonic/>
ProxyRequests off
RequestHeader unset Accept-Encoding
ProxyPass http :// localhost:4040/
ProxyPassReverse http :// localhost:4040/
Order allow,deny
Allow from all
</Location>
</VirtualHost>
I'm sure I tried some other things, but at this point I just want to start from scratch with the understanding that I have no idea what I'm doing :/