fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16853] Add vagrant definition


From: sigurdne
Subject: [Fmsystem-commits] [16853] Add vagrant definition
Date: Thu, 8 Jun 2017 09:45:07 -0400 (EDT)

Revision: 16853
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16853
Author:   sigurdne
Date:     2017-06-08 09:45:07 -0400 (Thu, 08 Jun 2017)
Log Message:
-----------
Add vagrant definition

Added Paths:
-----------
    trunk/phpgwapi/doc/Vagrantfile

Added: trunk/phpgwapi/doc/Vagrantfile
===================================================================
--- trunk/phpgwapi/doc/Vagrantfile                              (rev 0)
+++ trunk/phpgwapi/doc/Vagrantfile      2017-06-08 13:45:07 UTC (rev 16853)
@@ -0,0 +1,147 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+# Sigurd: This file will create a virtualbox instance of ubuntu server 16.04 
LTS,
+# complete with postgresql, apache, php and xdebug.
+# The user 'portico' has password 'portico' - and is member of sudoers.
+# Roles/Passwd in posgresql: portico/portico, vagrant/vagrant
+# Portmapping: 80 -> 8080, 20 -> 2222 and 5432 -> 5433
+# Usage: $ vagrant up
+# Docs: https://www.vagrantup.com/
+#
+# All Vagrant configuration is done below. The "2" in Vagrant.configure
+# configures the configuration version (we support older styles for
+# backwards compatibility). Please don't change it unless you know what
+# you're doing.
+Vagrant.configure("2") do |config|
+  # The most common configuration options are documented and commented below.
+  # For a complete reference, please see the online documentation at
+  # https://docs.vagrantup.com.
+
+  # Every Vagrant development environment requires a box. You can search for
+  # boxes at https://atlas.hashicorp.com/search.
+  config.vm.box = "ubuntu/xenial64"
+
+  # Disable automatic box update checking. If you disable this, then
+  # boxes will only be checked for updates when the user runs
+  # `vagrant box outdated`. This is not recommended.
+  # config.vm.box_check_update = false
+
+  # Create a forwarded port mapping which allows access to a specific port
+  # within the machine from a port on the host machine. In the example below,
+  # accessing "localhost:8080" will access port 80 on the guest machine.
+  # NOTE: This will enable public access to the opened port
+  config.vm.network "forwarded_port", guest: 80, host: 8080
+  config.vm.network "forwarded_port", guest: 5432, host: 5433
+
+  # Create a forwarded port mapping which allows access to a specific port
+  # within the machine from a port on the host machine and only allow access
+  # via 127.0.0.1 to disable public access
+  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: 
"127.0.0.1"
+
+  # Create a private network, which allows host-only access to the machine
+  # using a specific IP.
+  # config.vm.network "private_network", ip: "192.168.33.10"
+
+  # Create a public network, which generally matched to bridged network.
+  # Bridged networks make the machine appear as another physical device on
+  # your network.
+  # config.vm.network "public_network"
+
+  # Share an additional folder to the guest VM. The first argument is
+  # the path on the host to the actual folder. The second argument is
+  # the path on the guest to mount the folder. And the optional third
+  # argument is a set of non-required options.
+  # config.vm.synced_folder "../data", "/vagrant_data"
+
+  # Provider-specific configuration so you can fine-tune various
+  # backing providers for Vagrant. These expose provider-specific options.
+  # Example for VirtualBox:
+  #
+  config.vm.provider "virtualbox" do |vb|
+  #   # Display the VirtualBox GUI when booting the machine
+     vb.gui = true
+  #
+  #   # Customize the amount of memory on the VM:
+     vb.memory = "1024"
+  end
+  #
+  # View the documentation for the provider you are using for more
+  # information on available options.
+
+  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
+  # such as FTP and Heroku are also available. See the documentation at
+  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
+  # config.push.define "atlas" do |push|
+  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
+  # end
+
+  # Enable provisioning with a shell script. Additional provisioners such as
+  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
+  # documentation for more information about their specific syntax and use.
+   config.vm.provision "shell", inline: <<-SHELL
+    sudo apt-get update
+    sudo apt-get install -y apt-utils
+    sudo apt-get install -y apache2
+    sudo apt-get install -y mysql-client-core-5.7
+    sudo apt-get install -y libapache2-mod-php7.0 php7.0 php7.0-curl 
php7.0-intl php7.0-mysql php-xdebug php-apcu php7.0-dev php7.0-xmlrpc 
php7.0-xsl php7.0-sybase php7.0-pgsql php7.0-json php7.0-gd php-imagick 
php7.0-imap php7.0-soap php7.0-zip php7.0-mbstring php-pear libaio1 locales
+    sudo apt-get install -y git
+    sudo apt-get install -y less vim-tiny
+    sudo apt-get install -y apg
+    sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ 
`lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
+    wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo 
apt-key add -
+    sudo apt-get update
+    sudo apt-get install -y postgresql postgresql-contrib
+
+    # fix permissions
+    echo "-------------------- fixing listen_addresses on postgresql.conf"
+    sudo sed -i "s/#listen_address.*/listen_addresses '*'/" 
/etc/postgresql/9.6/main/postgresql.conf
+    echo "-------------------- fixing postgres pg_hba.conf file"
+    # replace the ipv4 host line with the above line
+  
+    sudo cat >> /etc/postgresql/9.6/main/pg_hba.conf <<EOF
+    # Accept all IPv4 connections - FOR DEVELOPMENT ONLY!!!
+    host    all         all         0.0.0.0/0             md5
+EOF
+  
+    echo "-------------------- creating postgres vagrant role with password 
vagrant"
+    # Create Role and login
+
+    sudo su postgres -c 'psql -c "CREATE ROLE vagrant SUPERUSER LOGIN PASSWORD 
'"'"'vagrant'"'"'" '
+    sudo su postgres -c 'psql -c "CREATE ROLE portico SUPERUSER LOGIN PASSWORD 
'"'"'portico'"'"'" '
+    sudo apt install -y whois
+    sudo useradd -p `mkpasswd "portico"` -d /home/"portico" -m -g users -s 
/bin/bash "portico"
+    sudo echo 'portico  ALL=(ALL:ALL) ALL' >> /etc/sudoers
+
+    sudo apt-get upgrade -y
+  
+    sudo sed -i 's/"GP"/"GPCS"/' /etc/php/7.0/apache2/php.ini
+    sudo sed -i 's/"GP"/"GPCS"/' /etc/php/7.0/cli/php.ini
+ 
+    sudo cat > /etc/php/7.0/apache2/conf.d/91-app.ini <<EOF
+xdebug.max_nesting_level=200
+xdebug.overload_var_dump=Off
+xdebug.remote_autostart=Off
+xdebug.remote_connect_back=On
+xdebug.remote_enable=On
+xdebug.remote_port=9000
+session.cookie_secure=Off
+session.use_cookies=On
+session.use_only_cookies=On
+short_open_tag=Off
+request_order = "GPCS"
+variables_order = "GPCS"
+memory_limit = 5048M
+max_input_vars = 5000
+error_reporting = E_ALL & ~E_NOTICE
+display_errors = On
+post_max_size = 20M
+upload_max_filesize = 8M
+EOF
+
+    sudo cp /etc/php/7.0/apache2/conf.d/91-app.ini 
/etc/php/7.0/cli/conf.d/91-app.ini
+ 
+    sudo service postgresql restart
+    sudo service apache2 restart
+   SHELL
+
+end




reply via email to

[Prev in Thread] Current Thread [Next in Thread]