From 27a3b01f9a5cd93e2cefb9bafed26a6ce404a0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Fri, 20 Sep 2013 16:17:48 -0300 Subject: PolarSSL and Hiawatha --- pcr/hiawatha/PKGBUILD | 117 +++++++++++++++++++++ pcr/hiawatha/cdcatalog.xml | 212 ++++++++++++++++++++++++++++++++++++++ pcr/hiawatha/cdcatalog.xslt | 24 +++++ pcr/hiawatha/hiawatha.conf.sample | 114 ++++++++++++++++++++ pcr/hiawatha/hiawatha.install | 37 +++++++ pcr/hiawatha/hiawatha.service | 16 +++ 6 files changed, 520 insertions(+) create mode 100644 pcr/hiawatha/PKGBUILD create mode 100644 pcr/hiawatha/cdcatalog.xml create mode 100644 pcr/hiawatha/cdcatalog.xslt create mode 100644 pcr/hiawatha/hiawatha.conf.sample create mode 100644 pcr/hiawatha/hiawatha.install create mode 100644 pcr/hiawatha/hiawatha.service (limited to 'pcr/hiawatha') 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 +# Contributor: Pascal Ernster + +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= The prefix for all other CMAKE_INSTALL directories. + # -DCMAKE_INSTALL_BINDIR= Location of the ssi-cgi binary. + # -DCMAKE_INSTALL_SBINDIR= Location of the other Hiawatha binaries. + # -DCMAKE_INSTALL_SYSCONFDIR= The configuration files will be installed in /hiawatha. + # -DCMAKE_INSTALL_LIBDIR= The PolarSSL shared library will be installed in /hiawatha. + # -DCMAKE_INSTALL_MANDIR= Manual pages will be installed in /man1. + # -DCONFIG_DIR= Location of the Hiawatha configuration files. + # -DLOG_DIR= Log directory used in the default hiawatha.conf. + # -DPID_DIR= Location of the Hiawatha and php-fcgi PID files. + # -DWEBROOT_DIR= Webroot directory used in the default hiawatha.conf. + # -DWORK_DIR= 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 @@ + + + + + Empire Burlesque + Bob Dylan + USA + Columbia + 10.90 + 1985 + + + Hide your heart + Bonnie Tyler + UK + CBS Records + 9.90 + 1988 + + + Greatest Hits + Dolly Parton + USA + RCA + 9.90 + 1982 + + + Still got the blues + Gary Moore + UK + Virgin records + 10.20 + 1990 + + + Eros + Eros Ramazzotti + EU + BMG + 9.90 + 1997 + + + One night only + Bee Gees + UK + Polydor + 10.90 + 1998 + + + Sylvias Mother + Dr.Hook + UK + CBS + 8.10 + 1973 + + + Maggie May + Rod Stewart + UK + Pickwick + 8.50 + 1990 + + + Romanza + Andrea Bocelli + EU + Polydor + 10.80 + 1996 + + + When a man loves a woman + Percy Sledge + USA + Atlantic + 8.70 + 1987 + + + Black angel + Savage Rose + EU + Mega + 10.90 + 1995 + + + 1999 Grammy Nominees + Many + USA + Grammy + 10.20 + 1999 + + + For the good times + Kenny Rogers + UK + Mucik Master + 8.70 + 1995 + + + Big Willie style + Will Smith + USA + Columbia + 9.90 + 1997 + + + Tupelo Honey + Van Morrison + UK + Polydor + 8.20 + 1971 + + + Soulsville + Jorn Hoel + Norway + WEA + 7.90 + 1996 + + + The very best of + Cat Stevens + UK + Island + 8.90 + 1990 + + + Stop + Sam Brown + UK + A and M + 8.90 + 1988 + + + Bridge of Spies + T`Pau + UK + Siren + 7.90 + 1987 + + + Private Dancer + Tina Turner + UK + Capitol + 8.90 + 1983 + + + Midt om natten + Kim Larsen + EU + Medley + 7.80 + 1983 + + + Pavarotti Gala Concert + Luciano Pavarotti + UK + DECCA + 9.90 + 1991 + + + The dock of the bay + Otis Redding + USA + Atlantic + 7.90 + 1987 + + + Picture book + Simply Red + EU + Elektra + 7.20 + 1985 + + + Red + The Communards + UK + London + 7.80 + 1987 + + + Unchain my heart + Joe Cocker + USA + EMI + 8.20 + 1987 + + 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 @@ + + + + + + +

My CD Collection

+ + + + + + + + + + + +
TitleArtist
+ + +
+
\ 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 <