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