Trellis WordPress

Install WordPress with Trellis

Local Setup macOS

Before getting started you need to make sure the below are installed first.

Create a new project directory on your local system.

mkdir example.com && cd example.com

Install Trellis:

git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git

Install Bedrock into the site directory:

composer create-project roots/bedrock site

Ansible Vault

  1. Create new file .vault_pass in the trellis directory.
  2. Generate a password and paste in the file than save.
  3. Open ansible.cfg and paste the below path under default.

    vault_password_file = .vault_pass
  4. In terminal run the below command to encrypt the passwords.

    ansible-vault encrypt group_vars/all/vault.yml group_vars/development/vault.yml group_vars/production/vault.yml

Github

Deploying to Github

git init
gst
get add .
git commit -m "first commit"
git remote add origin git@github.com:username/repo.git
git push -u origin master

Commands

vagrant up
vagrant ssh
vagrant reload --provision
vagrant destroy
vagrant destroy -f

Troubleshooting

Logs

cd /var/log/

trellis default: Mounting NFS shared folders

After you have ran vagrant up if it get stuck hanging at this stage, once of the problems could be the filesystem is encrypted.

To check this for macOS you can run.

sudo fdesetup status

It will prompt you for the users password and if the output comes back with FileVault is On run the below to disable it.

sudo fdesetup disable

This will also prompt you for the username and password.

Once again run sudo fdesetup status to check to see if the FileVault is Off.

See below input and output.

➜  ~ sudo fdesetup status
Password:
FileVault is On.
➜  ~ sudo fdesetup disable
Enter the user name:username
Enter the password for user 'username':
FileVault has been disabled.
➜  ~ sudo fdesetup status
Password:
FileVault is Off.
➜  ~

mount -o vers=3,udp 192.168.50.1:/System/Volumes/Data/Users/…

If you face trouble with an error similar to this, it could be the firewall that is blocking it.

System Preferences -> Security & Privacy -> Firewall -> Firewall Options

You have a couple options with this.

  1. Disable the Firewall.
  2. Add to the allowed list.
    netbiosd           block incoming connections
    nfsd                  allow incoming connections
    rpc.lockd          allow incoming connections
    rpc.rquotad      allow incoming connections
    rpc.statd          allow incoming connections
    rpcbind            allow incoming connections
    VirtualBoxVM  allow incoming connections
  3. Allow signed software.
    Automatically allow signed software to receive incoming connections
  4. NSF restart.
    sudo nfsd restart

iTerm

Full Disk Access to iTerm, if this is not selected in the Permission setting can cause some issues.

Was this helpful?

Leave a Comment