Capistrano Resque with one worker for production - redis

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!

Related

PHPBB 3.0.1 website migrating to new hosting service

I am trying to find some guidance on where to go next on the issue I am having migrating a phpbb3 site from one hosting service to another.
I have checked to make sure the config.php file has been changed to work on the new server, as well as the common.php file. I am getting a HTTP 500 error when I try to search for the forum. The main site is working normally, just the message board is having a problem.
Nothing about the structure of the sites pages has changed, only the hosting server. (I downloaded a copy of the website before moving it so I have everything in the exact way it was before, just on the new server.)
Do I need to install phpbb onto the server itself with Softaculous?
Anything would help, I need to get the site back up and running soon.
Thanks in advance.
Jacob
This post would have been better addressed on phpBB.com support section...
In any cases most hosting companies out there will perform the migration for you for free.
Did you ask about handling a migration for you?
There are many things that need to be done when migrating to a new hosting.
here a couple of pointers for you:
-PHP version in use should be PHP 5.6.x as phpBB 3.0.x does not support higher PHP versions
-config.php might need updating, for example these two fields:
$dbhost = '';
$dbport = '';
-check your error logs in your cPanel as they will reveal the cause of the 500 error
Also, NO you do not need Softaculous
I'll be happy to help you with this if you PM me on:
https://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1428301
-SiteSplat
The php version on the new hosting services server was above what phpBB 3.0.x needed. I upgraded phpBB to version 3.2.9 and the issue was resolved.

Other Application Cartridges availability in Openshift Origin

I was able to install the default cartridges bundled in Origin,,
What if I need to add some application like ex: httpd server, ldap server, tomcat etc..
Is there a way to do it, I saw the DIY and customer cartridge install, is there any pointers on how to use those?
Regards
G
I am not sure your question is 100% clear. If you are trying to install downloadable cartridges, you should be able to use the same syntax that you use for online, something like:
rhc app create jekyll https://raw.github.com/openshift-cartridges/openshift-jekyll-cartridge/master/metadata/manifest.yml
If that is not what you are asking, can you be more specific about what you are trying to do, and what you have tried already and what errors it gave?

How to set the default host when using Rubber to deploy to EC2?

I am running Rails 3.0.3 and trying to use Rubber to deploy my app to Amazon ec2. I watched Railscast #347 on this subject and followed every step. But when I run cap rubber:create_staging, I get .../gems/amazon-ec2-0.9.17/lib/AWS.rb:142:in 'initialize': No :server provided (AWS::ArgumentError), which when I look at the line in AWS.rb seems like I should have set a default_host somewhere, but Ryan Bates never mentioned that in the Railscast and I don't know where to set that or what that even really means in this context. In which config file can I set the default host? Or is this indicative of a different problem? Thanks so much in advance.
You're running a really old version of Rubber. Please try upgrading to the latest 2.x release and let me know if that works.

What's the relationship between Passenger and Capistrano?

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

Can I execute a shell script when restarting (starting) apache webserver

I have an application with some cacheing backend and I want to clear the cacheing whenever the webserver is been restarted.
Is there a apache configuration directive or any other way to execute a shell script upon webserver (re)start?
Thanks,
Phil
Adding some more information, as asked by some answers already:
Base system is ofc linux based, in this exact situation: CentOs
Modifying the startup script is unfortunately no option as pointed out by one of the comments already, due to it beeing not configuration file within the respective RPM packages and therefor beeing replaced by updates. Also I think modifying the startup script would be a bad thing in general
I see, that actually linking both "restarting the webserver" and "clearing my app cache" is not exactly what should be tied together. I will consider other alternatives
My situation is as follows: I can define how the virtual host config looks like, but I can not define how the rest of the servers configuration looks like.
The application is actually PHP based (and runs on the symfony framework). Symfony pre-compiles alot of stuff into dynamic php files from what it finds in the static configuration files. We deploy our apps via RPM and after deployment, an webserver restart is actually initiated already, so I thought it might make sense to tie the cache-cleanup to it. But I think after getting all your feedback, it looks like it is better to put the cache cleanup process into the installation process itself.
You haven't provided a lot of detail here, so it's hard to give a concrete answer, but I would suggest that your best option is to write a script which handles restarting apache, and clearing your cache. It would look something like this:
#!/bin/sh
# restart apache
/etc/init.d/httpd graceful
# whatever needs to be done to clear cache
rm -rf /my/cache/dir
Ramy suggests modifying the system startup script for Apache -- this is a bad idea! If and when you update Apache on your server, there is a good chance that your change will be lost.
Dirk suggests that what you are trying to do is probably misguided, and I think he's right. You haven't told us what platform you are running, but I can think of few situations where restarting your webserver and clearing a cache actually need to happen together.
You can modify Startup script for the Apache Web Server in /etc/init.d/httpd and write your own syntax inside it.
chattr +i /etc/init.d/httpd
If you have (root) access to the server you could do this by shell scripts but I would consider if it is the best way of cache management to rely on apache restarts.