upgrade vagrant box to saucy 64 bit with php5.5
authorCornelius Weiß <mail@corneliusweiss.de>
Tue, 9 Sep 2014 07:56:00 +0000 (09:56 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 12 Dec 2014 13:34:06 +0000 (14:34 +0100)
cherry-picked from master and originally committed by c.weiss@metaways.de

Change-Id: I82831dabdfba5ba0f26eb92dde4b37080b9d6b62
Reviewed-on: https://gerrit.tine20.org/tine20/3012
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
scripts/vagrant/Vagrantfile
scripts/vagrant/bootstrap_vagrant.sh
scripts/vagrant/setup-tine20.sh

index 9d07910..d1fd1f5 100644 (file)
@@ -6,7 +6,8 @@ VAGRANTFILE_API_VERSION = "2"
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
        # Name
-       config.vm.box = "precise32"
+       config.vm.box = "saucy-server-cloudimg-amd64-vagrant-disk1"
+    config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box"
 
        # vagrant-cachier caches packages for your vm local
        if Vagrant.has_plugin?("vagrant-cachier")
@@ -25,10 +26,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
        config.vm.provision :shell, :path => "bootstrap_vagrant.sh"
 
        # Configure NFS shared folder
-       config.vm.synced_folder "../../", "/vagrant/tine20.git", type: "nfs"
-       config.vm.synced_folder "", "/vagrant/", type: "nfs"
-
-        #config.vm.synced_folder "../../", "/vagrant/tine20.git", :nfs => false
+    config.vm.synced_folder "", "/vagrant/", type: "nfs"
+    # config.vm.synced_folder "../../", "/usr/local/share/tine20.git", type: "rsync", rsync__exclude: "/.git/"
+    # config.vm.synced_folder "../../", "/usr/local/share/tine20.git", :nfs => false
+    config.vm.synced_folder "../../", "/usr/local/share/tine20.git", type: "nfs"
 
        # Create a private network, which allows host-only access to the machine
        # using a specific IP.
index 7a04e24..ec4ed69 100644 (file)
@@ -76,7 +76,7 @@ phpmyadmin_vhost="
        ServerAlias     www.pma.local\n
 </VirtualHost>\n"
 
-echo -e $phpmyadmin_vhost > /etc/apache2/sites-available/pma-local
+echo -e $phpmyadmin_vhost > /etc/apache2/sites-available/pma-local.conf
 
 # Enable pma-local for apache
 a2ensite pma-local
@@ -101,9 +101,14 @@ if [ -e /etc/php5/conf.d/xdebug.ini ]; then
     echo xdebug.remote_log=/vagrant/logs/php5-xdebug.log >> /etc/php5/conf.d/xdebug.ini
 fi
 
-###################### INSTALL TINE20  ######################
-if [ -d /vagrant/tine20.git/tine20 ]; then
-    source /vagrant/setup-tine20.sh
+
+# Fix mcrypt
+ln -sf /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
+php5enmod mcrypt
+
+###################### INSTALL TINE20 ######################
+if [ -d /usr/local/share/tine20.git/tine20 ]; then
+    source /usr/local/share/tine20.git/scripts/vagrant/setup-tine20.sh
 fi
 
 ###################### FINALS ###########################
index fa804c9..32e80dc 100755 (executable)
@@ -3,10 +3,15 @@
 # Tine 2.0 Vhost
 tine20_vhost="
 <VirtualHost *:80>\n
-    DocumentRoot   \"/vagrant/tine20.git/tine20/\"\n
+    DocumentRoot   \"/usr/local/share/tine20.git/tine20/\"\n
     ServerName      tine20.vagrant\n
     ServerAlias     www.tine20.vagrant\n
     \n
+     <Directory /usr/local/share/tine20.git/tine20/>\n
+       AllowOverride None\n
+       Require all granted\n
+     </Directory>\n
+     \n
     # Active Sync\n
     RewriteEngine on\n
     RewriteRule ^/Microsoft-Server-ActiveSync /index.php?frontend=activesync [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]\n
@@ -21,14 +26,14 @@ tine20_vhost="
     RewriteRule ^/webdav       /index.php?frontend=webdav [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]\n
     RewriteRule ^/remote.php   /index.php?frontend=webdav [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]\n
     \n
-    php_value include_path "/vagrant/conf:/vagrant/tine20.git/tine20/"\n
+    php_value include_path "/etc/tine20:/usr/local/share/tine20.git/tine20/"\n
     \n
-    ErrorLog "/vagrant/logs/error_log"\n
-    CustomLog "/vagrant/logs/access_log" common\n
+    ErrorLog "/var/log/tine20/error_log"\n
+    CustomLog "/var/log/tine20/access_log" common\n
     \n
 </VirtualHost>\n"
 
-echo -e $tine20_vhost > /etc/apache2/sites-available/tine20-vagrant
+echo -e $tine20_vhost > /etc/apache2/sites-available/tine20-vagrant.conf
 
 service apache2 restart
 
@@ -39,12 +44,15 @@ mysql -u root -p"vagrant" -e "CREATE DATABASE tine20;"
 a2ensite tine20-vagrant
 
 # update dependencies
-cd /vagrant/tine20.git/tine20
+cd /usr/local/share/tine20.git/tine20
 sudo -u vagrant composer install --dev --prefer-source --no-interaction
 
 # setup directories
-mkdir -p /vagrant/logs /vagrant/conf /vagrant/cache /vagrant/files /vagrant/tmp
-chown www-data /vagrant/logs /vagrant/conf /vagrant/cache /vagrant/files /vagrant/tmp
+mkdir -p /var/lib/tine20/cache /var/lib/tine20/files /var/lib/tine20/tmp
+mkdir -p /etc/tine20
+mkdir -p /var/log/tine20
+chown -R vagrant /var/lib/tine20
+chown -R vagrant /var/log/tine20
 
 # generate config.inc.php
 tine20_config="
@@ -68,21 +76,21 @@ tine20_config="
     \n
     'caching' => array (\n
         'active' => true,\n
-        'path' => '/vagrant/cache',\n
+        'path' => '/var/lib/tine20/cache',\n
         'lifetime' => 3600,\n
     ),\n
     \n
     'logger' => array (\n
         'active' => true,\n
-        'filename' => '/vagrant/logs/tine20.log',\n
+        'filename' => '/var/log/tine20/tine20.log',\n
         'priority' => '7',\n
     ),\n
-    'filesdir'  => '/vagrant/files',\n
-    'tmpdir' => '/vargrant/tmp',\n
+    'filesdir'  => '/var/lib/tine20/files',\n
+    'tmpdir' => '/var/lib/tine20/tmp',\n
   );\n"
 
