Hi, i'm wondering how to setup a staging site for my RoR app. Right now i run webrick on my laptop to develop, then i svn commit my changes to the production server. However i need to make my development environment available to others and not just for me on my laptop. I have RoR setup on a hosted vps server which runs in production environment. Its on apache 1.3 and mysql. How can i setup a staging site on this server? Is this recommended? Thanks in advance.
on 2006-04-24 04:31
on 2006-04-25 00:30
does anyone know how i can setup a subdomain to run my rails app in development environment? I think with this i can test and debug on the staging subdomain, and the update the code in the main domain when its ready. Will this work? How do i setup the staging subdomain? Your help is much appreciated. -Manish
on 2006-04-25 01:19
I use port forwarding -- you might use name-based resolution -- and start a new lighttpd server for the staging "server." The key is it's in a different server process and (I hope) hits a different database. -- View this message in context: http://www.nabble.com/setup-a-staging-site--t14970... Sent from the RubyOnRails Users forum at Nabble.com.
on 2006-04-25 02:32
i'm running apache 1.3 so i dont know if this solution will work for me.
on 2006-04-25 03:12
how about a virtual host? -- View this message in context: http://www.nabble.com/setup-a-staging-site--t14970... Sent from the RubyOnRails Users forum at Nabble.com.
on 2006-04-25 08:50
i think a virtual host would work, not sure on how it should be set though. I'd like to know how the dispatch.fcgi will work with two rails apps running, one being the main site, and one being the staging site. Also, in regards to the database, i'm assuming that the main site will be using the railsapp_production database and the staging site will use railsapp_development database. Is this correct? Is this stupid? Thanks so much for the help.
on 2006-04-25 12:26
Manish Shah wrote: > i think a virtual host would work, not sure on how it should be set > though. > I'd like to know how the dispatch.fcgi will work with two rails apps > running, one being the main site, and one being the staging site. > > Also, in regards to the database, i'm assuming that the main site will > be > using the railsapp_production database and the staging site will use > railsapp_development database. Is this correct? Is this stupid? > > Thanks so much for the help. Hi Manish, You'll run two different FCGI processes, one for each environment. I'd agree with your choice of the dev db rather than test, as test gets autoblownaway every time you run the tests. Can you post your current apache config (the fcgi bit) and I'll have a go at showing what I mean. Since you're not actually *developing* on that staging server, the development db should be untouched. Capistrano should be helpful for this kind of activity. Jamis has an article, from back when it was called Switchtower, that may or may not be useful: http://jamis.jamisbuck.org/articles/2006/01/03/usi... Alan
on 2006-04-25 16:38
On Apr 25, 2006, at 3:26 AM, Alan Francis wrote: > You'll run two different FCGI processes, one for each environment. > I'd > agree with your choice of the dev db rather than test, as test gets > autoblownaway every time you run the tests. You don't need to use the 'dev' DB. It would be cleaner by far to setup a staging DB by making a new 'staging' entry in database.yml and a new file under config/environments/staging.rb (that has the same settings as development.rb). -- -- Tom Mornini
on 2006-04-25 20:12
Here is my httpd.conf. Your help is much appreciated (if some of these settings are wrong, please indicate) NameVirtualHost xxx.xxx.xxx.xxx:80 <IfModule mod_fastcgi.c> FastcgiIpcDir /tmp/fcgi_ipc/ #AddHandler fastcgi-script .fcgi FastCgiServer /path/to/rails/root/public/dispatch.fcgi -initial-env RAILS_ENV=production -processes 3 -idle-timeout 120 </IfModule> <VirtualHost xxx.xxx.xxx.xxx> ServerAlias railsapp.com ServerAdmin firstname.lastname@example.org DocumentRoot /path/to/rails/root/public/ ErrorLog /path/to/rails/root/log/server.log BytesLog domlogs/railsapp.com-bytes_log ServerName www.railsapp.com AddHandler cgi-script .cgi <Directory /path/to/rails/root/public/> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory>
on 2006-04-25 20:12
You'll need a copy of the same section but, just add a ServerName to it. Of course the directories and such will need to be modified accordingly. Like: <VirtualHost xxx.xxx.xxx.xxx > ServerAlias railsapp.com ServerAdmin email@example.com ServerName staging.railsapp.com Michael
on 2006-04-25 23:58
i created a subdomain through cpanel and editted the new virtualhost section as follows: <VirtualHost xxx.xxx.xxx.xxx> ServerAlias staging.railsapp.com ServerAdmin firstname.lastname@example.org DocumentRoot /path/to/staging/root/public/ ErrorLog /path/to/staging/root/public/log/server.log BytesLog domlogs/staging.railsapp.com-bytes_log ServerName staging.railsapp.com User railsapp Group railsapp CustomLog /usr/local/apache/domlogs/staging.railsapp.com combined ScriptAlias /cgi-bin/ /home/railsapp/public_html/staging/cgi-bin/ </VirtualHost> However, when i try to go to staging.railsapp.com, i get this error: Application error Rails application failed to start properly" What am i missing? Also, should i be running different fcgi processes so the staging subdomain can run in development environment? What is the best way to get staging in the development environment if this is even recommended?
on 2006-04-26 00:27
That should happen through your .htaccess file in /public. I'm not familiar with cpanel, but in plesk I set the general settings in the httpd.conf, actually in the mods-available conf. I then do the specifics in the .htaccess file. So if I want to run one as production and one as development I can do that by setting it in the .htaccess. Also I'm using fcgid with Apache2 so there's differences there as well. Are you in a shared environment? Do you have root access to the server? Michael
on 2006-04-26 00:33
yes i have root access. I'm just not sure what changes to make and where to make them. thanks for your help.