Re: Camping tutorials for education?

2009-06-11 Thread David Susco
Scratch that, got everything working with 1.8.7-p173 and selinux
disabled. I have to say, rack apps are pretty easy to deploy with
passenger once you get the thing installed and working :P.

@Jonathan - Re: your apache conf, I actually didn't need the directory
directive and the execcgi option to get this to work. Why did you list
it?

So here's my TODO list:

1. Try to get it working with selinux enabled.
2. Put together a tutorial for the wiki (which one would you guys like
to see it on? github?)
3. Look into performance and security. Would installing fastcgi or
something similar speed passenger up any?

On Wed, Jun 10, 2009 at 8:45 PM, David Suscodsu...@gmail.com wrote:
 OK, good to know. What the latest version I can use?

 Dave

 On Wed, Jun 10, 2009 at 5:46 PM, Magnus Holmjudo...@gmail.com wrote:
 Unfornately, Camping doesn't (yet) work on Ruby 1.9.1. Unless someone else want to try
 now, I'm going to have a look at it *after* 2.0 is released.

 //Magnus Holm


 On Wed, Jun 10, 2009 at 22:30, David Susco dsu...@gmail.com wrote:

 I've disabled SELinux to see if I could get any farther.

 I managed to get passenger installed and working, however a fancy
 passenger generated page is telling me the app couldn't be started due
 to this error:

 `require':
 /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11:
 syntax error, unexpected tLABEL (SyntaxError)
 p[0]==?/?...@root+p:p end;def URL c='/',*a;c=R(c,...

 It's the same thing when I try to rackup the .ru file, and the same
 when I try to execute this little bit of code:

 #!/usr/bin/env ruby -rubygems
 gem 'camping', '=1.9.316'
 %w(rack camping).each { |lib| require lib }
 puts 'done'

 I'm tried reinstalled camping 1.9.316 but that didn't change anything.
 Any ideas?

 Dave

 On Wed, Jun 10, 2009 at 10:39 AM, David Suscodsu...@gmail.com wrote:
  I'm trying to get passenger working presently, once I do I'll let you
  know how the rest of it goes.
 
  When I try to load the module in the apache conf I get the following
  error:
 
  Cannot load
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
  into server:
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so:
  failed to map segment from shared object: Permission denied
 
  I'm assuming it's an SELinux problem, has anyone run into it before?
  I've done the following already, so it hasn't helped:
 
  http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it
 
  Dave
 
 
  On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Grollli...@groll.co.za
  wrote:
  Hi David,
 
  On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote:
 
  I'd definitely be interested in seeing any work you do with this.
  Having it up on the wiki would be nice too.
 
  I'm still trying to figure out deployment with camping 1.5. I've
  experimented with 1.9.316 and rack but have yet to get an app to work
  with that. The same with Picnic.
 
  Been meaning to write a quick overview of how I did it for you (as
  documentation is super sparse still). Briefly:
 
  (1) Read the passenger user guide at:
  http://www.modrails.com/documentation/Users%20guide.html
 
  I installed passenger from a gem but see the user's guide if you need
  to install on debian using apt (it is in the Ubuntu repositories
  already).
  Similarly rack is from a gem, and I use the same version of camping as
  you (from Judofyr's gem server).
 
  (2) Try and get the hello world from the passenger user guide to
  work for you.
 
  (3) Then try and get the blog example working that is shipped with
  camping. Here is a config.ru that works for that:
 
  require 'rubygems'
  require 'rack'
  require 'camping'
  require 'blog'
  Blog::Models::Base.establish_connection :adapter = sqlite3,
  :database = /home/jonathan/.camping.db
  run Blog
 
  Change the database path to one you have on your system. You may need
  something like:
  Blog::Models.create_schema :assume = (Blog::Models::Post.table_exists?
  ?
  1.0 : 0.0)
 
  before run blog if your sqlite database doesn't yet have the schema
  for the blog example.
 
  (4) And the apache config that I used was something like:
 
  Directory /
               Options ExecCGI FollowSymLinks
                  AllowOverride all
                     Allow from all
  /Directory
  VirtualHost *:80
     ServerName www.rackexample.com
     DocumentRoot /var/www/blog/public
  /VirtualHost
 
  You may need to edit your hosts file so that www.rackexample.com
  resolves to your apache server.
 
  (5) Let us know how it goes...
 
  Regards,
  Jonathan
  ___
  Camping-list mailing list
  Camping-list@rubyforge.org
  http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 
  --
  Dave
 



 --
 Dave
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 

Re: Camping tutorials for education?

2009-06-10 Thread David Susco
I'm trying to get passenger working presently, once I do I'll let you
know how the rest of it goes.

When I try to load the module in the apache conf I get the following error:

Cannot load 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
into server: 
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so:
failed to map segment from shared object: Permission denied

I'm assuming it's an SELinux problem, has anyone run into it before?
I've done the following already, so it hasn't helped:
http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it

Dave


On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Grollli...@groll.co.za wrote:
 Hi David,

 On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote:

 I'd definitely be interested in seeing any work you do with this.
 Having it up on the wiki would be nice too.

 I'm still trying to figure out deployment with camping 1.5. I've
 experimented with 1.9.316 and rack but have yet to get an app to work
 with that. The same with Picnic.

 Been meaning to write a quick overview of how I did it for you (as
 documentation is super sparse still). Briefly:

 (1) Read the passenger user guide at:
 http://www.modrails.com/documentation/Users%20guide.html

 I installed passenger from a gem but see the user's guide if you need
 to install on debian using apt (it is in the Ubuntu repositories already).
 Similarly rack is from a gem, and I use the same version of camping as
 you (from Judofyr's gem server).

 (2) Try and get the hello world from the passenger user guide to
 work for you.

 (3) Then try and get the blog example working that is shipped with
 camping. Here is a config.ru that works for that:

 require 'rubygems'
 require 'rack'
 require 'camping'
 require 'blog'
 Blog::Models::Base.establish_connection :adapter = sqlite3,
 :database = /home/jonathan/.camping.db
 run Blog

 Change the database path to one you have on your system. You may need
 something like:
 Blog::Models.create_schema :assume = (Blog::Models::Post.table_exists? ?
 1.0 : 0.0)

 before run blog if your sqlite database doesn't yet have the schema
 for the blog example.

 (4) And the apache config that I used was something like:

 Directory /
              Options ExecCGI FollowSymLinks
                 AllowOverride all
                    Allow from all
 /Directory
 VirtualHost *:80
    ServerName www.rackexample.com
    DocumentRoot /var/www/blog/public
 /VirtualHost

 You may need to edit your hosts file so that www.rackexample.com
 resolves to your apache server.

 (5) Let us know how it goes...

 Regards,
 Jonathan
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list




-- 
Dave
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping tutorials for education?

2009-06-10 Thread David Susco
OK, good to know. What the latest version I can use?

Dave

On Wed, Jun 10, 2009 at 5:46 PM, Magnus Holmjudo...@gmail.com wrote:
 Unfornately, Camping doesn't (yet) work on Ruby 1.9.1. Unless someone else want to try
 now, I'm going to have a look at it *after* 2.0 is released.

 //Magnus Holm


 On Wed, Jun 10, 2009 at 22:30, David Susco dsu...@gmail.com wrote:

 I've disabled SELinux to see if I could get any farther.

 I managed to get passenger installed and working, however a fancy
 passenger generated page is telling me the app couldn't be started due
 to this error:

 `require':
 /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11:
 syntax error, unexpected tLABEL (SyntaxError)
 p[0]==?/?...@root+p:p end;def URL c='/',*a;c=R(c,...

 It's the same thing when I try to rackup the .ru file, and the same
 when I try to execute this little bit of code:

 #!/usr/bin/env ruby -rubygems
 gem 'camping', '=1.9.316'
 %w(rack camping).each { |lib| require lib }
 puts 'done'

 I'm tried reinstalled camping 1.9.316 but that didn't change anything.
 Any ideas?

 Dave

 On Wed, Jun 10, 2009 at 10:39 AM, David Suscodsu...@gmail.com wrote:
  I'm trying to get passenger working presently, once I do I'll let you
  know how the rest of it goes.
 
  When I try to load the module in the apache conf I get the following
  error:
 
  Cannot load
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
  into server:
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so:
  failed to map segment from shared object: Permission denied
 
  I'm assuming it's an SELinux problem, has anyone run into it before?
  I've done the following already, so it hasn't helped:
 
  http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it
 
  Dave
 
 
  On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Grollli...@groll.co.za
  wrote:
  Hi David,
 
  On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote:
 
  I'd definitely be interested in seeing any work you do with this.
  Having it up on the wiki would be nice too.
 
  I'm still trying to figure out deployment with camping 1.5. I've
  experimented with 1.9.316 and rack but have yet to get an app to work
  with that. The same with Picnic.
 
  Been meaning to write a quick overview of how I did it for you (as
  documentation is super sparse still). Briefly:
 
  (1) Read the passenger user guide at:
  http://www.modrails.com/documentation/Users%20guide.html
 
  I installed passenger from a gem but see the user's guide if you need
  to install on debian using apt (it is in the Ubuntu repositories
  already).
  Similarly rack is from a gem, and I use the same version of camping as
  you (from Judofyr's gem server).
 
  (2) Try and get the hello world from the passenger user guide to
  work for you.
 
  (3) Then try and get the blog example working that is shipped with
  camping. Here is a config.ru that works for that:
 
  require 'rubygems'
  require 'rack'
  require 'camping'
  require 'blog'
  Blog::Models::Base.establish_connection :adapter = sqlite3,
  :database = /home/jonathan/.camping.db
  run Blog
 
  Change the database path to one you have on your system. You may need
  something like:
  Blog::Models.create_schema :assume = (Blog::Models::Post.table_exists?
  ?
  1.0 : 0.0)
 
  before run blog if your sqlite database doesn't yet have the schema
  for the blog example.
 
  (4) And the apache config that I used was something like:
 
  Directory /
               Options ExecCGI FollowSymLinks
                  AllowOverride all
                     Allow from all
  /Directory
  VirtualHost *:80
     ServerName www.rackexample.com
     DocumentRoot /var/www/blog/public
  /VirtualHost
 
  You may need to edit your hosts file so that www.rackexample.com
  resolves to your apache server.
 
  (5) Let us know how it goes...
 
  Regards,
  Jonathan
  ___
  Camping-list mailing list
  Camping-list@rubyforge.org
  http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 
  --
  Dave
 



 --
 Dave
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list


 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list




-- 
Dave
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Camping tutorials for education?

2009-06-09 Thread Magnus Holm
2. Stable version
The current version is 1.5 and is available from RubyForge. This is
however a *really* old release, and there have been plenty of bug fixes in
the repo. There's a 1.5.180 from _why's gem server which fixes some of them.

The 1.9-version I have at gems.judofyr.net is just a rake gem ran from the
latest why/camping (once in a while). This should be stable enough. In fact,
as soon as I finish this little cleanup of the documentation (and get some
more feedback from you guys) I will most probably release it as 2.0. (1.9 is
the preview release of 2.0)

3. Rack

Camping started depending on Rack when the work on 2.0 started. Right now,
Camping uses Rack::Utils so it's currently not possible to run Camping
without Rack. This should hopefully not cause any problems.

4. Servers

At the moment I think the easiest solution is Phusion Passenger, which is an
Apache or Nginx modules which can serve any Rack app.

5. Documentation

Yes, we really need some documentation! This is actually what's blocking the
2.0 release. I have some
suggestions (will try to post these as soon as possible, aka few
hours). I'm not very god writing documentation, so if you want to help
out we
can agree on how to organize it.

6. Picnic

While I haven't been to take a proper look at it, I think it's a very cool
idea. Keep up the good work :-)

//Magnus Holm


On Tue, Jun 9, 2009 at 12:35, Dave Everitt dever...@innotts.co.uk wrote:

 I'm planning to use Camping to teach the basics of frameworks, and
 encourage new arrivals from web design to take up Ruby instead of (say)
 defaulting to PHP. To do this, I need a foolproof set of instructions for
 both the technicians (who have to install on all the studio machines) and
 the students.

 To go further, I'd like to get an opinion on the following:

 1. SQLIte/ActiveRecord
 I've had some trouble getting Camping to write to an SQLite database as it
 should (post 'sqlite3 connection problem' has the details). To prepare
 instructions, I need to understand exactly why this is happening (in case it
 happens on a student's machine), so I'll persist and get it solved, somehow.

 2. Obtaining the definitive current stable version
 What's the consensus on the definitive stable version? And where is it? The
 bleeding edge download from http://gems.judofyr.net/ is at 1.9.316, yet
 Picnic includes Camping 2.0 (which I thought didn't exist yet), but if I
 'gem update' my 1.5 version, Camping remains at 1.5? I hope you can
 understand the confusion (on behalf of my future students) here.

 3. Rack
 At which version (see [2]) did Camping start depending on Rack (as stated
 at: http://github.com/why/camping/tree/master)? Just out of interest, is
 it still possible to run a Camping app without it?

 4. Comparing servers
 Is there any consensus on running Camping with: Apache, Mongrel, fast_cgi,
 plain old CGI, etc.? Which is the most efficient, future-proof,
 quickest/easiest to set up, and is there any information that charts the
 methods and differences? In a production environment, the URLs are obviously
 an issue here, so some mod_rewrite (or -like) examples would also be good.

 With all this I also want to lower the entry bar to Camping for new users
 by attempting some nice, simple documentation just to get people going,
 which is the thing I've been struggling to do myself.

 Dave

 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list