Home arrow Journal arrow Use a light http server for your appliance or home use
Use a light http server for your appliance or home use PDF
Thursday, 22 March 2012
If you need a very light http server for your appliance or home server where you do not need too many options/modules but just a simple http server there's mini_httpd:

  cd /usr/ports/www/mini_httpd
  make install clean


mini_httpd is so simple you can mess with it's source code and modify it to add new features.

Then you might want to change the path from where mini_httpd_config file will be loaded so instead of /usr/local/www/mini_httpd_config you will use /usr/local/etc/mini_httpd.conf:

  edit /usr/local/sbin/mini_httpd_wrapper

and change line that contains:

  /usr/local/sbin/mini_httpd -D -C /usr/local/www/mini_httpd_config

to

  /usr/local/sbin/mini_httpd -D -C /usr/local/etc/mini_httpd.conf

Your mini_httpd config file (which we named mini_httpd.conf) could look like this:

/usr/local/etc/mini_httpd.conf
port=8081
cgipat=**.cgi
user=root
data_dir=/home/user/public_html/
logfile=/var/log/mini_httpd.log
pidfile=/var/run/mini_httpd.pid
max_age=0


Errors you might get when starting mini_httpd
------------------------------------------------------


usr/local/etc/rc.d/mini_httpd.sh start
 mini_httpdovi# /usr/local/sbin/mini_httpd: unknown user - 'sh-httpd'

/usr/local/etc/rc.d/mini_httpd.sh stop
cat: /var/run/mini_httpd.pid: No such file or directory
usage: kill [-s signal_name] pid ...
       kill -l [exit_status]
       kill -signal_name pid ...
       kill -signal_number pid ...

You must configure mini_httpd.conf with an existing system user.


  /usr/local/sbin/mini_httpd: started as root without requesting chroot(), warning only

This is just a warning, you've configured mini_httpd to run as root user.


  bind: Address already in use
  /usr/local/sbin/mini_httpd: can't bind to any address


You must delete /var/run/mini_httpd.pid.

Last Updated ( Thursday, 22 March 2012 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?