What's the relationship between Passenger and Capistrano? - ruby-on-rails-3

I am relatively inexperienced in rails and I am confused by where Capistrano fits into the rails app life cycle.
From my understanding the following steps are involved in getting a rails app completed.
Select and set up a host (e.g linode)
Install apache2
Install rvm
Install ruby and install rails
Install passenger
Create an application and test at domain.com:3000 by using 'rails s' command
However it is not clear to me how the next steps work. In particular:
a) The live rails app needs to run in production mode at domain.com, I presume passenger does this?
b) If I have created the app at domain.com:3000 do I need to do anything in the rails config before it works at domain.com?
c) Where does capistrano fit in? If passenger can make my app work at domain.com, what does capistrano do?

a) Exactly, passenger working with a web server like Apache does this for you.
b) Your local web server is not the same with Passenger. To set it up in your domain, you would need to normally create your domain and set a website as you normally set a website in your apache(or other) configuration.
c) Capistrano is a gem that allows you to write scripts which automate things, like restarting the web server, or setting particular production versions and so on.
For more information on Capistrano :
http://railscasts.com/episodes/133-capistrano-tasks

Related

Does file copy deployments work with CakePHP?

I have a legacy CakePHP(1.3.13) app, running on Ubuntu server 16.04, on apache. It is using php 5.6. I'm trying to migrate the app to a development server, also Ubuntu 16.04, but running php 7.2.
On the production machine, php file(s) are being executed even before line 1 of index.php in the app I'm trying to migrate. On the dev box, this isn't happening.
I've sudo tar'ed the entire web server tree, and sudo untar'ed it on the dev box. I've copied the apache site configs, and only edited them for hostnames.
I don't understand why apache is running one or many php files PRIOR to running index.php on the production box. It is apparently loading a custom configuration php file, that sets up some global variable, but for the life of me I can't figure out why this is happening. I'm sure I'm just missing something dumb.
Greg Schmidt nailed it. There was a second auto_prepend_file=MagicallyExecutingScript.php in the php.ini.

How do you install an apache server (httpd) on codenvy?

I would like to have a simple httpd server on my codenvy machine in order to run a front-end web app. How do I install it?
Create a workspace with the template "php-default", then a php project. Try run, access the url the "start apache" gave you, and it should work ! I got a running app in less than 3 minutes.

Move files from node.js to apache server

Is there any possible for moving files from platform like Heroku to second server like Apache? I want to create application and push it to Heroku, but I have also Apache server and I want send to this server all images which I upload from frontend forms.
EDIT
ok so You want to use Heroku as the main application server. But then Heroku makes HTTP/HTTPS requests to the Apache server?
I think thats what you are asking.
Yeah no issues with that. if you want to set up API id go with Laravel 5.3 and use its passport function on your Apache server ( but this is not required, this is only for security.)
https://laravel.com/docs/5.3/passport
END OF EDIT
what the web server is really does not matter at all.
Its about if the server has internet access and im pretty sure they do.
Easiest way is ftp,SSH,or git. unless they both have a web server then id just zip up your app without the node_modules folder and move it into the web directory. then go to the address of your server in a web browser. eg. http://mywebsite.com/files-i-just-zipped.zip and download them. (i normally log onto the new server via SSH and do wget http://mywebsite.com/files-i-just-zipped.zip)
I need more info but yeah. once you unzip then you need to install node but my guess is they already have it.
then do npm install in the package.json directory.

Capistrano Resque with one worker for production

I am really confused on how to get Resque and resque_mailer working on my production server. What I need to do is get a single worker running/restart which is called 'mailer' via Capistrano when I do a cap deploy.
I've seen this gist but I just don't get it. Is there something else that breaks it down to explain what its doing. Or is there a simpler solution to get this working?
I've already got Redis working as I'm already using it for other tasks.
My production server is as follows: Ubuntu, Apache, Passenger, Ruby 2.0, Rails 4.0
In the end I used Sidekiq. The documentation is much better and just works!

How important is choosing a particular community Ubuntu AMI on ec2 to deploy rails app?

I tried my best to deploy rails website on ec2, Unfortunately, I got some weird error like "Symbolic link not allowed" More details here ->
Deployed rails site on ec2 using capistrano, but it doesn't show up on the browser, here is the site -> http://passionate4.net/
Question: Is there a better way to choose ubuntu ami? Will that make the difference?
You have configuration issue. Just fix it.
Have you set Options FollowSymLinks in your HTTPD config?