elpaso / qgis3-server-vagrant

qgis3 server vagrant
26 stars 7 forks source link

Using this VM with Amazon AWS EC2 #3

Closed umbe1987 closed 4 years ago

umbe1987 commented 5 years ago

Dear Alessandro,

first of all thank you so much for sharing this repo.

I am trying to use this VM with my Amazon AWS but having troubles in setting up the Vagrantfile. Have you ever done it before? I think it should be useful to show how edited the Vagrantfile (see below). I also made a SO question with some details.

Any help would be really appreciated.

Cheers and thanks again!

My modified Vagrantfile (without secret stuff)

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Require the AWS provider plugin
require ‘vagrant-aws’

# Creating and configuring the AWS instance
Vagrant.configure(‘2’) do |config|

  # Use dummy AWS box
  config.vm.box = ‘aws’

  # Disk space (free tier ebs is limited to 30!!!)
  config.disksize.size = '20GB'

  # (taken from https://github.com/elpaso/qgis3-server-vagrant)
  config.vm.network "forwarded_port", guest: 80, host: 8080 # nginx fastcgi
  config.vm.network "forwarded_port", guest: 81, host: 8081 # apache fastcgi
  config.vm.network "forwarded_port", guest: 82, host: 8082 # nginx uwsgi
  config.vm.network "forwarded_port", guest: 83, host: 8083 # nginx mapproxy

  # Specify configuration of AWS provider
  config.vm.provider ‘aws’ do |aws, override|
    # Read AWS authentication information from environment variables
    aws.access_key_id = ‘MY_ACCESS_ID’
    aws.secret_access_key = ‘MY_SECRET_ID’
    # Specify SSH keypair to use
    aws.keypair_name = ‘MY_KEY’
    # Specify region, AMI ID, Instance and security group
    aws.region = ‘eu-west-3’
    aws.ami = ‘ami-38a01045’
    aws.instance_type = ‘t2.micro’
    # Specify username and private key path
    override.ssh.username = ‘umberto’
    override.ssh.private_key_path = ‘path/to/my/key/pair’
  end

    # Install the required software
  config.vm.provision "shell",
    path: "provisioning/setup.sh",
    args: ENV['SHELL_ARGS']

  # Run every time the VM starts
  config.vm.provision "shell",
    path: "provisioning/job.sh",
    args: ENV['SHELL_ARGS'],
    run: "always"

end
umbe1987 commented 5 years ago

I had some success with the configuration, but provisioning/common.sh is throwing an error.

I think something has changed in the qgis server key or something. Could you please confirm this?

These lines:

echo "Changing QGIS_SERVER_DIR to ${QGIS_SERVER_DIR} ..."

# Add QGIS repositories
apt-key adv --keyserver keyserver.ubuntu.com --recv-key CAEB3DC3BDF7FB45
echo 'deb http://qgis.org/debian-nightly bionic main' > /etc/apt/sources.list.d/debian-gis.list

outputs these errors:

    default: Changing QGIS_SERVER_DIR to /qgis-server ...
    default: Warning: apt-key output should not be parsed (stdout is not a terminal)
    default: Executing: /tmp/apt-key-gpghome.HAei8P6rwA/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key CAEB3DC3BDF7FB45
    default: gpg: key CAEB3DC3BDF7FB45: 1 signature not checked due to a missing key
    default: gpg: key CAEB3DC3BDF7FB45: public key "QGIS Archive Automatic Signing Key (2017) <qgis-developer@lists.osgeo.org>" imported
    default: gpg: Total number processed: 1
    default: gpg:               imported: 1
    default: Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
    default: Get:2 http://qgis.org/debian-nightly bionic InRelease [3327 B]
    default: Hit:3 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease
    default: Hit:4 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease
    default: Hit:5 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
    default: Hit:6 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease
    default: Get:7 http://qgis.org/debian-nightly bionic/main amd64 Packages [7256 B]
    default: Fetched 10.6 kB in 1s (12.2 kB/s)
    default: Reading package lists...
    default: W
    default: : 
    default: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: W
    default: : 
    default: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/microsoft-prod.list:1 and /etc/apt/sources.list.d/microsoft.list:1
    default: E
    default: : 
    default: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
    default: E
    default: : 
    default: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
elpaso commented 4 years ago

Please have a look to my latest commits, sorry for the delay.