[Synology] VirtualHost / ProxyPass - SOLVED

Need help? Post your questions here.
z-vap
Posts: 21
Joined: 08 Jun 2013, 12:36
Has thanked: 2 times
Been thanked: 4 times

[Synology] VirtualHost / ProxyPass - SOLVED

Unread post by z-vap »

so hey all.

I was wondering if any of the other Synology users have been able to get any apache proxypass configurations to work?

Ultimately I'd like to get madsonic and owncloud both accessable from port 80, kind of like this

Code: Select all

external
http://12.34.56.78/madsonic
http://12.34.56.78/owncloud

internal  (doesn't much matter but)
http://192.168.1.100/madsonic or http://192.168.1.100:4040 
http://192.168.1.100/owncloud  ( i think it lives on 80)
I have tried numerous things but I keep corrupting something and i have to reinstall.

Thanks for any help
Last edited by z-vap on 28 Nov 2015, 15:38, edited 1 time in total.
User avatar
DoCC
Contributor
Contributor
Posts: 211
Joined: 25 Feb 2014, 14:41
Has thanked: 40 times
Been thanked: 65 times

Re: [Synology] VirtualHost / ProxyPass

Unread post by DoCC »

hi !

i do not know how the synology station/system is build.
But if you are able to alter your configuration of your apache demon then there will be no problem.

As i read, you want to set up an apache proxy on port 80 for your madsonic, right ?

1. enable the proxy_module for apache, just ensure that the files proxy.load AND profy.conf are in the "mods-enabled" folder, like here :

Code: Select all

madsonic:~$ ls /etc/apache2/mods-enabled/
access_compat.load  autoindex.conf  mime.conf           proxy_http.load
actions.load        autoindex.load  mime.load           <<<< proxy.load >>>>
alias.conf          deflate.conf    mpm_prefork.conf    rewrite.load
alias.load          deflate.load    mpm_prefork.load    setenvif.conf
auth_basic.load     dir.conf        negotiation.conf    setenvif.load
authn_core.load     dir.load        negotiation.load    status.conf
authn_file.load     env.load        php5.conf           status.load
authz_core.load     fcgid.conf      php5.load
authz_host.load     fcgid.load      <<<< proxy.conf >>>>
authz_user.load     filter.load     proxy_connect.load
2. edit your conf file where the vhosts are set. this can be any file called at the end of the httpd.conf.

the part for proxypassing "?" should read like this :

Code: Select all

<VirtualHost listening-IP:80>
    ServerName listening.domain.blah
        ProxyPass / http://madsonic.ip:4040/
        ProxyPassReverse / http://madsonic.ip:4040/
</VirtualHost>
listening-ip and madsonic-ip can be the same, apache throws an error, if port 80 is already used.
the listening domain is needed if you wantto have other services listening on port 80.

3. save the config file restart apache.

call your internal domain name or the given ip and voila all will be fine
z-vap
Posts: 21
Joined: 08 Jun 2013, 12:36
Has thanked: 2 times
Been thanked: 4 times

Re: [Synology] VirtualHost / ProxyPass

Unread post by z-vap »

ok thanks.

I will give this scenario a try and let you know
z-vap
Posts: 21
Joined: 08 Jun 2013, 12:36
Has thanked: 2 times
Been thanked: 4 times

Re: [Synology] VirtualHost / ProxyPass

Unread post by z-vap »

I know this response is 8 months late but I do want to make a confirmed note here that I did get this to work.

Here are my steps:

First goto Web Services > Web Applications and Enable Web Station [x]

This will allow -user related httpd configurations. Owncloud requires this to be enabled upon install.

Then ssh into the box and cd to:

Code: Select all

/etc/httpd/conf
confirm there is a httpd.conf-user created
if you cat, or edit this file using vi near the bottom you should see:

Code: Select all

<VirtualHost *:80>
    Include sites-enabled-user/*.conf
</VirtualHost>
which should load any config files in the sites-enabled-user dir.

Quit out of the file and cd to

Code: Select all

/etc/httpd/sites-enabled-user
and vi any file name, I chose httpd-custom.conf

and enter:

Code: Select all

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

<Location /madsonic>
    ProxyPass  http://127.0.0.1:4040/madsonic
    ProxyPassReverse http://127.0.0.1:4040/madsonic
</Location>
save the config file, exit, and restart apache user interface.

Code: Select all

/sbin/initctl stop httpd-user
/sbin/initctl start httpd-user 
Now Stop the Madsonic Application, and go to :

Code: Select all

/var/packages/Madsonic/target
and edit madsonic.sh, and confirm the port and context_path match the
Location information entered above

Code: Select all

MADSONIC_PORT=4040
MADSONIC_CONTEXT_PATH=/madsonic
That should be it. Start Madsonic and validate :)
These users thanked the author z-vap for the post:
Madsonic
Rating: 7.69%
Post Reply