Skip to content

Instantly share code, notes, and snippets.

@Mic92
Last active December 20, 2015 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/6048725 to your computer and use it in GitHub Desktop.
Save Mic92/6048725 to your computer and use it in GitHub Desktop.
z-push refactoring
Alias /Microsoft-Server-ActiveSync /usr/share/webapps/z-push/index.php
<Directory /usr/share/webapps/z-push/>
DirectoryIndex index.php
AllowOverride Options
Order allow,deny
Allow from all
</Directory>
php_flag magic_quotes_gpc off
php_flag register_globals off
php_flag magic_quotes_runtime off
php_flag short_open_tag on
server {
listen 443;
server_name zpush.example.com; # EDIT ME
ssl on;
ssl_certificate /path/to/ssl.crt; # EDIT ME
ssl_certificate_key /path/to/ssl.key; # EDIT ME
root /usr/share/webapps/z-push;
index index.php;
# not necessary, but might help
#client_max_body_size 4M;
#client_body_buffer_size 128k;
location / {
try_files $uri $uri/ index.php;
}
location /Microsoft-Server-ActiveSync {
rewrite ^(.*)$ /index.php last;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
}
}
# Contributor: C Anthony Risinger
# Contributer: Jörg Thalheim <joerg@higgsboson.tk>
pkgname=z-push
pkgver=2.0.7
pkgrel=1690
pkgdesc="open-source implementation of the ActiveSync protocol"
arch=('any')
url="http://z-push.sf.net/"
license=('AGPL3')
depends=('php')
install=z-push.install
backup=('etc/webapps/z-push/config.php'
'etc/webapps/z-push/.htaccess'
'etc/webapps/z-push/apache.conf'
'etc/webapps/z-push/nginx.conf')
options=('!strip')
source=("http://zarafa-deutschland.de/z-push-download/final/2.0/${pkgname}-${pkgver}-${pkgrel}.tar.gz"
"apache.conf"
"nginx.conf"
"htaccess")
md5sums=('b0dd7f6da6b6d6bac49266cca28a4140'
'ac7e50971ce4a169fd28194426162aae'
'6ac5e74d54d94fab754debcd4cf27671'
'1091aa1ba272ef05bf628f73b05c527a')
package() {
mkdir -p ${pkgdir}/etc/webapps/z-push
mkdir -p ${pkgdir}/usr/share/webapps/z-push
mkdir -p ${pkgdir}/var/{lib,log}/z-push
cd ${pkgdir}/usr/share/webapps/
cp -r ${srcdir}/${pkgname}-${pkgver}-${pkgrel}/* z-push
mv z-push/config.php ${pkgdir}/etc/webapps/z-push/config.php
ln -s /etc/webapps/z-push/config.php z-push/config.php
cp ${srcdir}/htaccess ${pkgdir}/etc/webapps/z-push/.htaccess
ln -s /etc/webapps/z-push/.htaccess z-push/.htaccess
cp ${srcdir}/{apache,nginx}.conf ${pkgdir}/etc/webapps/z-push/
}
post_install() {
chown -R http:http var/log/z-push
chown -R http:http var/lib/z-push
}
post_upgrade() {
post_install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment