From 2c277dc0c5cb936a23ee58948854b2e3eb6dd251 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 20 Feb 2014 08:42:22 +0100 Subject: add and install configuration files for apache and lighttpd --- Makefile | 8 +++++++- config/apache.conf | 32 ++++++++++++++++++++++++++++++++ config/lighttpd.conf | 24 ++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 config/apache.conf create mode 100644 config/lighttpd.conf diff --git a/Makefile b/Makefile index 06fa406..f38be3a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ # cqrlogo - CGI QR-Code logo for web services PREFIX := /usr +APACHECONF := /etc/apache/conf/extra/ +LIGHTTPDCONF := /etc/lighttpd/conf.d/ CC := gcc MD := markdown INSTALL := install @@ -43,13 +45,17 @@ cqrlogo.png: cqrlogo.cgi QUERY_STRING='scale=4' \ ./cqrlogo.cgi | $(SED) '1,/^$$/d' > cqrlogo.png -install: install-bin install-doc +install: install-bin install-config install-doc install-bin: cqrlogo.cgi cqrlogo.fcgi $(INSTALL) -D -m0755 cqrlogo.cgi $(DESTDIR)$(PREFIX)/share/webapps/cqrlogo/cqrlogo.cgi $(INSTALL) -D -m0755 cqrlogo.fcgi $(DESTDIR)$(PREFIX)/share/webapps/cqrlogo/cqrlogo.fcgi $(INSTALL) -D -m0644 cqrlogo.conf $(DESTDIR)/etc/cqrlogo.conf +install-config: config/apache.conf config/lighttpd.conf + $(INSTALL) -D -m0644 config/apache.conf $(DESTDIR)$(APACHECONF)/cqrlogo.conf + $(INSTALL) -D -m0644 config/lighttpd.conf $(DESTDIR)$(LIGHTTPDCONF)/cqrlogo.conf + install-doc: README.html cqrlogo.png $(INSTALL) -D -m0644 README.md $(DESTDIR)$(PREFIX)/share/doc/cqrlogo/README.md $(INSTALL) -D -m0644 README.html $(DESTDIR)$(PREFIX)/share/doc/cqrlogo/README.html diff --git a/config/apache.conf b/config/apache.conf new file mode 100644 index 0000000..61eff91 --- /dev/null +++ b/config/apache.conf @@ -0,0 +1,32 @@ +# Apache configuration file for cqrlogo +# +# to enable cqrlogo in apache just make sure modules mod_alias and either +# of mod_fastcgi and mod_fcgid are loaded + + + # try fastcgi first + + AddHandler fastcgi-script fcgi + ScriptAlias /cqrlogo "/usr/share/webapps/cqrlogo/cqrlogo.fcgi" + + + # then use fcgid + + + AddHandler fcgid-script fcgi + ScriptAlias /cqrlogo "/usr/share/webapps/cqrlogo/cqrlogo.fcgi" + + + + # and fall back to simple CGI if fastcgi modules above fail + + + ScriptAlias /cqrlogo "/usr/share/webapps/cqrlogo/cqrlogo.cgi" + + + + + Options ExecCGI + Allow from all + + diff --git a/config/lighttpd.conf b/config/lighttpd.conf new file mode 100644 index 0000000..a697d8a --- /dev/null +++ b/config/lighttpd.conf @@ -0,0 +1,24 @@ +# lighttpd configuration file for cqrlogo +# +# to enable cqrlogo in lighttpd just include this configuration in main +# configuration with something like this: +# +# include "conf.d/cqrlogo.conf" + +server.modules += ( "mod_alias", "mod_fastcgi" ) +#server.modules += ( "mod_alias", "mod_cgi" ) + +alias.url += ( "/cqrlogo" => "/usr/share/webapps/cqrlogo/cqrlogo.fcgi" ) +#alias.url += ( "/cqrlogo" => "/usr/share/webapps/cqrlogo/cqrlogo.fcgi" ) + +fastcgi.server = ( + ".fcgi" => ( + "localhost" => ( + "max-procs" => 1, + "socket" => "/run/lighttpd/cqrlogo-fastcgi.sock", + "bin-path" => "/usr/share/webapps/cqrlogo/cqrlogo.fcgi" + ) + ) +) + +#cgi.assign = ( ".cgi" => "" ) -- cgit v1.2.3-70-g09d2