Skip to content

Commit

Permalink
Item2106: move cgi-bin dir to /var/lib/foswiki so that the layout is …
Browse files Browse the repository at this point in the history
…what foswiki users expect, and so that using configure, or unziping extensions does not break your foswiki install

git-svn-id: http://svn.foswiki.org/branches/Release01x00@5213 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Oct 4, 2009
1 parent 1c2326a commit 1aebd61
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
7 changes: 5 additions & 2 deletions core/tools/pkg/debian/apache.conf
Expand Up @@ -18,14 +18,17 @@
RedirectMatch /foswiki/?$ /foswiki/bin/view$1
RedirectMatch /foswiki(/([A-Z].*)?)?$ /foswiki/bin/view$1

#support the cgi-bin url's
RedirectMatch /cgi-bin/foswiki/?$ /foswiki/bin/$1

#see /etc/foswiki/ShorterUrl.conf to activate ShorterUrls

# The ScriptAlias defines the bin directory as a directory where CGI
# scripts are allowed.
# The first parameter will be part of the URL to your installation e.g.
# http://my.co.uk/foswiki/bin/view/...
# The second parameter must point to the physical path on your disc.
ScriptAlias /foswiki/bin "/usr/share/foswiki/bin"
ScriptAlias /foswiki/bin "/var/lib/foswiki/bin"

# The Alias defines a url that points to the root of the foswiki installation.
# It is used to access files in the pub directory (attachments etc)
Expand All @@ -40,7 +43,7 @@ SetEnvIf Request_URI "foswiki/pub/System/.*\.[hH][tT][mM][lL]?$" !blockAccess
# This specifies the options on the Foswiki scripts directory. The ExecCGI
# and SetHandler tell apache that it contains scripts. "Allow from all"
# lets any IP address access this URL.
<Directory "/usr/share/foswiki/bin">
<Directory "/var/lib/foswiki/bin">
AllowOverride all
Order Allow,Deny
Allow from all
Expand Down
1 change: 1 addition & 0 deletions core/tools/pkg/debian/changelog
Expand Up @@ -3,6 +3,7 @@ foswiki (1.0.7-1) stable; urgency=high
* update to foswiki 1.0.7
* remove mod_perl bits - they're now in foswiki-modperlenginecontrib
* add localhost and 127.0.0.1 to permitted redirecthosts by default
* remove foswiki cgi's from cgi-bin to bring it more into line with foswiki

-- Sven Dowideit <SvenDowideit@fosiki.com> Sun, 4 Oct 2009 09:53:40 +0100

