Setting up a local WP development

Sorry alwaysblank,

I should of been more clear. I updated that line in vagrant.default.yml to my ip address but it still didn’t work. Maybe i have to provision it again for the changes to take effect? Should i try that?

---
# vagrant_ip: '192.168.50.5'
vagrant_ip: '151.227.234.196'
vagrant_cpus: 1
vagrant_memory: 1024 # in MB
vagrant_box: 'bento/ubuntu-18.04'
vagrant_box_version: '>= 201807.12.0'
vagrant_ansible_version: '2.7.5'
vagrant_skip_galaxy: false
vagrant_mount_type: 'nfs'

vagrant_install_plugins: true
vagrant_plugins:
  - name: vagrant-bindfs
  - name: vagrant-hostmanager

# Array of synced folders:
# - local_path: .
#   destination: /path/on/vm
#   create: false
#   type: nfs
#   bindfs: true
#   mount_options: []
#   bindfs_options: {}
# See https://www.vagrantup.com/docs/synced-folders/basic_usage.html#mount_options
vagrant_synced_folders: []

You’re not meant to change the IP for your VM. You need to point the domain to your VM’s IP in your hosts file. Please read about what a hosts file is here: https://en.wikipedia.org/wiki/Hosts_(file)

The Rackspace Support link I posted is very clear about how to edit the hosts file on Windows. Did you read it?

I’ve reverted that file back to its original state. Looking at the hosts file, it looks like the ip is already registered to the domain correctly?

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

## vagrant-hostmanager-start id: 759a05ce-d4dc-474d-a609-886cd3d9e0ba
192.168.50.5	roots-example-project.test
192.168.50.5	www.roots-example-project.test
## vagrant-hostmanager-end

Ansible may have hit some errors the first time you ran vagrant up which prevented it from completing the provisioning (this happened to me when I tested it yesterday). vagrant up will only run provisioning the first time a machine is brought up, unless you specifically tell it to re-provision. Try running vagrant reload --provision from your Trellis directory.

Thanks for the timely responses alwaysblank, i do appreciate it. I know i’m a pain haha

This was the output:

ashley@DESKTOP-EKBG4DV:/mnt/c/Users/acell/Desktop/Sites/site1/trellis$ vagrant reload --provision
/mnt/c/Users/acell/Desktop/Sites/site1/trellis/Vagrantfile:1: warning: already initialized constant ANSIBLE_PATH
/mnt/c/Users/acell/Desktop/Sites/site1/trellis/Vagrantfile:1: warning: previous definition of ANSIBLE_PATH was here
/mnt/c/Users/acell/Desktop/Sites/site1/trellis/Vagrantfile:2: warning: already initialized constant ANSIBLE_PATH_ON_VM
/mnt/c/Users/acell/Desktop/Sites/site1/trellis/Vagrantfile:2: warning: previous definition of ANSIBLE_PATH_ON_VM was here
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'bento/ubuntu-18.04' version '201906.18.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /mnt/c/Users/acell/Desktop/Sites/site1/trellis
    default: /home/vagrant/trellis => /mnt/c/Users/acell/Desktop/Sites/site1/trellis
    default: /home/vagrant/trellis/bin => /mnt/c/Users/acell/Desktop/Sites/site1/trellis/bin
    default: /srv/www/roots-example-project.com/current => /mnt/c/Users/acell/Desktop/Sites/site1/site
==> default: Running provisioner: ansible...
    default: Running ansible-galaxy...
