From 9f381d88bba534f250de670bcb0e49559bdf5821 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 20 Mar 2006 14:54:45 +0000 Subject: [PATCH] * add documentation * made directories configurable from start. * make debian package build work again. --- webcit/Makefile.am | 16 ++++++++- webcit/README | 81 +++++++++++++++++++++++++++++++++++++++++- webcit/configure.in | 21 ++++++++++- webcit/debian/rules | 13 ++----- webcit/src/webcit.c | 12 ++----- webcit/src/webserver.c | 59 ++++++++++++++++++++++++++++-- webcit/src/webserver.h | 6 ++++ 7 files changed, 181 insertions(+), 27 deletions(-) diff --git a/webcit/Makefile.am b/webcit/Makefile.am index 12d055012..8f3d13ad5 100644 --- a/webcit/Makefile.am +++ b/webcit/Makefile.am @@ -10,7 +10,8 @@ DISTFILES=ABOUT_NLS # usual unix way would be here: $(datadir)/$(PACKAGE) #STATIC_DIR=@STATIC_DIR@ -DIRS=tiny_mce static +DIRS= static +EDITOR_DIRS=tiny_mce @@ -29,3 +30,16 @@ install-data-local: done \ done \ done + + export STATIC_DIR=@editor@; \ + for dir in $(EDITOR_DIRS); do \ + $(mkinstalldirs) $(DESTDIR)/$$STATIC_DIR/$$dir; \ + for subdir in `find $$dir -type d |grep -v .svn`; do \ + $(mkinstalldirs) $(DESTDIR)/$$STATIC_DIR/$$subdir; \ + for file in $(srcdir)/$$subdir/*; do \ + if test -f "$$file" ; then \ + $(INSTALL_DATA) $$file $(DESTDIR)$$STATIC_DIR/$$subdir; \ + fi \ + done \ + done \ + done diff --git a/webcit/README b/webcit/README index a530f5e29..11f3b6350 100644 --- a/webcit/README +++ b/webcit/README @@ -61,6 +61,9 @@ port. The default is port 2000. make make install + Package/Ports Maintainers: to make webcit fit smart into LHFS-ified systems + read on at the end of this file, Advanced configure options. + Then to initialize it: cd /usr/local/webcit ./setup @@ -198,7 +201,64 @@ generate a key and certificate. It is up to you to decide whether to use an automatically generated, self-signed certificate, or purchase a certificate signed by a well known authority. - + + + INTEGRATING INTO APACHE + ----------------------- + + If you want to include webcit into an Apache, because of you want to have it +running alongside your i.e. php applications without adding another ip or using a +different port than 443 / 80 (which may be blocked by company firewalls for +example) you can do this with apaches mod_proxy. One can do this either to make +webcit fill up into a full vhost (like webcit.mydomain.com) or to go into a +subdirectory (like www.mydomain.com/webcit). find two config snippets, that can +be added to apaches sample ssl config (which you may find in +/usr/share/doc/apache2/examples/ssl.conf for example) Warning: you should be somewhat +experienced with configuring apache to do that! + +VHOST context: + + #here some of your config stuff like logging, serveradmin... + NameVirtualHost www.mydomain.com + + allow from all + + + ProxyPass / http://127.0.0.1:2000/ + ProxyPassReverse / http://127.0.0.1:2000/ +# make apache give away static content like images... + alias /static /var/lib/citadel/www/static + + + +SUBDIR context: + + #here some of your config stuff like logging, serveradmin... + NameVirtualHost www.mydomain.com + + allow from all + + + allow from all + + + allow from all + + + allow from all + + + ProxyPass /webcit/ http://127.0.0.1:2000/webcit/ + ProxyPassReverse /webcit/ http://127.0.0.1:2000/webcit/ + ProxyPass /listsub/ http://127.0.0.1:2000/listsub/ + ProxyPassReverse /listsub/ http://127.0.0.1:2000/listsub/ + ProxyPass /groupdav/ http://127.0.0.1:2000/groupdav/ + ProxyPassReverse /groupdav/ http://127.0.0.1:2000/groupdav/ + ProxyPass /who_inner_html http://127.0.0.1:2000/who_inner_html + ProxyPassReverse /who_inner_html http://127.0.0.1:2000/who_inner_html +# make apache give away static content like images... + alias /static /var/lib/citadel/www/static + CONCLUSION ---------- @@ -206,3 +266,22 @@ authority. That's all you need to know to get started. If you have any questions or comments, please visit UNCENSORED! BBS, the home of Citadel, at uncensored.citadel.org. + + + ADVANCED CONFIGURE OPTIONS + -------------------------- + + To make webcit integrate smothly into your system there are several options available. +--with-staticdir defines where webcit should put'n search its templates and images. If you +want to go with a different Installation location then the point it is accessed at runtime, +you can use --with-staticrundir. This option is meant to ease your needs if you're going +to install the static files as 'examples' in a location like /usr/share/doc/webcit/examples, +and enable the user to copy them over to another dir (like /var/lib/citadel/www), where +they're accessed at runtime. (The debian instatll scripts provided with this package +do this to preserve user changes to the template system, see debian/citadel-webcit.postinstall) + +[todo] +Further there are possibilities to load the tiny_mce editor into a system uniq location. Webcit +uses this standard component compose its messages for mails and postings. Several webcit installations +that may differ in design but use the same tiny_mce (which is the default that webcit ships with) + diff --git a/webcit/configure.in b/webcit/configure.in index a1385c236..b937a0c91 100644 --- a/webcit/configure.in +++ b/webcit/configure.in @@ -391,12 +391,31 @@ IT_PROG_INTLTOOL AC_SUBST(CFLAGS) AC_SUBST(SETUP_LIBS) +AC_ARG_WITH(rundir, [ --with-rundir=DIR where to find the citadel servers sockets (overridable by -h at runtime.)], + [ rundir=$withval ],[ rundir=/usr/local/citadel ] ) +AC_DEFINE_UNQUOTED([RUNDIR],["$rundir"],where should we make look for citadel sockets??) -AC_ARG_WITH(staticdir, [ --with-staticdir=DIR where to put datafiles],[ staticdir=$withval ],[ staticdir=$prefix/ ] ) +AC_ARG_WITH(staticdir, [ --with-staticdir=DIR where to put datafiles], + [ staticdir=$withval ],[ staticdir=$prefix ] ) AC_SUBST(staticdir) + +AC_ARG_WITH(staticrundir, [ --with-staticrundir=DIR where to search datafiles at runtime], + [ staticrundir=$withval ],[ staticrundir=$staticdir ] ) + +AC_DEFINE_UNQUOTED([DATADIR],["$staticrundir"],where should we make our root?) + + +AC_ARG_WITH(editor, [ --with-editor=DIR where to search the editor at runtime], + [ editordir=$withval ],[ editordir=$staticrundir ] ) +AC_DEFINE_UNQUOTED([EDITORDIR],["$editordir"],where find the editor (tiny_mce)?) + +AC_SUBST(editor) + + AC_OUTPUT(Makefile src/Makefile po/Makefile.in ) + echo ------------------------------------------------------------------------ echo 'zlib compression: ' $ok_zlib echo 'Calendar support: ' $ok_libical diff --git a/webcit/debian/rules b/webcit/debian/rules index 7fd18646e..2975a9d83 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -28,10 +28,9 @@ configure-stamp: --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ - --with-webcit-dir=/usr \ - --with-sysconfdir=/etc/citadel \ - --with-spooldir=/var/spool/citadel \ --with-staticdir=/usr/share/doc/citadel-webcit/examples \ + --with-staticrundir=/var/lib/citadel/www/ \ + --with-editor=/usr/share/tiny_mce/ \ --with-rundir=/var/run/citadel \ --with-ical --with-db --with-ldap --with-zlib --with-ssl --with-libiconf --with-newt --with-included-gettext @@ -88,23 +87,15 @@ binary-arch: build install dh_installdocs dh_installexamples # dh_install -# dh_installmenu dh_installdebconf # dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime # dh_installinit # dh_installcron -# dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms -# dh_perl -# dh_python -# dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol diff --git a/webcit/src/webcit.c b/webcit/src/webcit.c index 85ee1ca4b..dd3503d4c 100644 --- a/webcit/src/webcit.c +++ b/webcit/src/webcit.c @@ -13,14 +13,6 @@ #include "webserver.h" #include "mime_parser.h" -/** - * Subdirectories from which the client may request static content - */ -char *static_content_dirs[] = { - "static", /** static templates */ - "tiny_mce" /** the JS editor */ -}; - /** * String to unset the cookie. * Any date "in the past" will work, so I chose my birthday, right down to @@ -1195,8 +1187,8 @@ void session_loop(struct httprequest *req) /** Static content can be sent without connecting to Citadel. */ is_static = 0; - for (a=0; a<(sizeof(static_content_dirs) / sizeof(char *)); ++a) { - if (!strcasecmp(action, static_content_dirs[a])) { + for (a=0; a