使用Capistrano部署Wordpress网站

时间:2018-07-12 13:42:58

标签: wordpress

我正在尝试使用capistrano部署wordpress网站。这是我的deploy.rb文件。

# config valid only for current version of Capistrano
lock "3.11.0"

set :deploy_to, "/home/#{fetch(:deploy_user)}/#{fetch(:application)}"


set :ssh_options, {
  forward_agent: true,
}


set :pty, true


set :keep_releases, 5


set :linked_files, %w{wp-activate.php wp-blog-header.php wp-comments-post.php wp-config.php wp-cron.php wp-links-opml.php wp-load.php wp-login.php wp-mail.php wp-settings.php wp-signup.php wp-trackback.php xmlrpc.php wp-content/index.php wp-content/themes/index.php index.php .htaccess}


set :linked_dirs, fetch(:linked_dirs, []).push('wp-content/plugins','wp-content/uploads','wp-admin','wp-includes','wp-content/upgrade','wp-content/themes/twentyfifteen','wp-content/themes/twentysixteen','wp-content/themes/twentyseventeen')

除了我上载主题外,所有内容似乎都能正常工作,它将主题放在/ shared / wp-content / themes文件夹中,而不是当前/ wp-content / themes文件夹中。

我的apache虚拟主机文件设置如下

<Directory /home/user/app/current/>
        Options Indexes FollowSymLinks
        AllowOverride All
    Require all granted
</Directory>

它从哪里得到路径?

阅读说明文档

  

您无法移动themes文件夹,因为其路径是相对于wp-content文件夹的硬编码:

似乎是从app / shared而不是app / current那里获取wp-content文件夹。应用程序/当前目录中的一个不是与应用程序/共享目录中的一个的符号链接

1 个答案:

答案 0 :(得分:0)

重新运行wordpress安装脚本。现在工作正常。