-if [ ! -f /vagrant/conf/config.inc.php ]; then
-  echo -e $tine20_config > /vagrant/conf/config.inc.php
+if [ ! -f /etc/tine20/config.inc.php ]; then
+  echo -e $tine20_config > /etc/tine20/config.inc.php
 fi
 
 # generate install.properties
@@ -95,9 +103,30 @@ adminEmailAddress=vagrant@tine20.vagrant\n
 #imap=\n
 #smtp=\n"
 
-if [ ! -f /vagrant/conf/install.properties ]; then
-  echo -e $tine20_installprops > /vagrant/conf/install.properties
+if [ ! -f /etc/tine20/install.properties ]; then
+  echo -e $tine20_installprops > /etc/tine20/install.properties
 fi
 
-cd /vagrant/tine20.git/tine20
-sudo -u vagrant /vagrant/tine20.git/tine20/vendor/bin/phing -D configdir=/vagrant/conf/ tine-install
+cd /usr/local/share/tine20.git/tine20
+sudo -u vagrant /usr/local/share/tine20.git/tine20/vendor/bin/phing -D configdir=/etc/tine20/ tine-install
+
+echo "
+##################################################################################
+# Welcome to tine20.vagrant
+#
+# 1. make sure you have a tine20.vagrant entry in you /etc/hosts file
+#    with your vagrant machine ip (10.10.10.10 per default)
+# 2. navigate in your browser to
+#      http://tine20.vagrant (normal login)
+#      http://tine20.vagrant/setup.php (setup)
+#        username: vagrant
+#        password: vagrant
+# 3. to run phpunit tests:
+       vagrant ssh
+       cd /usr/local/share/tine20.git/tests/tine20
+       /usr/local/share/tine20.git/tine20/vendor/bin/phpunit \
+ -d include_path=/etc/tine20 -d memory_limit=-1 AllTests.php
+#
+# 4. Happy codeing! :-)
+##################################################################################
+"
\ No newline at end of file