summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--htetc/freeside-base1.conf (renamed from htetc/freeside-base.conf)5
-rw-r--r--htetc/freeside-base2.conf21
3 files changed, 32 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7ae5274f6..4c23b8dba 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,10 @@ FREESIDE_EXPORT = /usr/local/etc/freeside
MASON_HANDLER = ${FREESIDE_CONF}/handler.pl
MASONDATA = ${FREESIDE_CACHE}/masondata
+#yup
+APACHE_VERSION = 1
+#APACHE_VERSION = 2
+
# only mason now
TEMPLATE = mason
@@ -231,11 +235,13 @@ install-init:
${INIT_INSTALL}
install-apache:
+ [ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
[ -d ${APACHE_CONF} ] && \
- ( install -o root -m 755 htetc/freeside-base.conf ${APACHE_CONF} && \
+ ( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
perl -p -i -e "\
s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
+ s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
" ${APACHE_CONF}/freeside-*.conf \
) || true
diff --git a/htetc/freeside-base.conf b/htetc/freeside-base1.conf
index f8ebece9e..3f6bd0ee3 100644
--- a/htetc/freeside-base.conf
+++ b/htetc/freeside-base1.conf
@@ -1,4 +1,7 @@
+#PerlModule Apache::DBI
+
PerlModule HTML::Mason
+
<Directory %%%FREESIDE_DOCUMENT_ROOT%%%>
AuthName Freeside
AuthType Basic
@@ -9,7 +12,7 @@ AddHandler perl-script .cgi .html
PerlHandler HTML::Mason
</Files>
<Perl>
-require "/usr/local/etc/freeside/handler.pl";
+require "%%%MASON_HANDLER%%%";
</Perl>
</Directory>
diff --git a/htetc/freeside-base2.conf b/htetc/freeside-base2.conf
new file mode 100644
index 000000000..38f784068
--- /dev/null
+++ b/htetc/freeside-base2.conf
@@ -0,0 +1,21 @@
+PerlModule Apache2::compat
+
+#PerlModule Apache::DBI
+
+PerlModule HTML::Mason
+PerlSetVar MasonArgsMethod CGI
+PerlModule HTML::Mason::ApacheHandler
+
+PerlRequire "%%%MASON_HANDLER%%%"
+
+<Directory %%%FREESIDE_DOCUMENT_ROOT%%%>
+AuthName Freeside
+AuthType Basic
+AuthUserFile /usr/local/etc/freeside/htpasswd
+require valid-user
+<Files ~ (\.cgi|\.html)>
+SetHandler perl-script
+PerlHandler HTML::Mason
+</Files>
+</Directory>
+