summaryrefslogtreecommitdiff
path: root/pcr/hiawatha
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/hiawatha')
-rw-r--r--pcr/hiawatha/PKGBUILD117
-rw-r--r--pcr/hiawatha/cdcatalog.xml212
-rw-r--r--pcr/hiawatha/cdcatalog.xslt24
-rw-r--r--pcr/hiawatha/hiawatha.conf.sample114
-rw-r--r--pcr/hiawatha/hiawatha.install37
-rw-r--r--pcr/hiawatha/hiawatha.service16
6 files changed, 520 insertions, 0 deletions
diff --git a/pcr/hiawatha/PKGBUILD b/pcr/hiawatha/PKGBUILD
new file mode 100644
index 000000000..1ea4d6435
--- /dev/null
+++ b/pcr/hiawatha/PKGBUILD
@@ -0,0 +1,117 @@
+# Maintainer: Kurt Marasco <celilo _at_ lavabit _dot_ com>
+# Contributor: Pascal Ernster <aur at hardfalcon dot net>
+
+pkgname=hiawatha
+pkgver=9.2
+pkgrel=1
+pkgdesc="Secure and advanced webserver"
+url="https://www.hiawatha-webserver.org/"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('libxslt' 'polarssl')
+optdepends=('php-fpm: Provides modern PHP fast cgi support (Recommended) ')
+makedepends=('cmake')
+install=$pkgname.install
+backup=(
+ usr/lib/systemd/system/hiawatha.service
+ etc/hiawatha/hiawatha.conf
+ etc/hiawatha/hiawatha.conf.sample
+ etc/hiawatha/cgi-wrapper.conf
+ etc/hiawatha/mimetype.conf
+ srv/http/hiawatha/cdcatalog.xml
+ srv/http/hiawatha/cdcatalog.xslt
+)
+
+source=(
+ "http://hiawatha-webserver.org/files/${pkgname}-${pkgver}.tar.gz"
+ 'hiawatha.conf.sample'
+ 'cdcatalog.xml'
+ 'cdcatalog.xslt'
+ 'hiawatha.service'
+ 'hiawatha.install'
+)
+sha256sums=(
+ '5d9cdec51c618bb3efab747030e593d9bd49dfaf3236254c8e0cb60715716dbf'
+ '4671d2586cbe3cd6497b16ff422c6143cdab40641ef3c9c4988c478351a8f5e7'
+ '7757d6e5fe363b917a2823ba8b5194509ed6914e7c088d04ae72f9bd73efcb58'
+ 'f28aa336da6f0fb124a1092039e695d233569cb32632223f786603ffb6ed5471'
+ 'fb789b12bb6246237b15a9244f58317abdd53e5ca4eb55880e40a498b2237155'
+ '3b60a884102a6212a4963c041dd2a5a32fb18833f758e9be5d021bbc630ed627'
+)
+
+build() {
+ cd "$srcdir/${pkgname}-${pkgver}"
+
+ cmake . -DCMAKE_INSTALL_PREFIX="/" \
+ -DCMAKE_INSTALL_BINDIR="/usr/bin" \
+ -DCMAKE_INSTALL_SBINDIR="/usr/bin" \
+ -DCMAKE_INSTALL_SYSCONFDIR="/etc/hiawatha" \
+ -DCMAKE_INSTALL_LIBDIR="/usr/lib" \
+ -DCMAKE_INSTALL_MANDIR="/usr/share/man" \
+ -DCONFIG_DIR="/etc/hiawatha" \
+ -DLOG_DIR="/var/log/hiawatha" \
+ -DPID_DIR="/run" \
+ -DENABLE_SSL=ON \
+ -DUSE_SYSTEM_POLARSSL=on \
+ -DWEBROOT_DIR="/srv/http" \
+ -DWORK_DIR="/var/lib/hiawatha"
+ make
+
+ # The default capabilities are installed by this PKGBUILD
+ # The following build options are available to customize your installation:
+ # modify the above cmake command to customize
+ #option description required libraries when feature enabled
+ # cmake options
+ # -DENABLE_CACHE=ON|off Enable internal cache support.
+ # -DENABLE_DEBUG=on|OFF Enable debug information (for development only).
+ # -DENABLE_IPV6=ON|off Enable IPv6 support.
+ # -DENABLE_MONITOR=on|OFF Enable support for the Hiawatha Monitor.
+ # -DENABLE_RPROXY=ON|off Enable reverse proxy support.
+ # -DENABLE_SSL=ON|off Enable SSL (PolarSSL) support.
+ # -DENABLE_TOMAHAWK=on|OFF Enable Tomahawk, Hiawatha command shell.
+ # -DENABLE_TOOLKIT=ON|off Enable the URL Toolkit.
+ # -DENABLE_XSLT=ON|off Enable XSLT support. libxml2, libxslt1
+ # -DUSE_SYSTEM_POLARSSL=on|OFF Compile Hiawatha against the system's PolarSSL library (>=1.2.0).
+
+ # The following path settings are available for CMake.
+ # -DCMAKE_INSTALL_PREFIX=<path> The prefix for all other CMAKE_INSTALL directories.
+ # -DCMAKE_INSTALL_BINDIR=<path> Location of the ssi-cgi binary.
+ # -DCMAKE_INSTALL_SBINDIR=<path> Location of the other Hiawatha binaries.
+ # -DCMAKE_INSTALL_SYSCONFDIR=<path> The configuration files will be installed in /hiawatha.
+ # -DCMAKE_INSTALL_LIBDIR=<path> The PolarSSL shared library will be installed in /hiawatha.
+ # -DCMAKE_INSTALL_MANDIR=<path> Manual pages will be installed in /man1.
+ # -DCONFIG_DIR=<path> Location of the Hiawatha configuration files.
+ # -DLOG_DIR=<path> Log directory used in the default hiawatha.conf.
+ # -DPID_DIR=<path> Location of the Hiawatha and php-fcgi PID files.
+ # -DWEBROOT_DIR=<path> Webroot directory used in the default hiawatha.conf.
+ # -DWORK_DIR=<path> Path of directory where Hiawatha can write temporary files.
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir/" install
+
+ # Fix hiawatha.conf (formerly httpd.conf)
+ sed -e 's|#ServerId = www-data|ServerId = http|' \
+ -e 's|/var/www/|/srv/http/|g' \
+ -e 's|//|/|g' \
+ -e 's|#CGIextension = cgi|&\n#TriggerOnCGIstatus = yes|g' \
+ -e 's|ConnectTo = 127.0.0.1:2005|ConnectTo = 127.0.0.1:9000|g' \
+ -e 's|# Extension = php|&\n# SessionTimeout = 30|g' \
+ -e 's|#ErrorHandler = 404:/error.cgi|&\n#UseGZfile = yes|g' \
+ -i "$pkgdir/etc/hiawatha/hiawatha.conf"
+
+ # Fix hiawatha logrotate file (/etc/logrotate.d/hiawatha)
+ sed -e 's|www-data|http|g' -i "$srcdir/$pkgname-$pkgver/logrotate.d/hiawatha"
+ mkdir "$pkgdir/etc/logrotate.d"
+ install -m644 "$srcdir/$pkgname-$pkgver/logrotate.d/hiawatha" "$pkgdir/etc/logrotate.d/hiawatha"
+
+ # Add startup scripts
+ install -D -m755 "$srcdir/hiawatha.service" "$pkgdir/usr/lib/systemd/system/hiawatha.service"
+
+ # Install sample configuration implementing a virtual server for phpmyadmin, php-fpm, and a default website on localhost
+ install -m644 "$srcdir/hiawatha.conf.sample" "$pkgdir/etc/hiawatha/"
+ # Install sample XSLT transformation on default website on localhost
+ install -m644 "$srcdir/cdcatalog.xml" "$pkgdir/srv/http"
+ install -m644 "$srcdir/cdcatalog.xslt" "$pkgdir/srv/http"
+}
diff --git a/pcr/hiawatha/cdcatalog.xml b/pcr/hiawatha/cdcatalog.xml
new file mode 100644
index 000000000..efc35f9ff
--- /dev/null
+++ b/pcr/hiawatha/cdcatalog.xml
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- Edited with XML Spy v4.2 -->
+<catalog>
+ <cd>
+ <title>Empire Burlesque</title>
+ <artist>Bob Dylan</artist>
+ <country>USA</country>
+ <company>Columbia</company>
+ <price>10.90</price>
+ <year>1985</year>
+ </cd>
+ <cd>
+ <title>Hide your heart</title>
+ <artist>Bonnie Tyler</artist>
+ <country>UK</country>
+ <company>CBS Records</company>
+ <price>9.90</price>
+ <year>1988</year>
+ </cd>
+ <cd>
+ <title>Greatest Hits</title>
+ <artist>Dolly Parton</artist>
+ <country>USA</country>
+ <company>RCA</company>
+ <price>9.90</price>
+ <year>1982</year>
+ </cd>
+ <cd>
+ <title>Still got the blues</title>
+ <artist>Gary Moore</artist>
+ <country>UK</country>
+ <company>Virgin records</company>
+ <price>10.20</price>
+ <year>1990</year>
+ </cd>
+ <cd>
+ <title>Eros</title>
+ <artist>Eros Ramazzotti</artist>
+ <country>EU</country>
+ <company>BMG</company>
+ <price>9.90</price>
+ <year>1997</year>
+ </cd>
+ <cd>
+ <title>One night only</title>
+ <artist>Bee Gees</artist>
+ <country>UK</country>
+ <company>Polydor</company>
+ <price>10.90</price>
+ <year>1998</year>
+ </cd>
+ <cd>
+ <title>Sylvias Mother</title>
+ <artist>Dr.Hook</artist>
+ <country>UK</country>
+ <company>CBS</company>
+ <price>8.10</price>
+ <year>1973</year>
+ </cd>
+ <cd>
+ <title>Maggie May</title>
+ <artist>Rod Stewart</artist>
+ <country>UK</country>
+ <company>Pickwick</company>
+ <price>8.50</price>
+ <year>1990</year>
+ </cd>
+ <cd>
+ <title>Romanza</title>
+ <artist>Andrea Bocelli</artist>
+ <country>EU</country>
+ <company>Polydor</company>
+ <price>10.80</price>
+ <year>1996</year>
+ </cd>
+ <cd>
+ <title>When a man loves a woman</title>
+ <artist>Percy Sledge</artist>
+ <country>USA</country>
+ <company>Atlantic</company>
+ <price>8.70</price>
+ <year>1987</year>
+ </cd>
+ <cd>
+ <title>Black angel</title>
+ <artist>Savage Rose</artist>
+ <country>EU</country>
+ <company>Mega</company>
+ <price>10.90</price>
+ <year>1995</year>
+ </cd>
+ <cd>
+ <title>1999 Grammy Nominees</title>
+ <artist>Many</artist>
+ <country>USA</country>
+ <company>Grammy</company>
+ <price>10.20</price>
+ <year>1999</year>
+ </cd>
+ <cd>
+ <title>For the good times</title>
+ <artist>Kenny Rogers</artist>
+ <country>UK</country>
+ <company>Mucik Master</company>
+ <price>8.70</price>
+ <year>1995</year>
+ </cd>
+ <cd>
+ <title>Big Willie style</title>
+ <artist>Will Smith</artist>
+ <country>USA</country>
+ <company>Columbia</company>
+ <price>9.90</price>
+ <year>1997</year>
+ </cd>
+ <cd>
+ <title>Tupelo Honey</title>
+ <artist>Van Morrison</artist>
+ <country>UK</country>
+ <company>Polydor</company>
+ <price>8.20</price>
+ <year>1971</year>
+ </cd>
+ <cd>
+ <title>Soulsville</title>
+ <artist>Jorn Hoel</artist>
+ <country>Norway</country>
+ <company>WEA</company>
+ <price>7.90</price>
+ <year>1996</year>
+ </cd>
+ <cd>
+ <title>The very best of</title>
+ <artist>Cat Stevens</artist>
+ <country>UK</country>
+ <company>Island</company>
+ <price>8.90</price>
+ <year>1990</year>
+ </cd>
+ <cd>
+ <title>Stop</title>
+ <artist>Sam Brown</artist>
+ <country>UK</country>
+ <company>A and M</company>
+ <price>8.90</price>
+ <year>1988</year>
+ </cd>
+ <cd>
+ <title>Bridge of Spies</title>
+ <artist>T`Pau</artist>
+ <country>UK</country>
+ <company>Siren</company>
+ <price>7.90</price>
+ <year>1987</year>
+ </cd>
+ <cd>
+ <title>Private Dancer</title>
+ <artist>Tina Turner</artist>
+ <country>UK</country>
+ <company>Capitol</company>
+ <price>8.90</price>
+ <year>1983</year>
+ </cd>
+ <cd>
+ <title>Midt om natten</title>
+ <artist>Kim Larsen</artist>
+ <country>EU</country>
+ <company>Medley</company>
+ <price>7.80</price>
+ <year>1983</year>
+ </cd>
+ <cd>
+ <title>Pavarotti Gala Concert</title>
+ <artist>Luciano Pavarotti</artist>
+ <country>UK</country>
+ <company>DECCA</company>
+ <price>9.90</price>
+ <year>1991</year>
+ </cd>
+ <cd>
+ <title>The dock of the bay</title>
+ <artist>Otis Redding</artist>
+ <country>USA</country>
+ <company>Atlantic</company>
+ <price>7.90</price>
+ <year>1987</year>
+ </cd>
+ <cd>
+ <title>Picture book</title>
+ <artist>Simply Red</artist>
+ <country>EU</country>
+ <company>Elektra</company>
+ <price>7.20</price>
+ <year>1985</year>
+ </cd>
+ <cd>
+ <title>Red</title>
+ <artist>The Communards</artist>
+ <country>UK</country>
+ <company>London</company>
+ <price>7.80</price>
+ <year>1987</year>
+ </cd>
+ <cd>
+ <title>Unchain my heart</title>
+ <artist>Joe Cocker</artist>
+ <country>USA</country>
+ <company>EMI</company>
+ <price>8.20</price>
+ <year>1987</year>
+ </cd>
+</catalog>
diff --git a/pcr/hiawatha/cdcatalog.xslt b/pcr/hiawatha/cdcatalog.xslt
new file mode 100644
index 000000000..db9cc35bc
--- /dev/null
+++ b/pcr/hiawatha/cdcatalog.xslt
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- Edited with XML Spy v4.2 -->
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+ <html>
+ <body>
+ <h2>My CD Collection</h2>
+ <table border="1">
+ <tr bgcolor="#9acd32">
+ <th align="left">Title</th>
+ <th align="left">Artist</th>
+ </tr>
+ <xsl:for-each select="catalog/cd">
+ <tr>
+ <td><xsl:value-of select="title"/></td>
+ <td><xsl:value-of select="artist"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+</xsl:stylesheet> \ No newline at end of file
diff --git a/pcr/hiawatha/hiawatha.conf.sample b/pcr/hiawatha/hiawatha.conf.sample
new file mode 100644
index 000000000..1c1d62450
--- /dev/null
+++ b/pcr/hiawatha/hiawatha.conf.sample
@@ -0,0 +1,114 @@
+# Hiawatha main configuration file
+# This is a basic sample configuration file that sets up a:
+# 1) Default web site at /srv/http/hiawatha (Note: fast CGI is not active on default site)
+# 2) Virtual host for phpmyadmin at /srv/http/phpMyAdmin
+# note: you must install phpmyadmin, mysql, php-mcrypt, and php-cgi separately. Be sure that extensions
+# mcrypt.so and mysql.so are enabled in your php.ini.
+# Also add phpmyadmin to your hosts file
+# 3) FastCGI server
+
+
+# GENERAL SETTINGS
+ServerId = http
+ConnectionsTotal = 150
+ConnectionsPerIP = 10
+SystemLogfile = /var/log/hiawatha/system.log
+GarbageLogfile = /var/log/hiawatha/garbage.log
+
+
+# BINDING SETTINGS
+# A binding is where a client can connect to.
+#
+Binding {
+ Port = 80
+}
+
+
+
+### The following fast CGI daemons require php-fpm using a UNIX socket and TCP port, respectively.
+# ACTIVATE a FastCGI server for php (using UNIX socket)
+FastCGIserver {
+ FastCGIid = PHP5
+ ConnectTo = /run/php-fpm/php-fpm.sock
+ Extension = php
+ SessionTimeout = 30
+}
+
+# ACTIVATE a FastCGI server for php (using IP-address and TCP port)
+#FastCGIserver {
+# FastCGIid = PHP5
+# ConnectTo = 127.0.0.1:9000
+# Extension = php
+# SessionTimeout = 30
+#}
+
+
+# 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 = /srv/http/hiawatha
+StartFile = index.html
+AccessLogfile = /var/log/hiawatha/access.log
+ErrorLogfile = /var/log/hiawatha/error.log
+#ErrorHandler = 404:/error.cgi
+UseXSLT = yes
+
+
+# VIRTUAL HOSTS
+VirtualHost {
+
+ # If you set WebsiteRoot to /usr/share/webapps/phpMyAdmin you don't need followsymlinks
+ # I symlinked the phpMyAdmin folder to '/srv/http/phpMyAdmin' so that I can easily remember where it's located but
+ # still set 'WebsiteRoot' to the real source directory. You could point WebsiteRoot to the
+ # symlinked directory, but you will have to set 'FollowSymlinks = yes' for that to function properly
+
+ #FollowSymlinks = yes
+ #WebsiteRoot = /srv/http/phpMyAdmin
+ WebsiteRoot = /usr/share/webapps/phpMyAdmin
+ Hostname = phpmyadmin
+ AccessLogfile = /var/log/hiawatha/phpmyadmin/access.log
+ ErrorLogfile = /var/log/hiawatha/phpmyadmin/error.log
+ StartFile = index.php
+ UseFastCGI = PHP5
+
+}
+
+# Add some more
+
+#VirtualHost {
+# Hostname = www.my-domain.com
+# WebsiteRoot = /svr/http/my-domain/public
+# StartFile = index.php
+# AccessLogfile = /svr/http/my-domain/log/access.log
+# ErrorLogfile = /svr/http/my-domain/log/error.log
+# TimeForCGI = 5
+# UseFastCGI = PHP5
+# UseToolkit = banshee
+#}
+
+
+#Additional settings for monitoring
+
+UrlToolkit {
+ ToolkitID = banshee
+ RequestURI isfile Return
+ Match ^/(css|files|images|js)/ Return
+ Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
+ Match .*\?(.*) Rewrite /index.php?$1
+ Match .* Rewrite /index.php
+}
+
+VirtualHost {
+ Hostname = monitor.domain.com
+ WebsiteRoot = /svr/http/monitor/public
+ AccessLogfile = /svr/http/monitor/logfiles/access.log
+ ErrorLogfile = /svr/http/monitor/logfiles/error.log
+ StartFile = index.php
+# ExecuteCGI = yes
+ UseFastCGI = PHP5 # Use if you use PHP as a FastCGI daemon
+ TimeForCGI = 15
+ UseToolkit = banshee
+}
diff --git a/pcr/hiawatha/hiawatha.install b/pcr/hiawatha/hiawatha.install
new file mode 100644
index 000000000..0ea96ec65
--- /dev/null
+++ b/pcr/hiawatha/hiawatha.install
@@ -0,0 +1,37 @@
+pre_install() {
+ /bin/cat <<THEENDPOSTINSTALL
+NOTE
+----
+If you are new to Hiawatha, please refer to http://www.hiawatha-webserver.org/howto
+
+!!!!! This PKGBUILD compiles against the system's PolarSSL library. You will need to install PolarSSL from the AUR.!!!!
+
+THEENDPOSTINSTALL
+}
+
+pre_upgrade() {
+ /bin/cat <<THEENDPOSTINSTALL
+NOTE
+----
+If you are new to Hiawatha, please refer to http://www.hiawatha-webserver.org/howto
+
+!!!!! This PKGBUILD compiles against the system's PolarSSL library. You will need to install PolarSSL from the AUR.!!!!
+
+THEENDPOSTINSTALL
+}
+
+post_install() {
+ /bin/cat <<THEENDPOSTINSTALL
+NOTE
+----
+If you are new to Hiawatha, please refer to http://www.hiawatha-webserver.org/howto
+
+PHP-FPM is the prefered fastcgi server. To install.
+ pacman -Sy php-fpm
+ systemctl enable php-fpm
+
+The file hiawatha.conf.sample demonstrates syntax appropriate for use with the php-fpm fast cgi daemon.
+THEENDPOSTINSTALL
+}
+
+
diff --git a/pcr/hiawatha/hiawatha.service b/pcr/hiawatha/hiawatha.service
new file mode 100644
index 000000000..f7daeb8c7
--- /dev/null
+++ b/pcr/hiawatha/hiawatha.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Hiawatha Web Server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=simple
+SyslogIdentifier=hiawatha
+ExecStartPre=/usr/bin/hiawatha -k ; /usr/bin/wigwam
+ExecStart= /usr/bin/hiawatha -d
+TimeoutSec=10
+#(doesn't like this setting. Can't find files) PrivateTmp=true
+LimitNOFILE=infinity
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_SETGID CAP_SETUID
+
+[Install]
+WantedBy=multi-user.target