How to redirect a name-based VirtualHost to a different port?

Posted by Andra on Server Fault See other posts from Server Fault or by Andra
Published on 2012-08-30T20:03:07Z Indexed on 2012/08/30 21:40 UTC
Read the original article Hit count: 239

Filed under:
|
|

I have a virtuoso sparql endpoint installed, which I want to make available through a hostname (e.g. www.virtuosoexample.com). The thing with virtuoso is that the is no Document root. The endpoint is initiated by the daemon and made available through a source port (e.g. localhost:1234/)

I know how to set a virtual host pointing to a document root, but i don't know how to do this for a server with a port number.

Any advice would be appreciated.

Below is the code, how I would do it with a document root.

I tried to change that (naively) into localhost:1234/sparql, but that didn't work

<VirtualHost *>

   ServerName www.virtuosoexample.com <www.virtuosoexample.com> 
    ServerAlias www.virtuosoexample.com <www.virtuosoexample.com> 

    ErrorLog /var/log/apache2/error.wp-sparql.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.wp-sparql.log combined


    DocumentRoot /var/www/endpoint/sparql/
    <Directory /var/www/endpoint/sparql>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory> 

</VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about virtualhost