IIPImage now an Official FreeBSD Package

IIPImage is is now an official FreeBSD package. As of version 1.0 of iipsrv, the IIPImage server is now included as part of the FreeBSD ports package collection. The iipsrv package, net/iipsrv, has binary builds available for both 32 and 64bit FreeBSD. For the latest build information, see the build and package status page.

Installation

Installation is very straight-forward. Simply use the default FreeBSD package manager, pkg, to install:

sudo pkg install iipsrv

The pkg utility will install into /usr/local/ by default with the iipsrv.fcgi binary in /usr/local/bin/iipsrv.fcgi and a start-up script in /usr/local/etc/rc.d/iipsrv, which will allow you to easily run iipsrv in stand-alone mode. Note that this binary does not include Memcached or JPEG2000 support. If you require these, you will need to compile iipsrv manually.

Running iipsrv as an Independent Process

iipsrv can be started as a stand-alone process independent of the web server. The supplied rc start-up script can be used to start iipsrv with the following default command line flags:

--bind 127.0.0.1:9111

This will start iipsrv in stand-alone (command line) mode listening on localhost (127.0.0.1) and port 9111 and will be configured to create a log file in /tmp/iipsrv.log.

You can optionally modify various settings by adding them to /etc/rc.conf. For example:

# /etc/rc.conf iipsrv start-up configuration

# Enable iipsrv at system startup
iipsrv_enable="YES"

# Specify IP address and port to bind to in stand-alone mode
iipsrv_flags="--bind 127.0.0.1:9000"

# Environment parameters file for iipsrv
iipsrv_config="/etc/iipsrv.conf"

The /etc/iipsrv.conf file should contain start-up environment variables for iipsrv as described in the server documentation. For example:

# /etc/iipsrv.conf
LOGFILE=/tmp/iipsrv.log
VERBOSITY=5
JPEG_QUALITY=90
MAX_CVT=1000

You can then start the IIPImage server process using the following command:

/usr/local/etc/rc.d/iipsrv start

If you have set iipsrv_enable to YES in /etc/rc.conf, iipsrv will starting automatically on system reboot.

Ports also makes it possible to easily run multiple simultaneous instances of iipsrv. This is useful, for example, if you want different iipsrv settings or you want to serve different file trees for different sites etc. To do this, you should specify each instance in /etc/rc.conf as in the following example:

iipsrv_instances="site1 site2" 
iipsrv_site1_flags="--bind 127.0.0.1:9111" 
iipsrv_site1_user="site1_chroot_user" 
iipsrv_site1_config="/usr/local/etc/iipsrv_site1.conf" 
iipsrv_site1_enable="YES" 
 
iipsrv_site2_flags="--bind 127.0.0.1:9112" 
iipsrv_site2_user="site2_chroot_user" 
iipsrv_site2_config="/usr/local/etc/iipsrv_site2.conf" 
iipsrv_site2_enable="YES"

Running iipsrv with a Web Server

The IIPImage server can also be started and managed directly by the Apache or Lighttpd web servers, rather than being run as an independent process.

Apache

For Apache, you will need to install an FCGI module and either mod_fcgid or mod_fastcgi can be used. To install with mod_fcgid:

sudo pkg install apache24 ap24-mod_fcgid

To enable the module, uncomment the following line in /usr/local/etc/apache24/http.conf

#LoadModule fastcgi_module libexec/apache24/mod_fcgid.so

Similarly to install with mod_fastcgi:

sudo pkg install apache24 ap24-mod_fastcgi

To enable the module, uncomment the following line in /usr/local/etc/apache24/http.conf

#LoadModule fastcgi_module libexec/apache24/mod_fastcgi.so

You will then need to configure Apache to manage iipsrv. See the Apache section of the iipsrv server documentation for more details.

Lighttpd

The Lighttpd web server includes FCGI support by default, so simply install:

sudo pkg install lighttpd

Then enable fastcgi in the modules configuration file (/usr/local/etc/lighttpd/modules.conf). You should then add the iipsrv directives to the Lighttpd FastCGI configuration file (/usr/local/etc/lighttpd/conf.d/fastcgi.conf). See the iipsrv server documentation for Lighttpd for more details.

Other Web Servers

For web servers such as NginX or Apache Java Tomcat, which cannot start FCGI processes themselves, you should start iipsrv in stand-alone mode as explained above and configure your server to point to the IP address and port configured for iipsrv. See the server documentation for NginX or for Tomcat for more details.