Run node.js on apache
The problem with Subsonic is that it runs on Node.js on a non-standard port. The rest of my web applications run in Apache on port 80. Therefore, it would be nice if instead of having to go to http://example.com:8180/subsonic/, I could simply go to http://example.com. The solution is called a reverse proxy. Reverse proxies can do things like load balance between multiple web servers or simply make resources on an internal web server available externally. In this case, I am using a reverse proxy to make a web application available on a different port available on the standard port 80.
The set up is fairly simple. On Ubuntu, it should be as simple as issuing this command (as root) to enable the proxy modules:
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/path/to/folder
ServerName example.com
ErrorLog /var/www/vhosts/loh/logs/error_log
CustomLog /var/www/vhosts/loh/logs/access_log combined
<Directory /var/www/vhosts/path/to/folder>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://example.com:8180/
ProxyPassReverse http://example.com/
</Location>
</VirtualHost>
The problem with Subsonic is that it runs on Node.js on a non-standard port. The rest of my web applications run in Apache on port 80. Therefore, it would be nice if instead of having to go to http://example.com:8180/subsonic/, I could simply go to http://example.com. The solution is called a reverse proxy. Reverse proxies can do things like load balance between multiple web servers or simply make resources on an internal web server available externally. In this case, I am using a reverse proxy to make a web application available on a different port available on the standard port 80.
The set up is fairly simple. On Ubuntu, it should be as simple as issuing this command (as root) to enable the proxy modules:
<VirtualHost *:80>
DocumentRoot /var/www/vhosts/path/to/folder
ServerName example.com
ErrorLog /var/www/vhosts/loh/logs/error_log
CustomLog /var/www/vhosts/loh/logs/access_log combined
<Directory /var/www/vhosts/path/to/folder>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://example.com:8180/
ProxyPassReverse http://example.com/
</Location>
</VirtualHost>
No comments:
Post a Comment