- SnipSnap can run without Apache, but if you must use Apache and Apache uses port 80 you can use Apache as a proxy.
- Install SnipSnap as explained above. Leave the Port somehwhere above 1024 (default is 8668).
- Edit your apache httpd.conf (enable mod_proxy):
# Enable mod_proxy (uncomment the LoadModule line!)
# Both works in apache1.x and apache2.x
LoadModule proxy_module /usr/lib/apache/1.3/mod_proxy.so# Uncomment the AddModule line for mod_proxy.c
# Only in apache1.x,in apache2.x,you did not need this line
AddModule mod_proxy.c# make sure you don't allow anyone to use your apache as proxy
ProxyRequests off# use apache as a reverse proxy to your [SnipSnap] server:
# my.snipsnap.host and path are what you entered during installation.
# The host my.snipsnap.host can be a fully qualified domain name or an IP number.
# The path is the relative path to your snipsnap directory from your web server
# root directory. If you placed the snipsnap folder at the root level you
# don't need to specify the path.
# If you left host empty during installation enter localhost as the host.
ProxyPass /snipsnap/ http://my.snipsnap.host:8668/path
ProxyPassReverse /snipsnap/ http://my.snipsnap.host:8668/path
Now your can use your
SnipSnap on your apache web server: http://your.server.com/snipsnap/
ATTENTION: If you use multiple SnipSnap applications make sure you let them run on different ports as apaches mod_proxy can't get the cookies right.
ATTENTION: Be careful with the
slashes. /snipsnap/
http://my.snipsnap.host:8668/path/ should work. In other cases you would create a neverending redirection cycle (
pmode);if you can't get it work by configure the proxy by following above steps;try "/snipsnap" instead of "/snipsnap/".
ATTENTION:__Do NOT forget to enter the administration interface to set the context path to "/snipsnap" or other words you like, but it should be corresponding with what you set in the httpd.conf.
Securing SnipSnap using VirtualHost/SSL with Apache
This example assumes you have configured the SSL engine, loaded the mod_proxy and mod_access. It is even possible to use mod_pam (see apache docs).
<VirtualHost my.snipsnap.domain:443>
ServerName my.snipsnap.domain
ProxyVia full
ProxyRequests off
NoCache *
ProxyPass / http://internal.server:8668/
ProxyPassReverse / http://internal.server:8668/
<Directory proxy:*>
AuthType Basic
AuthName "SnipSnap VPN Access"
AuthUserFile /etc/apache/snipsnap/mysnipsnap.users
#AuthGroupFile /etc/apache/snipsnap/mysnipsnap.groups
Require valid-user
</Directory>
</VirtualHost><VirtualHost cbe.first.fraunhofer.de>
RedirectMatch ^/(.*) https://my.snipsnap.domain/$1
</VirtualHost>If you don't want SSL, remove the port ":443" and the second VirtualHost entry.