2017-07-19 155 views
0

我刚刚安装并设置VVV与Vagrant和虚拟框,一切都在基层完美工作。VVV,自定义网站的网址重定向到仪表板

我试着按照他们的例子添加一个自定义网站,但是当我导航到自定义网站的URL(vvvtest.dev)时,我发送到VVV仪表板而不是新网站的WP安装过程。

我正在使用vagrant-hostsupdater,所以主机文件正在为我填充以及流浪触发器。

任何帮助将不胜感激!

编辑:我注意到在我的主机文件中,vvvtest.dev指向与vvv和vvv.dev相同的位置(sim链接?),请参见截图。我在配置过程中出错了哪里?存储在主文件夹

我的VVV-custom.yml文件(流浪汉本地):存储在WWW/vvvtest /提供

sites: 
    # The wordpress-default configuration provides a default installation of the 
    # latest version of WordPress. 
    wordpress-default: 
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git 
    hosts: 
     - local.wordpress.dev 

    # The wordpress-develop configuration is useful for contributing to WordPress. 
    wordpress-develop: 
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git 
    hosts: 
     - src.wordpress-develop.dev 
     - build.wordpress-develop.dev 

    # Custom Install Test 
    vvvtest: 
    hosts: 
     - vvvtest.dev  

    # The following commented out site configuration will create a standard WordPress 
    # site in www/example-site/ available at http://my-example-site.dev. 

    #example-site: 
    # repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git 
    # hosts: 
    # - my-example-site.dev 

    # The following commented out site configuration will create a environment useful 
    # for contributions to the WordPress meta team: 

    #wordpress-meta-environment: 
    # repo: https://github.com/WordPress/meta-environment.git 

utilities: 
    core: 
    - memcached-admin 
    - opcache-status 
    - phpmyadmin 
    - webgrind 

我的nginx.conf文件:

server { 
    listen 80; 
    listen 443 ssl; 
    server_name vvvtest.dev; 
    root {vvv_path_to_site}; 

    error_log {vvv_path_to_site}/log/error.log; 
    access_log {vvv_path_to_site}/log/access.log; 

    set $upstream {upstream}; 

    include /etc/nginx/nginx-wp-common.conf; 
} 

我vvv-init.sh文件,存储在WWW/vvvtest /提供

#!/usr/bin/env bash 

# Add the site name to the hosts file 
echo "127.0.0.1 ${VVV_SITE_NAME}.local # vvv-auto" >> "/etc/hosts" 

# Make a database, if we don't already have one 
echo -e "\nCreating database '${VVV_SITE_NAME}' (if it's not already there)" 
mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS ${VVV_SITE_NAME}" 
mysql -u root --password=root -e "GRANT ALL PRIVILEGES ON ${VVV_SITE_NAME}.* TO [email protected] IDENTIFIED BY 'wp';" 
echo -e "\n DB operations done.\n\n" 

# Nginx Logs 
mkdir -p ${VVV_PATH_TO_SITE}/log 
touch ${VVV_PATH_TO_SITE}/log/error.log 
touch ${VVV_PATH_TO_SITE}/log/access.log 

# Install and configure the latest stable version of WordPress 
cd ${VVV_PATH_TO_SITE} 
if ! $(wp core is-installed --allow-root); then 
    wp core download --path="${VVV_PATH_TO_SITE}" --allow-root 
    wp core config --dbname="${VVV_SITE_NAME}" --dbuser=wp --dbpass=wp --quiet --allow-root 
    wp core multisite-install --url="${VVV_SITE_NAME}.local" --quiet --title="${VVV_SITE_NAME}" --admin_name=admin --admin_email="[email protected]${VVV_SITE_NAME}.local" --admin_password="password" --allow-root 
else 
    wp core update --allow-root 
fi 

Hosts文件: Windows Hosts File

回答

0

在您的www/vvvtest /拨备/ nginx.conf文件,也许你可以尝试根目录修改到:

root {vvv_path_to_site}/public_html; 

希望它能帮助。