mirror of https://github.com/friendica/friendica
parent
59c03edbc9
commit
f07df4f667
@ -0,0 +1,134 @@
|
||||
Below is a sample config for Lighttpd that
|
||||
seems to work well on Debian Squeeze, with "lighttpd/1.4.28 (ssl)"
|
||||
|
||||
The idea is: if someone enters the bare URL for my site, 'example.com',
|
||||
they get redirected to https://example.com/index.html, which is simply a
|
||||
page with two links on it: https://wordpress.example.com and
|
||||
https://friendica.example.com.
|
||||
|
||||
If someone enters https://example.com, they get redirected to
|
||||
https://wordpress.example.com/main/, which is the 'main' blog in a Word
|
||||
Press 'network install' of the 'subdirectory' variety.
|
||||
|
||||
I thought it might be nice to offer people who join my Friendica
|
||||
instance their own blogs, if they like.
|
||||
|
||||
One can obtain free, signed, single subdomain SSL certificates from
|
||||
StartCom CA, which upon checking I noticed was already installed in both
|
||||
Firefox and Google Chromium. Info at http://cert.startcom.org/ . So I
|
||||
got one for each site, and have Lighty use the appropriate cert based on
|
||||
the requested URL.
|
||||
|
||||
Enjoy!
|
||||
|
||||
---------------( config starts )-----------------
|
||||
|
||||
debug.log-request-handling = "disable"
|
||||
debug.log-condition-handling = "disable"
|
||||
|
||||
server.modules = (
|
||||
"mod_access",
|
||||
"mod_alias",
|
||||
"mod_compress",
|
||||
"mod_redirect",
|
||||
"mod_fastcgi",
|
||||
"mod_rewrite"
|
||||
)
|
||||
|
||||
server.document-root = "/var/www"
|
||||
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"
|
||||
|
||||
ssl.engine = "enable"
|
||||
ssl.pemfile = "/etc/lighttpd/ssl/wordpress.pem"
|
||||
ssl.ca-file = "/etc/lighttpd/ssl/ca.pem"
|
||||
|
||||
# Send everybody to landing
|
||||
page:
|
||||
$SERVER["socket"] == ":80" {
|
||||
|
||||
$HTTP["scheme"] == "http" {
|
||||
$HTTP["host"] =~ ".*" {
|
||||
# This next redirect doesn't appear to ever execute in
|
||||
Firefox
|
||||
# (sometimes, anyway -- caching issue?), but it does seem
|
||||
to
|
||||
# reliably in Google's Chromium browser. If I change it
|
||||
here
|
||||
# and restart Lighty, Firefox still goes to the URL in
|
||||
the
|
||||
# last 'else' below. Or something.
|
||||
Sometimes.
|
||||
server.document-root = "/var/www"
|
||||
url.redirect = (".*" => "https://example.com")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else $SERVER["socket"] == ":443" {
|
||||
|
||||
$HTTP["scheme"] == "https" {
|
||||
|
||||
$HTTP["host"] == "wordpress.example.com" {
|
||||
server.document-root = "/var/www/wordpress"
|
||||
ssl.pemfile = "/etc/lighttpd/ssl/wordpress.pem"
|
||||
# include
|
||||
"wpmu-rewrites.conf"
|
||||
url.rewrite-if-not-file = (
|
||||
"^/(.*/)?files/$" => "/index.php",
|
||||
"^/(.*/)?files/(.*)" => "/wp-includes/ms-files.php?file=$2",
|
||||
"^(/wp-admin/.*)" => "$1",
|
||||
"^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
|
||||
"^/([_0-9a-zA-Z-]+/)?(.*\.php)" => "/$2",
|
||||
"^/(.*)/?$" => "/index.php/$1"
|
||||
)
|
||||
}
|
||||
else $HTTP["host"] == "friendica.example.com" {
|
||||
server.document-root = "/var/www/friendica"
|
||||
ssl.pemfile = "/etc/lighttpd/ssl/friendica.pem"
|
||||
# Got the following 'Drupal Clean URL'after Mike suggested
|
||||
trying
|
||||
# something along those lines, from
|
||||
http://drupal.org/node/1414950
|
||||
url.rewrite-if-not-file = (
|
||||
"^\/([^\?]*)\?(.*)$" => "/index.php?q=$1&$2",
|
||||
"^\/(.*)$" => "/index.php?q=$1"
|
||||
)
|
||||
}
|
||||
else $HTTP["host"] !~ "(friendica.example.com|wordpress.example.com)" {
|
||||
server.document-root = "/var/www/wordpress"
|
||||
ssl.pemfile = "/etc/lighttpd/ssl/wordpress.pem"
|
||||
url.redirect = (".*" => "https://wordpress.example.com/main/")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
index-file.names = ( "index.php", "index.html",
|
||||
"index.htm", "default.htm",
|
||||
"index.lighttpd.html" )
|
||||
|
||||
url.access-deny = ( "~", ".inc" )
|
||||
|
||||
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
|
||||
|
||||
include_shell "/usr/share/lighttpd/use-ipv6.pl"
|
||||
|
||||
dir-listing.encoding = "utf-8"
|
||||
server.dir-listing = "disable"
|
||||
|
||||
#compress.cache-dir =
|
||||
"/var/cache/lighttpd/compress/"
|
||||
#compress.filetype = ( "application/x-javascript", "text/css",
|
||||
"text/html", "text/p\
|
||||
lain"
|
||||
)
|
||||
|
||||
|
||||
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
|
||||
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
|
||||
|
||||
---------------( config ends )-----------------
|
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
FULLPATH=$(dirname $(readlink -f "$0"))
|
||||
cd "$FULLPATH/../view/en/"
|
||||
|
||||
ADDONMODE=
|
||||
ADDONNAME=
|
||||
if [ "$1" == "--addon" -o "$1" == "-a" ]
|
||||
then
|
||||
ADDONMODE=1
|
||||
if [ -z $2 ]; then echo -e "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
|
||||
ADDONNAME=$2
|
||||
if [ ! -d "$FULLPATH/../addon/$ADDONNAME" ]; then echo "ERROR: addon '$ADDONNAME' not found"; exit 2; fi
|
||||
fi
|
||||
|
||||
if [ $ADDONMODE ]
|
||||
then
|
||||
cd "$FULLPATH/../addon/$ADDONNAME"
|
||||
mkdir -p "$FULLPATH/../addon/$ADDONNAME/lang/C"
|
||||
OUTFILE="$FULLPATH/../addon/$ADDONNAME/lang/C/messages.po"
|
||||
FINDSTARTDIR="."
|
||||
FINDOPTS=
|
||||
else
|
||||
cd "$FULLPATH/../view/en/"
|
||||
OUTFILE="$FULLPATH/messages.po"
|
||||
FINDSTARTDIR="../../"
|
||||
# skip addon folder
|
||||
FINDOPTS="-wholename */addon -prune -o"
|
||||
fi
|
||||
|
||||
F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.php);
|
||||
|
||||
echo "Friendica version $F9KVERSION"
|
||||
|
||||
OPTS=
|
||||
OUTFILE="$FULLPATH/messages.po"
|
||||
if [ "" != "$1" ]
|
||||
then
|
||||
OUTFILE="$(readlink -f ${FULLPATH}/$1)"
|
||||
if [ -e "$OUTFILE" ]
|
||||
then
|
||||
echo "join extracted strings"
|
||||
OPTS="-j"
|
||||
fi
|
||||
fi
|
||||
|
||||
#if [ "" != "$1" ]
|
||||
#then
|
||||
# OUTFILE="$(readlink -f ${FULLPATH}/$1)"
|
||||
# if [ -e "$OUTFILE" ]
|
||||
# then
|
||||
# echo "join extracted strings"
|
||||
# OPTS="-j"
|
||||
# fi
|
||||
#fi
|
||||
|
||||
KEYWORDS="-k -kt -ktt:1,2"
|
||||
|
||||
echo "extract strings to $OUTFILE.."
|
||||
find ../../ -name "*.php" | xargs xgettext $KEYWORDS $OPTS -o "$OUTFILE" --from-code=UTF-8
|
||||
rm "$OUTFILE"; touch "$OUTFILE"
|
||||
for f in $(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f)
|
||||
do
|
||||
if [ ! -d "$f" ]
|
||||
then
|
||||
xgettext $KEYWORDS $OPTS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "setup base info.."
|
||||
sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE"
|
||||
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011 the Friendica Project/g" "$OUTFILE"
|
||||
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE/Friendica/g" "$OUTFILE"
|
||||
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
|
||||
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
|
||||
|
||||
if [ $ADDONMODE ]
|
||||
then
|
||||
sed -i "s/SOME DESCRIPTIVE TITLE./ADDON $ADDONNAME/g" "$OUTFILE"
|
||||
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER//g" "$OUTFILE"
|
||||
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.//g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE VERSION//g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE/Friendica $ADDONNAME addon/g" "$OUTFILE"
|
||||
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
|
||||
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
|
||||
else
|
||||
sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE"
|
||||
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011, 2012, 2013 the Friendica Project/g" "$OUTFILE"
|
||||
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
|
||||
sed -i "s/PACKAGE/Friendica/g" "$OUTFILE"
|
||||
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
|
||||
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
|
||||
fi
|
||||
|
||||
echo "done."
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 995 B |
After Width: | Height: | Size: 1016 B |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue