summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Vagrantfile135
-rw-r--r--doc/vagrant.markdown50
2 files changed, 86 insertions, 99 deletions
diff --git a/Vagrantfile b/Vagrantfile
index 99beeb2e..63846c3d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,123 +1,110 @@
-$script_sqlite = <<SCRIPT
+$debian_script = <<SCRIPT
apt-get update
-apt-get install -y apache2 php5 php5-gd php5-curl php5-sqlite php5-xdebug
+apt-get install -y apache2 php5 php5-gd php5-curl php5-sqlite php5-xdebug php5-ldap
apt-get clean -y
-echo "ServerName localhost" >> /etc/apache2/apache2.conf
-service apache2 restart
-rm -f /var/www/html/index.html
-date > /etc/vagrant_provisioned_at
-# install Composer
-curl -s https://getcomposer.org/installer | php
-sudo mv composer.phar /usr/local/bin/composer
-# install PHPUnit
-wget https://phar.phpunit.de/phpunit.phar
-chmod +x phpunit.phar
-sudo mv phpunit.phar /usr/local/bin/phpunit
-phpunit --version
-# Set kanboard dir as working dir
-echo "cd /var/www/html" >> /home/vagrant/.bashrc
-SCRIPT
-$script_mysql = <<SCRIPT
-export DEBIAN_FRONTEND=noninteractive
-apt-get update
-apt-get install -y apache2 php5 php5-gd php5-curl php5-mysql php5-xdebug mysql-server mysql-client
-apt-get clean -y
-echo "ServerName localhost" >> /etc/apache2/apache2.conf
+sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf
+
+if [ -f /etc/apache2/sites-enabled/000-default ]; then
+ sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/sites-enabled/000-default
+fi
+
+sudo a2enmod rewrite
service apache2 restart
-service mysql restart
-echo "create database kanboard;" | mysql -u root
+
rm -f /var/www/html/index.html
date > /etc/vagrant_provisioned_at
-# install Composer
-curl -s https://getcomposer.org/installer | php
+
+wget -q https://getcomposer.org/composer.phar
+chmod +x composer.phar
sudo mv composer.phar /usr/local/bin/composer
-# install PHPUnit
-wget https://phar.phpunit.de/phpunit.phar
+
+wget -q https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
-phpunit --version
-# Set kanboard dir as working dir
-echo "cd /var/www/html" >> /home/vagrant/.bashrc
+
SCRIPT
-$script_postgres = <<SCRIPT
-export DEBIAN_FRONTEND=noninteractive
-apt-get update
-apt-get install -y apache2 php5 php5-gd php5-curl php5-pgsql php5-xdebug postgresql postgresql-contrib
-apt-get clean -y
-echo "ServerName localhost" >> /etc/apache2/apache2.conf
-service apache2 restart
-service postgresql restart
+$centos_script = <<SCRIPT
+sudo yum update -y
+sudo yum install -y httpd php php-cli php-gd php-ldap php-mbstring php-mysql php-pdo php-pgsql php-xml wget
+
+sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/httpd/conf/httpd.conf
+
+if [ -x /usr/bin/systemctl ]; then
+ sudo systemctl restart httpd
+ sudo systemctl enable httpd
+ sudo chcon -R -t httpd_sys_content_rw_t /var/www/html/data
+ sudo setsebool -P httpd_can_network_connect=1
+else
+ sudo service httpd restart
+ sudo chkconfig httpd on
+fi
+
rm -f /var/www/html/index.html
date > /etc/vagrant_provisioned_at
-# install Composer
-curl -s https://getcomposer.org/installer | php
+
+wget -q https://getcomposer.org/composer.phar
+chmod +x composer.phar
sudo mv composer.phar /usr/local/bin/composer
-# install PHPUnit
-wget https://phar.phpunit.de/phpunit.phar
+
+wget -q https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
-phpunit --version
-# Set kanboard dir as working dir
-echo "cd /var/www/html" >> /home/vagrant/.bashrc
+
SCRIPT
Vagrant.configure("2") do |config|
- config.vm.define "sqlite" do |m|
- m.vm.box = "ubuntu/trusty64"
- m.vm.provision "shell", inline: $script_sqlite
- m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
- end
-
- config.vm.define "mysql" do |m|
- m.vm.box = "ubuntu/trusty64"
- m.vm.provision "shell", inline: $script_mysql
- m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
- end
-
- config.vm.define "postgres" do |m|
+ config.vm.define "ubuntu" do |m|
m.vm.box = "ubuntu/trusty64"
- m.vm.provision "shell", inline: $script_postgres
+ m.vm.provision "shell", inline: $debian_script
m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
+ m.vm.network :forwarded_port, guest: 80, host: 8001
end
config.vm.define "debian8" do |m|
m.vm.box = "debian/jessie64"
- m.vm.provision "shell", inline: $script_sqlite
+ m.vm.provision "shell", inline: $debian_script
m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
+ m.vm.network :forwarded_port, guest: 80, host: 8002
end
config.vm.define "debian7" do |m|
- m.vm.box = "chef/debian-7.6"
- m.vm.provision "shell", inline: $script_sqlite
+ m.vm.box = "debian/wheezy64"
+ m.vm.provision "shell", inline: $debian_script
m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data"
+ m.vm.network :forwarded_port, guest: 80, host: 8003
end
config.vm.define "debian6" do |m|
- m.vm.box = "chef/debian-6.0.10"
- m.vm.provision "shell", inline: $script_sqlite
+ m.vm.box = "bento/debian-6.0.10"
+ m.vm.provision "shell", inline: $debian_script
m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data"
+ m.vm.network :forwarded_port, guest: 80, host: 8004
end
config.vm.define "centos7" do |m|
- m.vm.box = "chef/centos-7.0"
- m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache"
+ m.vm.box = "centos/7"
+ m.vm.provision "shell", inline: $centos_script
+ m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache", type: "rsync",
+ rsync__exclude: ".git/", rsync__auto: true
+ m.vm.network :forwarded_port, guest: 80, host: 8005
end
- config.vm.define "centos65" do |m|
- m.vm.box = "chef/centos-6.5"
- m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache"
+ config.vm.define "centos6" do |m|
+ m.vm.box = "bento/centos-6.7"
+ m.vm.provision "shell", inline: $centos_script
+ m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache", type: "rsync",
+ rsync__exclude: ".git/", rsync__auto: true
+ m.vm.network :forwarded_port, guest: 80, host: 8006
end
config.vm.define "freebsd10" do |m|
m.vm.box = "freebsd/FreeBSD-10.2-STABLE"
m.vm.base_mac = "080027D14C66"
m.ssh.shell = "sh"
+ m.vm.network :forwarded_port, guest: 80, host: 8007
end
-
- config.vm.network :forwarded_port, guest: 80, host: 8001
- #config.vm.network "public_network", :bridge => "en0: Wi-Fi (AirPort)"
end
diff --git a/doc/vagrant.markdown b/doc/vagrant.markdown
index beebb323..8c41e141 100644
--- a/doc/vagrant.markdown
+++ b/doc/vagrant.markdown
@@ -5,15 +5,13 @@ Vagrant is used to test Kanboard in different environments.
Several configurations are available:
-- Ubuntu 14.04 LTS with Sqlite
-- Ubuntu 14.04 LTS with Mysql
-- Ubuntu 14.04 LTS with Postgresql
-- Debian 8 with sqlite
-- Debian 7.6 with Sqlite
-- Debian 6 with Sqlite
-- Centos 7 with Sqlite
-- Centos 6.5 with Sqlite
-- Freebsd 10 with Sqlite
+- Ubuntu 14.04 LTS
+- Debian 8
+- Debian 7
+- Debian 6
+- Centos 7
+- Centos 6.7
+- Freebsd 10
The installation process is not fully automated for all VM, manual configuration can be required.
@@ -24,10 +22,10 @@ Standard boxes can be downloaded from Vagrant:
```bash
vagrant box add ubuntu/trusty64
vagrant box add debian/jessie64
-vagrant box add chef/debian-7.6
-vagrant box add chef/debian-6.0.10
-vagrant box add chef/centos-7.0
-vagrant box add chef/centos-6.5
+vagrant box add debian/wheezy64
+vagrant box add bento/debian-6.0.10
+vagrant box add centos/7
+vagrant box add bento/centos-6.7
vagrant box add freebsd/FreeBSD-10.2-STABLE
```
@@ -39,26 +37,28 @@ If you want to test Kanboard on Ubuntu with Sqlite:
vagrant up sqlite
```
-Run composer:
+The current directory is synced to the Apache document root.
-```bash
-vagrant ssh sqlite
-cd /var/www/html # change the path according to the chosen distribution
-sudo composer install
-```
+Composer dependencies have to be there, so if you didn't run `composer install` on your host machine you can also do it on the guest machine.
-After the initialization, go to **http://localhost:8001/**.
+Each box have its own TCP port:
-If you want to use Postgresql or Mysql, you have to configure Kanboard manually (`config.php`) and configure the database inside the virtual machine.
+- ubuntu: http://localhost:8001/
+- debian8: http://localhost:8002/
+- debian7: http://localhost:8003/
+- debian6: http://localhost:8004/
+- centos7: http://localhost:8005/
+- centos6: http://localhost:8006/
+- freebsd10: http://localhost:8007/
Available boxes are:
-- `vagrant up sqlite`
-- `vagrant up mysql`
-- `vagrant up postgres`
+- `vagrant up ubuntu`
- `vagrant up debian8`
- `vagrant up debian7`
- `vagrant up debian6`
- `vagrant up centos7`
-- `vagrant up centos65`
+- `vagrant up centos6`
- `vagrant up freebsd10`
+
+Any specific configuration have to done manually (Postgres or Mysql).