Deploying Staging and Production to Server Environment

Apologies if this comes off as a really stupid question – but having made it all the way through the deployment of Capistrano of Bedrock, I’m stumped how that actually translates into a live environment. I see the deploy, but not sure what I do to get it up on Basically, my folder structure look like this (relevant directory only):

  • public_html |
    –myapp [Capistrano deploy]
    ---- current
    ----- web
    ---- releases, etc…

It seems like either I am messing up the folder structure of the deploy OR I am supposed to set .htaccess files that will direct to the myapp/current/web folder with relevant rewrites.

Am I right about this or have I just screwed it up?

DId you setup your server using Bedrock Ansible?

I’m a little confused.

Is an existing folder on your server that either a) you want the site served out of, or b) something is already server out of. Meaning, is Apache configured to server a WP project out of

If so, the solution seems mostly simple. In your deploy.rb just change deploy_to:

set :deploy_to, -> { "/srv/www/#{fetch(:application)}" } # default
set :deploy_to, -> { "/srv/www/" }

Then your repo will be deployed into which it seems like you want/need.

Thanks for writing back – first off, not using ansible.

So, I made the changes to the deploy.rb and it seems to mostly work (it’s pointing to the right place, though for some reason I am getting this error:

"Warning: require(/home/mysite/public_html/ failed to open stream: No such file or directory in /home/mysite/public_html/ on line 5

Fatal error: require(): Failed opening required ‘/home/mysite/public_html/’ (include_path=’.:/usr/local/php53/lib:/usr/lib/php:/usr/local/lib/php’) in /home/mysite/public_html/ on line 5"

But that (I think) is an unrelated issue. What I am trying to do is pretty basic – I want a production site at /public_htm/ and the staging server to live at /public_html/

I guess my question here is that while following your suggestion in deploy.rb I could create an additional

set :deploy_to, -> { “/home/public_html/” } for the production site, but (and again, I’m new at this, so thank you for bearing with me – isn’t that or shouldn’t that be specified in staging.rb and production.rb?

Basically what I want is that when I run bundle exec cap staging deploy – it deploys to /home/public_html/ and when it deploys to production it goes to /home/public_html/

Thanks you so much for the help so far.