hello, i tested this patch on a wr703n, added dep on polarssl and menuconfig options for CACHE, RPROXY, SSL, TOOLKIT and XSLT. i appreciate if you guys can review it, thanks!
Signed-off-by: Daniel Petre <[email protected]> --- Index: files/php-fcgi.conf =================================================================== --- files/php-fcgi.conf (revision 0) +++ files/php-fcgi.conf (revision 0) @@ -0,0 +1,23 @@ +# PHP FastCGI configuration + +# Path to PID-file. +# PidFile = <filename> +# +PidFile = /var/run/php-fcgi.pid + +# Number of maximum requests per fork before respawning. +# MaxRequests = <number> +# +MaxRequests = 100 + +# Set environment variables for the FastCGI processes. +# Setenv <key> = <value> +# + +# PHP FastCGI servers to start. +# Server = <php-cgi executable>;<forks>;<binding>;<UID>[:<GIDs>][;<PHP configuration file>] +# +#Server = /usr/bin/php5-cgi ; 3 ; /var/lib/hiawatha/php-fcgi.sock ; www-data +#Server = /usr/bin/php5-cgi ; 2 ; 127.0.0.1:2005 ; 1000:100,101 +#Server = /usr/bin/php5-cgi ; 3 ; 127.0.0.1:2005 ; www-data ; /etc/php5/cgi/php.ini +#Server = /usr/chroot|usr/bin/php5-cgi ; 1 ; 127.0.0.1:2005 ; www-data Index: files/hiawatha.init =================================================================== --- files/hiawatha.init (revision 0) +++ files/hiawatha.init (revision 0) @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +SERVICE_USE_PID=1 + +START=50 + +start() { + mkdir -m 0755 -p /var/log/hiawatha + mkdir -m 0755 -p /var/lib/hiawatha + service_start /usr/sbin/hiawatha -c /etc/hiawatha/ +} + +stop() { + service_stop /usr/sbin/hiawatha +} + Index: files/hiawatha.conf =================================================================== --- files/hiawatha.conf (revision 0) +++ files/hiawatha.conf (revision 0) @@ -0,0 +1,107 @@ +# Hiawatha main configuration file +# +# GENERAL SETTINGS +# +#ServerId = www-data +ConnectionsTotal = 150 +ConnectionsPerIP = 10 +LogFormat = common +SystemLogfile = /var/log/hiawatha/system.log +GarbageLogfile = /var/log/hiawatha/garbage.log +ExploitLogfile = /var/log/hiawatha/exploit.log +# BINDING SETTINGS +# A binding is where a client can connect to. +# +Binding { + Port = 80 +# Interface = 127.0.0.1 +# MaxKeepAlive = 30 +# TimeForRequest = 3,20 +} +# +#Binding { +# Port = 443 +# Interface = ::1 +# MaxKeepAlive = 30 +# TimeForRequest = 3,20 +# SSLcertFile = /etc/hiawatha/hiawatha.pem +#} + + +# BANNING SETTINGS +# Deny service to clients who misbehave. +# +#BanOnGarbage = 300 +#BanOnMaxPerIP = 60 +#BanOnMaxReqSize = 300 +#KickOnBan = yes +#RebanDuringBan = yes + + +# COMMON GATEWAY INTERFACE (CGI) SETTINGS +# These settings can be used to run CGI applications. Use the 'php-fcgi' +# tool to start PHP as a FastCGI daemon. +# +#CGIhandler = /usr/bin/perl:pl +#CGIhandler = /usr/bin/php-cgi:php +#CGIhandler = /usr/bin/python:py +#CGIhandler = /usr/bin/ruby:rb +#CGIhandler = /usr/bin/ssi-cgi:shtml +#CGIextension = cgi +# +#FastCGIserver { +# FastCGIid = PHP5 +# ConnectTo = 127.0.0.1:2005 +# Extension = php +#} + + +# URL TOOLKIT +# This URL toolkit rule was made for the Banshee PHP framework, which +# can be downloaded from http://www.hiawatha-webserver.org/banshee +# +#UrlToolkit { +# ToolkitID = banshee +# RequestURI isfile Return +# Match ^/(css|files|images|js|slimstat)($|/) Return +# Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return +# Match .*\?(.*) Rewrite /index.php?$1 +# Match .* Rewrite /index.php +#} + +# DEFAULT WEBSITE +# It is wise to use your IP address as the hostname of the default website +# and give it a blank webpage. By doing so, automated webscanners won't find +# your possible vulnerable website. +# +Hostname = 127.0.0.1 +WebsiteRoot = /www +StartFile = index.html +AccessLogfile = /var/log/hiawatha/access.log +ErrorLogfile = /var/log/hiawatha/error.log +#ErrorHandler = 404:/error.cgi + + +# VIRTUAL HOSTS +# Use a VirtualHost section to declare the websites you want to host. +# +#VirtualHost { +# Hostname = www.my-domain.com +# WebsiteRoot = /var/www/my-domain/public +# StartFile = index.php +# AccessLogfile = /var/www/my-domain/log/access.log +# ErrorLogfile = /var/www/my-domain/log/error.log +# TimeForCGI = 5 +# UseFastCGI = PHP5 +# UseToolkit = banshee +#} + + +# DIRECTORY SETTINGS +# You can specify some settings per directory. +# +#Directory { +# Path = /home/baduser +# ExecuteCGI = no +# UploadSpeed = 10,2 +#} Index: files/mimetype.conf =================================================================== --- files/mimetype.conf (revision 0) +++ files/mimetype.conf (revision 0) @@ -0,0 +1,91 @@ +# Application +# +application/json json +application/pdf pdf +application/pkcs-crl crl +application/postscript ps ai eps +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/xml xml xsl xslt +application/x-binary bin +application/x-bzip2 bz2 +application/x-debian-package deb +application/x-dvi dvi +application/x-gzip gz +application/x-java-archive jar +application/x-java-vm class +application/x-latex latex +application/x-msdos-program com exe bat dll +application/x-redhat-packet-manager rpm +application/x-shockwave-flash swf swfl +application/x-sh sh +application/x-tar tgz tar +application/x-trash bak old +application/x-x509-ca-cert crt cer pem +application/zip zip + +# Application / Office +# +application/excel xls xlb xlc xlt +application/msaccess mdb +application/msword doc dot +application/powerpoint ppt pps pot +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.text odt + +# Audio +# +audio/basic au snd +audio/midi mid midi rmi +audio/mp4a-latm m4a m4b m4p +audio/mpeg mp3 m4a +audio/ogg ogg +audio/x-aac aac +audio/x-wav wav + +# Image +# +image/bmp bmp +image/gif gif +image/jpeg jpg jpeg jpe +image/pcx pcx +image/png png +image/svg+xml svg svgz +image/tiff tiff tif +image/vnd.nok-oplogo-color nol +image/x-icon ico + +# Text +# +text/cache-manifest cache +text/calendar ics +text/css css +text/html htm html xhtml +text/javascript js +text/plain asc txt text diff h java log +text/richtext rtf +text/vnd.wap.wml wml +text/x-c c h +text/x-c++src c++ cpp cxx cc +text/x-pascal p pas +text/x-tcl tcl tk +text/x-tex tex ltx sty cls + +# Video +# +video/3gpp 3gp 3gpp amr +video/avi avi +video/mpeg mpeg mpg mpe mp2 +video/mp4 mp4 +video/quicktime qt mov +video/flv flv +video/x-ms-asf asf asr asx + +# Virtual reality +# +x-world/x-vrml flr vrm vrml wrl wrz xaf xof Index: Makefile =================================================================== --- Makefile (revision 32266) +++ Makefile (working copy) @@ -8,56 +8,131 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hiawatha -PKG_VERSION:=7.8.2 -PKG_RELEASE:=3 +PKG_VERSION:=8.4 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.hiawatha-webserver.org/files/ -PKG_MD5SUM:=8aff3f8c759871ea1d1ff22e98030332 +PKG_MD5SUM:=d190691e15efbd80cd751ec2d5705c58 PKG_CONFIG_DEPENDS:= \ CONFIG_IPV6 \ PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/hiawatha CATEGORY:=Network SECTION:=net SUBMENU:=Web Servers/Proxies - TITLE:=A very lightweight web server + TITLE:=A very light and secure web server by Hugo Leisink URL:=http://www.hiawatha-webserver.org/ - MAINTAINER:=Raphaƫl HUCK <[email protected]> - DEPENDS:=+libpthread +zlib + MAINTAINER:=Daniel Petre <[email protected]> + DEPENDS:=+libpthread +zlib +HIAWATHA_SSL:libpolarssl + MENU:=1 endef define Package/hiawatha/description Hiawatha is an open source webserver with a focus on security. endef -CONFIGURE_ARGS+= \ - $(call autoconf_bool,CONFIG_IPV6,ipv6) \ - --disable-cache \ - --disable-monitor \ - --disable-ssl \ - --disable-xslt +define Package/hiawatha/config +config HIAWATHA_CACHE + bool "Cache support" + depends on PACKAGE_hiawatha + default n + help + Cache support. +config HIAWATHA_RPROXY + bool "Reverse proxy support" + depends on PACKAGE_hiawatha + default n + help + Reverse proxy support. +config HIAWATHA_SSL + bool "SSL support with polarssl" + depends on PACKAGE_hiawatha + default n + help + Implements SSL support in hiawatha (using libpolarssl). This + option is required if you enable the SSL engine in your + hiawatha configuration file. +config HIAWATHA_TOOLKIT + bool "Toolkit support for url rewriting and different acls" + depends on PACKAGE_hiawatha + default y + help + Toolkit support for url rewriting and different acls. +config HIAWATHA_XSLT + bool "XSLT support" + depends on PACKAGE_hiawatha + default n + help + XSLT support. +endef -CONFIGURE_VARS+= \ - ac_cv_file__dev_urandom=yes \ - webrootdir=/www +CMAKE_OPTIONS+= \ + -DENABLE_MONITOR=OFF \ + -DENABLE_DEBUG=OFF \ + -DENABLE_CHROOT=OFF \ + -DCONFIG_DIR=/etc/hiawatha \ + -DPID_DIR=/var/run \ + -DWORK_DIR=/var/lib/hiawatha \ + -DWEBROOT_DIR=/www \ + -DSBIN_DIR=/usr/sbin \ +ifneq ($(strip $(CONFIG_HIAWATHA_SSL)),) + CMAKE_OPTIONS+= \ + -DENABLE_SSL=ON +else + CMAKE_OPTIONS+= \ + -DENABLE_SSL=OFF +endif +ifneq ($(strip $(CONFIG_HIAWATHA_TOOLKIT)),) + CMAKE_OPTIONS+= \ + -DENABLE_TOOLKIT=ON +else + CMAKE_OPTIONS+= \ + -DENABLE_TOOLKIT=OFF +endif +ifneq ($(strip $(CONFIG_HIAWATHA_RPROXY)),) + CMAKE_OPTIONS+= \ + -DENABLE_RPROXY=ON +else + CMAKE_OPTIONS+= \ + -DENABLE_RPROXY=OFF +endif +ifneq ($(strip $(CONFIG_HIAWATHA_XSLT)),) + CMAKE_OPTIONS+= \ + -DENABLE_XSLT=ON +else + CMAKE_OPTIONS+= \ + -DENABLE_XSLT=OFF +endif +ifneq ($(strip $(CONFIG_HIAWATHA_CACHE)),) + CMAKE_OPTIONS+= \ + -DENABLE_CACHE=ON +else + CMAKE_OPTIONS+= \ + -DENABLE_CACHE=OFF +endif + define Package/hiawatha/conffiles /etc/hiawatha/hiawatha.conf /etc/hiawatha/mimetype.conf +/etc/hiawatha/php-fcgi.conf endef define Package/hiawatha/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/hiawatha $(1)/usr/sbin/ - + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{hiawatha,php-fcgi} $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/hiawatha - $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/hiawatha/{hiawatha,mimetype}.conf $(1)/etc/hiawatha/ + $(INSTALL_BIN) ./files/{hiawatha,mimetype,php-fcgi}.conf $(1)/etc/hiawatha + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/hiawatha.init $(1)/etc/init.d/hiawatha endef - $(eval $(call BuildPackage,hiawatha)) _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
