Chassis / Chassis

📦 Chassis is a virtual server for your WordPress site, built using Vagrant.
http://chassis.io/
GNU Lesser General Public License v3.0
621 stars 84 forks source link

Site only appears in /wp directory, not site root #606

Closed danfoy closed 5 years ago

danfoy commented 5 years ago

Hey guys,

I had a working copy of Chassis, but I had some issues with imported data (specifically image URLs in posts) because my live website is in the www. domain, whereas Chassis only seems to work without www.

The value for hosts in config.local.yaml was initially set to danfoy.local, so I added - www.danfoy.local as the second option to see if WordPress would sort the links out for me, but that seemed to break my installation. So I removed everything, destroyed the vagrant box, removed it from VirtualBox, deleted the /chassis folder, and reinstalled. But now for some reason my site will only load from danfoy.local/wp - trying to access danfoy.local just loads forever.

Any idea why this is happening?

The site and WordPress addresses are set as danfoy.local and danfoy.local/wp in WordPress general settings automatically and as they should be. Updating the permalinks seems to make no difference. I'm running macOS 10.14.2 Mojave, Vagrant 2.2.3, and VirtualBox 5.2.24.

Here is my current config.local.yaml:

# Chassis Configuration
#
# This file is the default configuration for all projects. The fallback order of
# configuration files is:
#
# - project/content/config.local.yaml   (project-specific overrides)
# - project/content/config.yaml         (project-specific defaults)
# - project/config.local.yaml          (global overrides)
# - project/config.yaml                 (global defaults)

# Domain names to use for Vagrant
#
# The first name will be used as the machine's name, subsequent names will be
# aliased in your hosts file and in nginx
#
# (When overriding, include vagrant.local if you need it)
hosts:
    - danfoy.local

# Site Configuration
# (When overriding, include all values)
site:
    name: danfoy local

# Database configuration
# (When overriding, include all values)
database:
    name: wordpress
    user: wordpress
    password: vagrantpassword
    prefix: wp_

# Admin configuration
# (When overriding, include all values)
admin:
    user: admin
    email: admin@example.com
    password: password

# Paths
#
# If transplanting Chassis into an existing project, you can set these manually.
# These can be set to absolute paths, or relative paths.
paths:
    # Base directory for reference. Relative to the Chassis directory.
    base: .

    # Where WordPress lives. Relative to the base directory.
    wp: wp

    # Content directory. Relative to the base directory.
    content: content

# Synced Folders
#
# You can sync as many folders as you like. We sync the nginx and php log folders by default.
synced_folders:
    logs/nginx: /var/log/nginx
    logs/php: /var/log/php
    ../dist: /vagrant/wp/wp-content/themes/danfoy2019

# Plugins
#
# Install and activate a list of plugins from wp.org
plugins:
    - ajax-thumbnail-rebuild
    - gutenberg
    - jetpack
    - theme-check

# Extensions
#
# Install a list of extensions automatically
extensions:
    - Chassis/phpMyAdmin
    - Chassis/db-backup
    - Chassis/Imagick
    - Chassis/MailHog
    # - javorszky/chassis-openssl

# PHP version
# Values: 5.6, 7.0, 7.1, 7.2 (or 5.6.30)
php: 7.2

# VirtualBox-specific customisations.
virtualbox:
    # Memory, in megabytes.
    #
    # (e.g. 1024)
    memory: null

    # CPU count.
    #
    # (e.g. 2)
    cpus: null

Any ideas would be greatly appreciated, thanks in advance

danfoy commented 5 years ago

It turned out that danfoy.local/index.php did load correctly. I changed the php version above from 7.2 to 7.0, and the site loads again at danfoy.local/. And then I changed it back to 7.2 and everything still works. So still no idea what happened there, but looks like I'm sorted, sorry for bothering you

rmccue commented 5 years ago

I'm glad you managed to work this one out!

FWIW, www.foo.local won't work automatically with the way DNS works in Chassis, but should work if you add it to your hosts file manually.