1

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 :/

surfrock66
  • 163
  • 3
  • 15
  • What have you already tried, and what was missing erroneous with these configurations? What specific issue are you facing? – sebix Apr 11 '15 at 12:02
  • Hi, I am facing the same problems and I can adress different services, but the "root" service is overlapping all other services if I enable the location "/" but for all the other services you can take a look here -> https://serverfault.com/questions/698770/apache-2-4-nasted-location-with-exeptions – tingel2k Jun 14 '15 at 14:04
  • In my previous link is maybe an answer to your problem. I created a filter for the "main" url www.example.com with a LocationMatch Regex. Within this regex you have to specify all you services which have to be bypassed by the LocationMatch directive. I hope it helps. Regards tingel2k – tingel2k Jun 18 '15 at 12:24

0 Answers0