summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormrxx2015-07-13 14:14:27 +0200
committermrxx2015-07-13 14:14:27 +0200
commit84a09cc426d74d91f52ef59b2e6fd68a23b3f744 (patch)
tree04763f4702b592e252c950055956731fb9de1d49
parent159d741318f677f4e0d817081344e298507da531 (diff)
downloadaur-84a09cc426d74d91f52ef59b2e6fd68a23b3f744.tar.gz
Moved CGI directory to /usr/lib/cgi-bin, added samples
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD14
-rw-r--r--bozohttpd.install18
-rw-r--r--bozohttpd.service8
-rw-r--r--sample.cgi7
-rw-r--r--sample_index.html5
-rw-r--r--sample_index.php1
-rw-r--r--sample_perl.cgi9
8 files changed, 35 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ad74f785e13..b832eb2b6a5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = bozohttpd
pkgdesc = A small and secure HTTP version 1.1 server
pkgver = 20150320
- pkgrel = 1
+ pkgrel = 2
url = http://www.eterna.com.au/bozohttpd/
install = bozohttpd.install
arch = i686
@@ -12,8 +12,8 @@ pkgbase = bozohttpd
source = http://www.eterna.com.au/bozohttpd/bozohttpd-20150320.tar.bz2
source = bozohttpd.service
source = bozohttpd.install
- source = sample_index.html
- source = sample_index.php
+ source = sample.cgi
+ source = sample_perl.cgi
md5sums = 60e2cf933d028a096523214fab8e6590
md5sums = SKIP
md5sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index e89ad1549d3..6f00987ff71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=bozohttpd
pkgver=20150320
-pkgrel=1
+pkgrel=2
pkgdesc="A small and secure HTTP version 1.1 server"
arch=('i686' 'x86_64')
url="http://www.eterna.com.au/bozohttpd/"
@@ -13,8 +13,8 @@ optdepends=('php-cgi')
source=("http://www.eterna.com.au/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
'bozohttpd.service'
'bozohttpd.install'
- 'sample_index.html'
- 'sample_index.php'
+ 'sample.cgi'
+ 'sample_perl.cgi'
)
md5sums=('60e2cf933d028a096523214fab8e6590'
'SKIP'
@@ -35,15 +35,11 @@ build()
package()
{
cd "${pkgname}-${pkgver}"
- mkdir -p "${pkgdir}"/usr/{bin,share/{${pkgname},man/man8}}
+ mkdir -p "${pkgdir}"/usr/{bin,lib/cgi-bin,share/{${pkgname},man/man8}}
install -D *.* testsuite/*.* testsuite/data/*.* "${pkgdir}/usr/share/${pkgname}/"
install -m755 bozohttpd "${pkgdir}/usr/bin/"
install -m644 bozohttpd.8 "${pkgdir}/usr/share/man/man8/"
cd "$srcdir"
install -Dm644 bozohttpd.service "${pkgdir}"/usr/lib/systemd/system/bozohttpd.service
- mkdir -p -m 755 "${pkgdir}"/srv/http/{www,cgi-bin}
- install -Dm644 sample_index.html "${pkgdir}/srv/http/www/"
- chown nobody.nobody "${pkgdir}/srv/http/www/sample_index.html"
- install -Dm644 sample_index.php "${pkgdir}/srv/http/www/"
- chown nobody.nobody "${pkgdir}/srv/http/www/sample_index.php"
+ install -D *.cgi "${pkgdir}/usr/lib/cgi-bin/"
}
diff --git a/bozohttpd.install b/bozohttpd.install
index 6303e629c78..557b93f2cda 100644
--- a/bozohttpd.install
+++ b/bozohttpd.install
@@ -1,20 +1,16 @@
post_install() {
- if [ ! -f "${pkgdir}"/srv/http/www/index.html ]; then
- ln -s "${pkgdir}"/srv/http/www/sample_index.html "${pkgdir}/srv/http/www/index.html"
- fi
- if [ ! -f "${pkgdir}"/srv/http/www/index.php ]; then
- ln -s "${pkgdir}"/srv/http/www/sample_index.php "${pkgdir}/srv/http/www/index.php"
- fi
+ [ ! -f /srv/http/index.html ] && echo "<html><body><h2>Server online.</h2></body></html>" >/srv/http/index.html
+ [ ! -f /srv/http/index.php ] && echo "<?php phpinfo(); ?>" >/srv/http/index.php
echo
echo "*** USAGE ***"
echo
- echo "Web server root is /srv/http/www ."
- echo "Use 'systemctl start bozohttpd.service' to start the web server."
- echo "Instructions on how to enable CGI and PHP support, dir indexing and much more"
- echo "are in /usr/lib/systemd/system/bozohttpd.service ."
+ echo "'systemctl start bozohttpd.service' starts the web server."
+ echo "Web server root is /srv/http. CGI dir is /usr/lib/cgi-bin."
+ echo "To enable CGI, PHP, and dir indexing"
+ echo "modify /usr/lib/systemd/system/bozohttpd.service ."
echo
}
post_upgrade() {
- post_install
+ post_install
}
diff --git a/bozohttpd.service b/bozohttpd.service
index d8bc001f017..d0c44911397 100644
--- a/bozohttpd.service
+++ b/bozohttpd.service
@@ -7,13 +7,13 @@ After=network.target
PIDFile=/run/bozohttpd.pid
StandardOutput=null
# Simplest use:
-ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid /srv/http/www
+ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid /srv/http
# Enable directory index:
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -X /srv/http/www
+#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -X /srv/http
# Enable CGI:
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -c /srv/http/cgi-bin /srv/http/www
+#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -c /usr/lib/cgi-bin /srv/http
# Enable PHP and set default to index.php (instead of index.html):
-#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -x index.php -C .php /usr/bin/php-cgi /srv/http/www
+#ExecStart=/usr/bin/bozohttpd -b -f -s -U nobody -P /run/bozohttpd.pid -x index.php -C .php /usr/bin/php-cgi /srv/http
[Install]
WantedBy=multi-user.target
diff --git a/sample.cgi b/sample.cgi
new file mode 100644
index 00000000000..529ab790f5d
--- /dev/null
+++ b/sample.cgi
@@ -0,0 +1,7 @@
+#!/bin/bash
+echo "Content-type: text/html"
+echo "<html>
+<body>
+<h2>CGI Bash Example</h2>
+</body>
+</html>"
diff --git a/sample_index.html b/sample_index.html
deleted file mode 100644
index e9a8b0f65e7..00000000000
--- a/sample_index.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-<h2>Server online.</h2>
-</body>
-</html>
diff --git a/sample_index.php b/sample_index.php
deleted file mode 100644
index 147cebcdd47..00000000000
--- a/sample_index.php
+++ /dev/null
@@ -1 +0,0 @@
-<?php phpinfo(); ?>
diff --git a/sample_perl.cgi b/sample_perl.cgi
new file mode 100644
index 00000000000..d13d651d9f1
--- /dev/null
+++ b/sample_perl.cgi
@@ -0,0 +1,9 @@
+#!/usr/bin/perl
+
+print "Content-type: text/html\n\n";
+print <<htmlcode;
+<html>
+<body>
+<h2>CGI Perl Example</h2>
+</body>
+htmlcode