diff --git a/etcs/hostapd/hostapd.conf b/etcs/hostapd/hostapd/hostapd.conf similarity index 81% rename from etcs/hostapd/hostapd.conf rename to etcs/hostapd/hostapd/hostapd.conf index 07bd7dd..81b6bf7 100644 --- a/etcs/hostapd/hostapd.conf +++ b/etcs/hostapd/hostapd/hostapd.conf @@ -6,4 +6,4 @@ wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP ssid=TeraHz -wpa_passphrase=terahertz +wpa_passphrase=teraherc diff --git a/etcs/hostapd/hostapd/ifupdown.sh b/etcs/hostapd/hostapd/ifupdown.sh new file mode 100644 index 0000000..c5d2357 --- /dev/null +++ b/etcs/hostapd/hostapd/ifupdown.sh @@ -0,0 +1,146 @@ +#!/bin/sh + +# Copyright (C) 2006-2009 Debian hostapd maintainers +# Faidon Liambotis +# Kel Modderman +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# On Debian GNU/Linux systems, the text of the GPL license, +# version 2, can be found in /usr/share/common-licenses/GPL-2. + +# quit if we're called for lo +if [ "$IFACE" = lo ]; then + exit 0 +fi + +if [ -n "$IF_HOSTAPD" ]; then + HOSTAPD_CONF="$IF_HOSTAPD" +else + exit 0 +fi + +HOSTAPD_BIN="/usr/sbin/hostapd" +HOSTAPD_PNAME="hostapd" +HOSTAPD_PIDFILE="/run/hostapd.$IFACE.pid" +HOSTAPD_OMIT_PIDFILE="/run/sendsigs.omit.d/hostapd.$IFACE.pid" + +if [ ! -x "$HOSTAPD_BIN" ]; then + exit 0 +fi + +if [ "$VERBOSITY" = "1" ]; then + TO_NULL="/dev/stdout" +else + TO_NULL="/dev/null" +fi + +hostapd_msg () { + case "$1" in + verbose) + shift + echo "$HOSTAPD_PNAME: $@" > "$TO_NULL" + ;; + stderr) + shift + echo "$HOSTAPD_PNAME: $@" > /dev/stderr + ;; + *) + ;; + esac +} + +test_hostapd_pidfile () { + if [ -n "$1" ] && [ -f "$2" ]; then + if start-stop-daemon --stop --quiet --signal 0 \ + --exec "$1" --pidfile "$2"; then + return 0 + else + rm -f "$2" + return 1 + fi + else + return 1 + fi +} + +init_hostapd () { + HOSTAPD_OPTIONS="-B -P $HOSTAPD_PIDFILE $HOSTAPD_CONF" + HOSTAPD_MESSAGE="$HOSTAPD_BIN $HOSTAPD_OPTIONS" + + test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" && return 0 + + hostapd_msg verbose "$HOSTAPD_MESSAGE" + start-stop-daemon --start --oknodo --quiet --exec "$HOSTAPD_BIN" \ + --pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL" + + if [ "$?" -ne 0 ]; then + return "$?" + fi + + HOSTAPD_PIDFILE_WAIT=0 + until [ -s "$HOSTAPD_PIDFILE" ]; do + if [ "$HOSTAPD_PIDFILE_WAIT" -ge 5 ]; then + hostapd_msg stderr \ + "timeout waiting for pid file creation" + return 1 + fi + + HOSTAPD_PIDFILE_WAIT=$(($HOSTAPD_PIDFILE_WAIT + 1)) + sleep 1 + done + cat "$HOSTAPD_PIDFILE" > "$HOSTAPD_OMIT_PIDFILE" + + return 0 +} + +kill_hostapd () { + HOSTAPD_MESSAGE="stopping $HOSTAPD_PNAME via pidfile: $HOSTAPD_PIDFILE" + + test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" || return 0 + + hostapd_msg verbose "$HOSTAPD_MESSAGE" + start-stop-daemon --stop --oknodo --quiet --exec "$HOSTAPD_BIN" \ + --pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL" + + [ "$HOSTAPD_OMIT_PIDFILE" ] && rm -f "$HOSTAPD_OMIT_PIDFILE" +} + +case "$MODE" in + start) + case "$PHASE" in + pre-up) + init_hostapd || exit 1 + ;; + *) + hostapd_msg stderr "unknown phase: \"$PHASE\"" + exit 1 + ;; + esac + ;; + stop) + case "$PHASE" in + post-down) + kill_hostapd + ;; + *) + hostapd_msg stderr "unknown phase: \"$PHASE\"" + exit 1 + ;; + esac + ;; + *) + hostapd_msg stderr "unknown mode: \"$MODE\"" + exit 1 + ;; +esac + +exit 0 diff --git a/etcs/hostapd/lighttpd/conf-available/05-auth.conf b/etcs/hostapd/lighttpd/conf-available/05-auth.conf new file mode 100644 index 0000000..6c14e47 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/05-auth.conf @@ -0,0 +1,25 @@ +# /usr/share/doc/lighttpd/authentication.txt.gz + +server.modules += ( "mod_auth" ) + +# auth.backend = "plain" +# auth.backend.plain.userfile = "lighttpd.user" +# auth.backend.plain.groupfile = "lighttpd.group" + +# auth.backend.ldap.hostname = "localhost" +# auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +# auth.backend.ldap.filter = "(uid=$)" + +# auth.require = ( "/server-status" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "group=www|user=jan|host=192.168.2.10" +# ), +# "/server-info" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "group=www|user=jan|host=192.168.2.10" +# ) +# ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-accesslog.conf b/etcs/hostapd/lighttpd/conf-available/10-accesslog.conf new file mode 100644 index 0000000..552a762 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-accesslog.conf @@ -0,0 +1,3 @@ +server.modules += ( "mod_accesslog" ) + +accesslog.filename = "/var/log/lighttpd/access.log" diff --git a/etcs/hostapd/lighttpd/conf-available/10-cgi.conf b/etcs/hostapd/lighttpd/conf-available/10-cgi.conf new file mode 100644 index 0000000..1e93a11 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-cgi.conf @@ -0,0 +1,15 @@ +# /usr/share/doc/lighttpd/cgi.txt + +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( "" => "" ) +} + +## Warning this represents a security risk, as it allow to execute any file +## with a .pl/.py even outside of /usr/lib/cgi-bin. +# +#cgi.assign = ( +# ".pl" => "/usr/bin/perl", +# ".py" => "/usr/bin/python", +#) diff --git a/etcs/hostapd/lighttpd/conf-available/10-dir-listing.conf b/etcs/hostapd/lighttpd/conf-available/10-dir-listing.conf new file mode 100644 index 0000000..10e32e8 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-dir-listing.conf @@ -0,0 +1,2 @@ +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" diff --git a/etcs/hostapd/lighttpd/conf-available/10-evasive.conf b/etcs/hostapd/lighttpd/conf-available/10-evasive.conf new file mode 100644 index 0000000..6c61733 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-evasive.conf @@ -0,0 +1 @@ +server.modules += ( "mod_evasive" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-evhost.conf b/etcs/hostapd/lighttpd/conf-available/10-evhost.conf new file mode 100644 index 0000000..2c33448 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-evhost.conf @@ -0,0 +1,5 @@ +# http://redmine.lighttpd.net/wiki/1/Docs:ModEVhost + +server.modules += ( "mod_evhost" ) + +evhost.path-pattern = "/srv/%_/htdocs" diff --git a/etcs/hostapd/lighttpd/conf-available/10-expire.conf b/etcs/hostapd/lighttpd/conf-available/10-expire.conf new file mode 100644 index 0000000..634236a --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-expire.conf @@ -0,0 +1,3 @@ +# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModExpire + +server.modules += ( "mod_expire" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-fastcgi.conf b/etcs/hostapd/lighttpd/conf-available/10-fastcgi.conf new file mode 100644 index 0000000..7862ed9 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-fastcgi.conf @@ -0,0 +1,4 @@ +# /usr/share/doc/lighttpd/fastcgi.txt.gz +# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi + +server.modules += ( "mod_fastcgi" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-flv-streaming.conf b/etcs/hostapd/lighttpd/conf-available/10-flv-streaming.conf new file mode 100644 index 0000000..d8317c0 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-flv-streaming.conf @@ -0,0 +1 @@ +server.modules += ( "mod_flv_streaming" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-no-www.conf b/etcs/hostapd/lighttpd/conf-available/10-no-www.conf new file mode 100644 index 0000000..09b163c --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-no-www.conf @@ -0,0 +1,3 @@ +$HTTP["host"] =~ "^www\.(.*)" { + url.redirect = ( "^/(.*)" => "http://%1/$1" ) +} diff --git a/etcs/hostapd/lighttpd/conf-available/10-proxy.conf b/etcs/hostapd/lighttpd/conf-available/10-proxy.conf new file mode 100644 index 0000000..1e95945 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-proxy.conf @@ -0,0 +1,25 @@ +# /usr/share/doc/lighttpd/proxy.txt + +server.modules += ( "mod_proxy" ) + +## Balance algorithm, possible values are: "hash", "round-robin" or "fair" (default) +# proxy.balance = "hash" + + +## Redirect all queries to files ending with ".php" to 192.168.0.101:80 +#proxy.server = ( ".php" => +# ( +# ( "host" => "192.168.0.101", +# "port" => 80 +# ) +# ) +# ) + +## Redirect all connections on www.example.com to 10.0.0.1{0,1,2,3} +#$HTTP["host"] == "www.example.com" { +# proxy.balance = "hash" +# proxy.server = ( "" => ( ( "host" => "10.0.0.10" ), +# ( "host" => "10.0.0.11" ), +# ( "host" => "10.0.0.12" ), +# ( "host" => "10.0.0.13" ) ) ) +#} diff --git a/etcs/hostapd/lighttpd/conf-available/10-rewrite.conf b/etcs/hostapd/lighttpd/conf-available/10-rewrite.conf new file mode 100644 index 0000000..f82fc1a --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-rewrite.conf @@ -0,0 +1,4 @@ +# /usr/share/doc/lighttpd/rewrite.txt +# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ConfigurationOptions#mod_rewrite-rewriting + +server.modules += ( "mod_rewrite" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-rrdtool.conf b/etcs/hostapd/lighttpd/conf-available/10-rrdtool.conf new file mode 100644 index 0000000..0a49c98 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-rrdtool.conf @@ -0,0 +1,10 @@ +# /usr/share/doc/lighttpd/rrdtool.txt + +server.modules += ( "mod_rrdtool" ) + +## path to the rrdtool binary +rrdtool.binary = "/usr/bin/rrdtool" + +## file to store the rrd database, will be created by lighttpd +rrdtool.db-name = "/var/www/lighttpd.rrd" + diff --git a/etcs/hostapd/lighttpd/conf-available/10-simple-vhost.conf b/etcs/hostapd/lighttpd/conf-available/10-simple-vhost.conf new file mode 100644 index 0000000..7dfa1ca --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-simple-vhost.conf @@ -0,0 +1,11 @@ +# /usr/share/doc/lighttpd/simple-vhost.txt + +server.modules += ( "mod_simple_vhost" ) + +## The document root of a virtual host is document-root = +## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root +simple-vhost.server-root = "/srv" +simple-vhost.document-root = "htdocs" + +## the default host if no host is sent +simple-vhost.default-host = "www.example.com" diff --git a/etcs/hostapd/lighttpd/conf-available/10-ssi.conf b/etcs/hostapd/lighttpd/conf-available/10-ssi.conf new file mode 100644 index 0000000..55d2aba --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-ssi.conf @@ -0,0 +1,5 @@ +# /usr/share/doc/lighttpd/ssi.txt + +server.modules += ( "mod_ssi" ) + +ssi.extension = ( ".shtml" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-ssl.conf b/etcs/hostapd/lighttpd/conf-available/10-ssl.conf new file mode 100644 index 0000000..6bb602a --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-ssl.conf @@ -0,0 +1,9 @@ +# /usr/share/doc/lighttpd/ssl.txt + +$SERVER["socket"] == "0.0.0.0:443" { + ssl.engine = "enable" + ssl.pemfile = "/etc/lighttpd/server.pem" + + ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM" + ssl.honor-cipher-order = "enable" +} diff --git a/etcs/hostapd/lighttpd/conf-available/10-status.conf b/etcs/hostapd/lighttpd/conf-available/10-status.conf new file mode 100644 index 0000000..2859372 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-status.conf @@ -0,0 +1,15 @@ +# /usr/share/doc/lighttpd/status.txt +# http://trac.lighttpd.net/trac/wiki/Docs%3AModStatus + +server.modules += ( "mod_status" ) + +# status.status-url = "/server-status" + +# status.config-url = "/server-config" + +## relative URL for a plain-text page containing the internal statistics +# status.statistics-url = "/server-statistics" + +## add JavaScript which allows client-side sorting for the connection overview +## default: enable +# status.enable-sort = "disable" diff --git a/etcs/hostapd/lighttpd/conf-available/10-userdir.conf b/etcs/hostapd/lighttpd/conf-available/10-userdir.conf new file mode 100644 index 0000000..3507eaf --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-userdir.conf @@ -0,0 +1,13 @@ +## The userdir module provides a simple way to link user-based directories into +## the global namespace of the webserver. +## +# /usr/share/doc/lighttpd/userdir.txt + +server.modules += ( "mod_userdir" ) + +## the subdirectory of a user's home dir which should be accessible +## under http://$host/~$user +userdir.path = "public_html" + +## The users whose home directories should not be accessible +userdir.exclude-user = ( "root", "postmaster" ) diff --git a/etcs/hostapd/lighttpd/conf-available/10-usertrack.conf b/etcs/hostapd/lighttpd/conf-available/10-usertrack.conf new file mode 100644 index 0000000..018b5f4 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/10-usertrack.conf @@ -0,0 +1 @@ +server.modules += ( "mod_usertrack" ) diff --git a/etcs/hostapd/lighttpd/conf-available/11-extforward.conf b/etcs/hostapd/lighttpd/conf-available/11-extforward.conf new file mode 100644 index 0000000..cf06e82 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/11-extforward.conf @@ -0,0 +1,6 @@ +# -*- depends: accesslog -*- + +server.modules += ( "mod_extforward" ) + +# extforward.headers = ("X-Cluster-Client-Ip") +# extforward.forwarder = ("10.0.0.232" => "trust") diff --git a/etcs/hostapd/lighttpd/conf-available/15-fastcgi-php.conf b/etcs/hostapd/lighttpd/conf-available/15-fastcgi-php.conf new file mode 100644 index 0000000..cea11c2 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/15-fastcgi-php.conf @@ -0,0 +1,20 @@ +# -*- depends: fastcgi -*- +# /usr/share/doc/lighttpd/fastcgi.txt.gz +# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi + +## Start an FastCGI server for php (needs the php5-cgi package) +fastcgi.server += ( ".php" => + (( + "bin-path" => "/usr/bin/php-cgi", + "socket" => "/var/run/lighttpd/php.socket", + "max-procs" => 1, + "bin-environment" => ( + "PHP_FCGI_CHILDREN" => "4", + "PHP_FCGI_MAX_REQUESTS" => "10000" + ), + "bin-copy-environment" => ( + "PATH", "SHELL", "USER" + ), + "broken-scriptfilename" => "enable" + )) +) diff --git a/etcs/hostapd/lighttpd/conf-available/90-debian-doc.conf b/etcs/hostapd/lighttpd/conf-available/90-debian-doc.conf new file mode 100644 index 0000000..0eb4cc2 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/90-debian-doc.conf @@ -0,0 +1,15 @@ +#### handle Debian Policy Manual, Section 11.5. urls +## by default allow them only from localhost +$HTTP["remoteip"] =~ "^127\.0\.0\.1$|^::1$" { + alias.url += ( + "/cgi-bin/" => "/usr/lib/cgi-bin/", + "/doc/" => "/usr/share/doc/", + "/images/" => "/usr/share/images/" + ) + $HTTP["url"] =~ "^/doc/|^/images/" { + dir-listing.activate = "enable" + } + $HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( "" => "" ) + } +} diff --git a/etcs/hostapd/lighttpd/conf-available/90-javascript-alias.conf b/etcs/hostapd/lighttpd/conf-available/90-javascript-alias.conf new file mode 100644 index 0000000..a8b442f --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/90-javascript-alias.conf @@ -0,0 +1 @@ +alias.url += ("/javascript" => "/usr/share/javascript") diff --git a/etcs/hostapd/lighttpd/conf-available/README b/etcs/hostapd/lighttpd/conf-available/README new file mode 100644 index 0000000..08679f7 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-available/README @@ -0,0 +1,22 @@ +ligghttpd Configuration under Debian GNU/Linux +============================================== + +Files and Directories in /etc/lighttpd: +--------------------------------------- + +lighttpd.conf: + main configuration file + +conf-available/ + This directory contains a series of .conf files. These files contain + configuration directives necessary to load and run webserver modules. + If you want to create your own files they names should be + build as nn-name.conf where "nn" is two digit number (number + is used to find order for loading files) + +conf-enabled/ + To actually enable a module for lighttpd, it is necessary to create a + symlink in this directory to the .conf file in conf-available/. + +Enabling and disabling modules could be done by provided +/usr/sbin/lighty-enable-mod and /usr/sbin/lighty-disable-mod scripts. diff --git a/etcs/hostapd/lighttpd/conf-enabled/90-javascript-alias.conf b/etcs/hostapd/lighttpd/conf-enabled/90-javascript-alias.conf new file mode 120000 index 0000000..dc909f6 --- /dev/null +++ b/etcs/hostapd/lighttpd/conf-enabled/90-javascript-alias.conf @@ -0,0 +1 @@ +../conf-available/90-javascript-alias.conf \ No newline at end of file diff --git a/etcs/hostapd/lighttpd/lighttpd.conf b/etcs/hostapd/lighttpd/lighttpd.conf new file mode 100644 index 0000000..6e848cf --- /dev/null +++ b/etcs/hostapd/lighttpd/lighttpd.conf @@ -0,0 +1,27 @@ +server.modules = ( + "mod_access", + "mod_alias", + "mod_compress", + "mod_redirect", +) + +server.document-root = "/home/terahz/TeraHz/frontend" +server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) +server.errorlog = "/var/log/lighttpd/error.log" +server.pid-file = "/var/run/lighttpd.pid" +server.username = "www-data" +server.groupname = "www-data" +server.port = 80 + + +index-file.names = ( "index.php", "index.html", "index.lighttpd.html" ) +url.access-deny = ( "~", ".inc" ) +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) + +compress.cache-dir = "/var/cache/lighttpd/compress/" +compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" ) + +# default listening port for IPv6 falls back to the IPv4 port +include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port +include_shell "/usr/share/lighttpd/create-mime.assign.pl" +include_shell "/usr/share/lighttpd/include-conf-enabled.pl"