- changing role composer from 1.7.0 to 1.7.0
- downloading role 'composer', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-composer/archive/1.7.0.tar.gz
- extracting composer to /mnt/c/Users/acell/Desktop/Sites/site1/trellis/vendor/roles/composer
- composer (1.7.0) was installed successfully
- changing role ntp from 1.6.0 to 1.6.0
- downloading role 'ntp', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-ntp/archive/1.6.0.tar.gz
- extracting ntp to /mnt/c/Users/acell/Desktop/Sites/site1/trellis/vendor/roles/ntp
- ntp (1.6.0) was installed successfully
- changing role logrotate from v0.0.5 to v0.0.5
- downloading role 'logrotate', owned by nickhammond
- downloading role from https://github.com/nickhammond/ansible-logrotate/archive/v0.0.5.tar.gz
- extracting logrotate to /mnt/c/Users/acell/Desktop/Sites/site1/trellis/vendor/roles/logrotate
- logrotate (v0.0.5) was installed successfully
- changing role swapfile from v2.0.6 to v2.0.6
- downloading role 'swapfile', owned by oefenweb
- downloading role from https://github.com/Oefenweb/ansible-swapfile/archive/v2.0.6.tar.gz
- extracting swapfile to /mnt/c/Users/acell/Desktop/Sites/site1/trellis/vendor/roles/swapfile
- swapfile (v2.0.6) was installed successfully
- changing role mailhog from 2.1.3 to 2.1.3
- downloading role 'mailhog', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-mailhog/archive/2.1.3.tar.gz
- extracting mailhog to /mnt/c/Users/acell/Desktop/Sites/site1/trellis/vendor/roles/mailhog
- mailhog (2.1.3) was installed successfully
 [WARNING]: - dependency geerlingguy.daemonize from role mailhog differs from
already installed version (1.2.1), skipping

    default: Running ansible-playbook...

PLAY [Set ansible_python_interpreter] ******************************************

TASK [python_interpreter : Get Ubuntu release] *********************************
System info:
  Ansible 2.5.1; Vagrant 2.2.5; Linux
  Trellis 1.0.3: April 30th, 2019
---------------------------------------------------
Failed to connect to the host via ssh: Bad owner or permissions on
/home/ashley/.ssh/config

fatal: [default]: UNREACHABLE! => {"changed": false, "unreachable": true}
        to retry, use: --limit @/mnt/c/Users/acell/Desktop/Sites/site1/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=0    changed=0    unreachable=1    failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

So i cd’ed to the file that i was struggling with and did a

chmod 744 config

and then re-ran this from the trellis folder

vagrant reload --provision

Loading composer repositories with package information Installing
dependencies (including require-dev) from lock file Package operations: 12
installs, 0 updates, 0 removals - Installing composer/installers (v1.6.0):
Downloading (100%) Plugin installation failed, rolling back - Removing
composer/installers (v1.6.0) [RuntimeException] Could not delete /srv/www
/roots-example-project.com/current/vendor/composer/installers/src/Composer:
install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev]
[–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress]
[–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a
|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–]
[]…
failed: [default] (item=roots-example-project.com) => {“changed”: false, “item”: “roots-example-project.com”, “stdout”: “Loading composer repositories with package information\nInstalling dependencies (including require-dev) from lock file\nPackage operations: 12 installs, 0 updates, 0 removals\n - Installing composer/installers (v1.6.0): Downloading (100%)\nPlugin installation failed, rolling back\n - Removing composer/installers (v1.6.0)\n\n \n [RuntimeException] \n Could not delete /srv/www/roots-example-project.com/current/vendor/composer/installers/src/Composer: \n \n\ninstall [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress] [–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–] []…\n\n”, “stdout_lines”: [“Loading composer repositories with package information”, “Installing dependencies (including require-dev) from lock file”, “Package operations: 12 installs, 0 updates, 0 removals”, " - Installing composer/installers (v1.6.0): Downloading (100%)“, “Plugin installation failed, rolling back”, " - Removing composer/installers (v1.6.0)”, “”, " ", " [RuntimeException] ", " Could not delete /srv/www/roots-example-project.com/current/vendor/composer/installers/src/Composer: ", " ", “”, “install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress] [–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–] []…”, “”]}

RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]

RUNNING HANDLER [common : reload php-fpm] **************************************
changed: [default]

RUNNING HANDLER [common : reload nginx] ****************************************
changed: [default]

RUNNING HANDLER [common : perform nginx reload] ********************************
changed: [default]

RUNNING HANDLER [fail2ban : restart fail2ban] **********************************
changed: [default]

RUNNING HANDLER [ferm : restart ferm] ******************************************
skipping: [default]

RUNNING HANDLER [ntp : restart ntp] ********************************************
changed: [default]

RUNNING HANDLER [sshd : restart ssh] *******************************************
changed: [default]

RUNNING HANDLER [mariadb : restart mysql server] *******************************
changed: [default]
to retry, use: --limit @/mnt/c/Users/acell/Desktop/Sites/site1/trellis/dev.retry

PLAY RECAP *********************************************************************
default : ok=117 changed=82 unreachable=0 failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

This topic was automatically closed after 42 days. New replies are no longer allowed.