Expand Down
2 changes: 1 addition & 1 deletion core/tools/pkg/debian/dirs
Expand Up @@ -2,4 +2,4 @@ var/lib/foswiki
var/log/foswiki
etc/foswiki
usr/share/doc/foswiki
usr/share/foswiki/bin
usr/share/foswiki
20 changes: 8 additions & 12 deletions core/tools/pkg/debian/postinst
Expand Up @@ -57,9 +57,8 @@ db_get foswiki/defaultUrlHost
# be more robust later:
perl -pi~ -e '$U=q{'"$RET"'}; s{http://your.domain.com}{$U}g;' /etc/foswiki/LocalSite.cfg
perl -pi~ -e '$U=q{'"$RET"'}; s{http://your.domain.com}{$U}g;' /etc/foswiki/apache.conf
#remove the double //cgi-bin caused by putting a / at the end of the hostUrl
perl -pi~ -e 's{/(/cgi-bin)}{$1}g;' /etc/foswiki/apache.conf
#perl -pi~ -e '$U=q{'"$RET"'}; s{^(Redirect\s+/foswiki/index.html\s+).*(cgi-bin/foswiki/view\n)$}{$1$U$2};' /etc/foswiki/apache.conf
#remove the double //bin caused by putting a / at the end of the hostUrl
perl -pi~ -e 's{/(/bin)}{$1}g;' /etc/foswiki/apache.conf
rm /etc/foswiki/*~

db_get foswiki/wikiwebmaster
Expand Down Expand Up @@ -134,15 +133,12 @@ case "$1" in
fi
fi

#remove the .htaccess file - moved to apache-foswiki.conf
if [ -e /usr/lib/cgi-bin/foswiki/.htaccess ]; then
rm /usr/lib/cgi-bin/foswiki/.htaccess
fi
if [ -e /usr/share/foswiki/bin/.htaccess ]; then
rm /usr/share/foswiki/bin/.htaccess
fi
if [ -e /etc/foswiki/.htaccess ]; then
rm /etc/foswiki/.htaccess
#remove the /usr/lib/cgi-bin/foswiki dir and make into softlink?
if [ -d /usr/lib/cgi-bin/foswiki/ ]; then
echo removing /usr/lib/cgi-bin/foswiki to /tmp/foswiki_DELETE
cp -r /usr/lib/cgi-bin/foswiki/* /var/lib/foswiki/bin
mv /usr/lib/cgi-bin/foswiki /tmp/foswiki_DELETE
ln -s /var/lib/foswiki/bin /usr/lib/cgi-bin/foswiki
fi

#create securer-foswiki session dir
Expand Down
24 changes: 12 additions & 12 deletions core/tools/pkg/debian/rules
Expand Up @@ -38,26 +38,26 @@ install: build

echo `pwd`

mv bin/* debian/foswiki/usr/share/foswiki/bin/
cp debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg.txt debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg
cp -Rp bin debian/foswiki/var/lib/foswiki/
cp debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg.txt debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg

chmod 755 debian/foswiki/usr/share/foswiki/bin/*
chmod 644 debian/foswiki/usr/share/foswiki/bin/setlib.cfg
chmod 644 debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg
chmod 644 debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg.txt
chmod 755 debian/foswiki/var/lib/foswiki/bin/*
chmod 644 debian/foswiki/var/lib/foswiki/bin/setlib.cfg
chmod 644 debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg
chmod 644 debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg.txt

# Make dir group WIKI_OWNER, g+rw, +t so extensions may be added
# without overwriting existing files
chgrp $(WIKI_OWNER) debian/foswiki/usr/share/foswiki/bin
chmod 1775 debian/foswiki/usr/share/foswiki/bin
chgrp $(WIKI_OWNER) debian/foswiki/var/lib/foswiki/bin
chmod 1775 debian/foswiki/var/lib/foswiki/bin

cp -Rp pub debian/foswiki/var/lib/foswiki/
cp -pR templates debian/foswiki/var/lib/foswiki/
cp -pR locale debian/foswiki/var/lib/foswiki/
cp -pR data debian/foswiki/var/lib/foswiki/

#move configure's logos and css to /var/lib/foswiki/pub/logos
mv debian/foswiki/usr/share/foswiki/bin/logos debian/foswiki/var/lib/foswiki/pub/
mv debian/foswiki/var/lib/foswiki/bin/logos debian/foswiki/var/lib/foswiki/pub/

#create mailnotify timestamps
date +%s > debian/foswiki/var/lib/foswiki/data/System/.mailnotify
Expand Down Expand Up @@ -107,10 +107,10 @@ install: build
#move LocalSite.cfg to /etc/foswiki
cp debian/LocalSite.cfg debian/foswiki/etc/foswiki/LocalSite.cfg

perl -pi~ -e 's|^(.foswikiLibPath).*|\1 = \"/etc/foswiki\";|;' debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg
perl -pi~ -e 's|^(.foswikiLibPath).*|\1 = \"/etc/foswiki\";|;' debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg
#enable /var/lib/foswiki/lib as an extra lib dir for plugin installers (configure, fosiki extras and unziping)
perl -pi~ -e 's|^# (.localPerlLibPath).*|\1 = \"/var/lib/foswiki/lib\";\n\$$CPANBASE = 1;|;' debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg
rm debian/foswiki/usr/share/foswiki/bin/LocalLib.cfg~
perl -pi~ -e 's|^# (.localPerlLibPath).*|\1 = \"/var/lib/foswiki/lib\";\n\$$CPANBASE = 1;|;' debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg
rm debian/foswiki/var/lib/foswiki/bin/LocalLib.cfg~

chmod -R 644 debian/foswiki/etc/foswiki/*

Expand Down

0 comments on commit 1aebd61

Please sign in to comment.