add tine.vagrant vhost config
authorCornelius Weiß <mail@corneliusweiss.de>
Wed, 15 Jan 2014 18:04:20 +0000 (19:04 +0100)
committerCornelius Weiß <c.weiss@metaways.de>
Wed, 15 Jan 2014 18:24:40 +0000 (19:24 +0100)
- tests for iCal need propper vhost config
- be able to have more than one version on one vagrant machine

Change-Id: I562080dfa4f2adabe1d8901855e1612d4e10285f
Reviewed-on: https://gerrit.tine20.org/tine20/2735
Reviewed-by: Cornelius Weiß <c.weiss@metaways.de>
Tested-by: Cornelius Weiß <c.weiss@metaways.de>
.gitignore
scripts/vagrant/Vagrantfile
scripts/vagrant/puphpet/config.yaml
scripts/vagrant/puphpet/files/dot/apache.conf [new file with mode: 0644]
scripts/vagrant/puphpet/puppet/manifests/default.pp

index f5fe3b2..eb5bab0 100644 (file)
@@ -13,6 +13,7 @@ tine20/*/*/*FAT*
 tine20/*/js/*-lang-*
 tine20/Tinebase/js/Locale/build/*.js
 scripts/packaging/tine20build/
+.vagrant
 tine20/build
 scripts/weeklyevents
 scripts/custom
index 4251a90..ae09d5e 100644 (file)
@@ -5,8 +5,9 @@ Vagrant.configure("2") do |config|
   config.vm.network "private_network", ip: "192.168.56.101"
 
 
-  config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :nfs => false
-
+  config.vm.synced_folder "../..", "/usr/local/share/tine20.git", id: "vagrant-root", :nfs => false
+  #config.vm.synced_folder "../packaging/debian/etc", "/etc/tine20", id: "vagrant-root", :nfs => false
+  
   config.vm.usable_port_range = (2200..2250)
   config.vm.provider :virtualbox do |virtualbox|
     virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
index 094b96c..8e3511f 100644 (file)
@@ -52,15 +52,15 @@ apache:
         - rewrite
     vhosts:
         dYDR07tVlxGd:
-            servername: example.com
+            servername: tine.vagrant
             serveraliases:
-                - tine.exaple.com
-            docroot: /var/www
+                - tine.vagrant
+            docroot: /www/tine.vagrant/htdocs
             port: '80'
             setenv:
                 - 'APP_ENV dev'
-            override:
-                - All
+            additional_includes:
+                - /vagrant/puphpet/files/dot/apache.conf
     user: www-data
     group: www-data
     default_vhost: true
diff --git a/scripts/vagrant/puphpet/files/dot/apache.conf b/scripts/vagrant/puphpet/files/dot/apache.conf
new file mode 100644 (file)
index 0000000..a216041
--- /dev/null
@@ -0,0 +1,87 @@
+# Apache and PHP configuration for Tine 2.0
+#
+
+Alias /tine20                      /www/tine.vagrant/htdocs
+Alias /Microsoft-Server-ActiveSync /www/tine.vagrant/htdocs/Microsoft-Server-ActiveSync
+
+# some people prefer a simple URL like http://tine20.example.org
+# in this case you also have to disable to Alias lines above
+#<VirtualHost 1.2.3.4:80>
+#  DocumentRoot /www/tine.vagrant/htdocs
+#  ServerName   tine20.example.org
+#</VirtualHost>
+
+<Directory /www/tine.vagrant/htdocs>
+    Order Allow,Deny
+    Allow from all
+
+    DirectoryIndex index.php
+
+    Options +ExecCGI
+
+    <IfModule mod_php5.c>
+        php_admin_value max_input_time          120
+        php_admin_value include_path            .:/www/tine.vagrant/htdocs:/www/tine.vagrant/htdocs/library:/etc/tine20
+        #php_admin_value open_basedir            /www/tine.vagrant/htdocs:/var/lib/tine20:/tmp:/usr/share/php:/etc/tine20:/var/log/tine20
+        php_admin_value session.gc_maxlifetime  86400
+        php_admin_value memory_limit            128M
+        php_admin_value upload_max_filesize     20M
+        php_admin_value post_max_size           20M
+        
+        php_admin_value safe_mode               off
+        php_admin_flag  display_errors          off
+        php_admin_flag  log_errors              on
+        php_admin_flag  magic_quotes_gpc        off
+        php_admin_flag  magic_quotes_runtime    off
+        php_admin_flag  register_globals        off
+        php_admin_flag  zlib.output_compression on
+        
+        php_value       max_execution_time      90
+    </IfModule>
+    
+    <IfModule mod_rewrite.c>
+        RewriteEngine on
+
+        RewriteBase /tine20
+
+        # ActiveSync
+        RewriteRule ^Microsoft-Server-ActiveSync index.php?frontend=activesync         [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+
+        # OpenID
+        RewriteRule ^users/(.*)                  index.php?frontend=openid&username=$1 [L,QSA]
+
+        # WebDAV / CalDAV / CardDAV
+        RewriteCond %{REQUEST_METHOD} !^(GET|POST)$
+        RewriteRule ^$                           index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+
+        RewriteRule ^addressbooks                index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+        RewriteRule ^calendars                   index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+        RewriteRule ^webdav                      index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+        RewriteRule ^principals                  index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+        RewriteRule ^remote.php                  index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+    </IfModule>
+
+    <IfModule mod_expires.c>
+        ExpiresActive on
+
+        ExpiresByType image/gif  "access plus 1 month 1 days"
+        ExpiresByType image/jpeg "access plus 1 month 1 days"
+        ExpiresByType image/png  "access plus 1 month 1 days"
+    </IfModule>
+    
+    <IfModule mod_deflate.c>
+        AddOutputFilterByType DEFLATE text/plain
+        AddOutputFilterByType DEFLATE text/html
+        AddOutputFilterByType DEFLATE text/css
+        AddOutputFilterByType DEFLATE application/javascript
+        AddOutputFilterByType DEFLATE application/json
+
+        <IfModule mod_headers.c>
+            # properly handle requests coming from behind proxies
+            Header append Vary User-Agent env=!dont-vary
+        </IfModule>
+    </IfModule>
+
+</Directory>
+
+
index 600611d..4cabab4 100644 (file)
@@ -743,6 +743,27 @@ if has_key($beanstalkd_values, 'install') and $beanstalkd_values['install'] == 1
 
 # tine20 manifest
 
+# /www/tine.vagrant logs userdata files htdocs
+file { ["/www", "/www/tine.vagrant"]:
+    ensure => directory,
+    owner  => $::ssh_username,
+    mode    => 0775,
+}
+
+file { ["/www/tine.vagrant/logs", "/www/tine.vagrant/cache", "/www/tine.vagrant/files", "/www/tine.vagrant/temp"]:
+    ensure => directory,
+    owner  => 'www-data',
+    mode    => 0775,
+}
+
+file { "/www/tine.vagrant/htdocs":
+    ensure => 'link',
+    target => '/usr/local/share/tine20.git/tine20',
+}
+
+
+# vhost config with logs rewrites config
+
 if $tine20_values == undef {
   $tine20_values = loadyaml('/vagrant/puphpet/tine20.yaml')
 }
@@ -756,7 +777,7 @@ mysql::db { $tine20_values['database']['name']:
 }
   
 file { "config.inc.php":
-  path    => "/var/www/config.inc.php",
+  path    => "/usr/local/share/tine20.git/tine20/config.inc.php",
   ensure  => present,
   owner   => 'root',
   group   => 'root',
@@ -777,13 +798,13 @@ file { "config.inc.php":
     
     'caching' => array (
         'active' => true,
-        'path' => '/tmp',
+        'path' => '/www/tine.vagrant/cache',
         'lifetime' => 3600,
     ),
     
     'logger' => array (
         'active' => true,
-        'filename' => '/tmp/tine20.log',
+        'filename' => '/www/tine.vagrant/logs/tine20.log',
         'priority' => '7',
     ),
   );"
@@ -792,13 +813,13 @@ file { "config.inc.php":
 # coposer install
 composer::exec { 'tine20-composer-run':
   cmd     => 'install',
-  cwd     => '/var/www/',
+  cwd     => '/usr/local/share/tine20.git/tine20/',
   dev     => true,
 }
  
 # phing install
 file { "install.properties":
-  path    => "/var/www/install.properties",
+  path    => "/usr/local/share/tine20.git/tine20/install.properties",
   ensure  => present,
   owner   => 'root',
   group   => 'root',
@@ -813,9 +834,9 @@ adminEmailAddress=${tine20_values['initialuser']['email']}
 }
 
 exec { 'phing-tine-install':
-  cwd     => "/var/www/",
-  command => "sudo sudo -u www-data /var/www/vendor/bin/phing tine-install",
+  cwd     => "/usr/local/share/tine20.git/tine20/",
+  command => "sudo sudo -u www-data /usr/local/share/tine20.git/tine20/vendor/bin/phing tine-install",
   require => [
-    File['/var/www/install.properties']
+    File['/usr/local/share/tine20.git/tine20/install.properties']
   ]
 }
\ No newline at end of file