Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 25th September 2006, 14:14
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

did I get this right?

I can just take my perfect debian 3.1 installation, make the steps shown in this tutorial: http://www.howtoforge.com/ruby_on_ra...fastcgi_debian - I mean only make those steps that were not included in the original tutorial like install ruby, then go to the part where it says:
Quote:
To create a Ruby on Rails hosting site.

Create a Hosting plan with

Options +ExecCGI +FollowSymLinks
AllowOverride all
and then I only have to do this:
Quote:
in the Apache Directives box.

Create the New site using the Hosting plan.

In the rails application rename the public directory to web. (The following assumes that the directory created by the hosting plan is web1. Change the following accordingly if it is not.)

cd (rails application directory)
mv public web

Copy everything in the rails directory to the new directory created on your server for the website.

cp -R * /var/www/web1
and do I still have to do this step:

Quote:
Modify the .htaccess in the web directory by adding

SetEnv RAILS_ENV production
Order allow,deny
Allow from all
what about the last step:

Quote:
Make sure the webserver can access all the files by changing the owner of the files to your web server.

cd /var/www/web1 (or whatever your website directory is.)
chown -R www-data:web1 *
this seems dangerous to me, changing the owner of all data in any subdirectory on the server account from web1_XXX:web1 to www-data:web1

has anyone successfully applied this like I suggested?
Reply With Quote
Sponsored Links
  #12  
Old 26th September 2006, 12:33
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

ok, since I got no answer, I followed the turorial and noticed that almost all packages that were suggested to be manually compiled could also be installed with apt-get - what is to be prefered? I would prefer using apt-get because that way they would also be updated by a apt-get dist-upgrade

stil I have some more questions:

Quote:
Create the New site using the Hosting plan.

In the rails application rename the public directory to web. (The following assumes that the directory created by the hosting plan is web1. Change the following accordingly if it is not.)

cd (rails application directory)
mv public web

Copy everything in the rails directory to the new directory created on your server for the website.

cp -R * /var/www/web1

Modify the .htaccess in the web directory by adding

SetEnv RAILS_ENV production
Order allow,deny
Allow from all
what and where exactly is the rails application directory ? is it this: /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/ ? there is no public folder only a html folder...

will cp -R * /var/www/web1 overwrite anything if I try to enable fastcgi for an existing web2 accounbt on my server or can I only enable fast-cgi support to new accounts?

can the part of modifying the .htaccess be somehow also be done by entering
Quote:
SetEnv RAILS_ENV production
Order allow,deny
Allow from all
inside the apache directives field in the ispconfig panel for that site?

is this
Quote:
cd /var/www/web1 (or whatever your website directory is.)
chown -R www-data:web1 *
not too much if trying to do these changes to an existing site?

Last edited by Ovidiu; 26th September 2006 at 12:46.
Reply With Quote
  #13  
Old 26th September 2006, 12:53
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

Quote:
Originally Posted by falko
Make sure mod_fcgi is enabled in your Apache configuration.
Following the tutorial I only have fastcgi no mod_fcgi is this right?
Reply With Quote
  #14  
Old 26th September 2006, 17:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,060
Thanks: 826
Thanked 5,395 Times in 4,239 Posts
Default

fastcgi and mod_fcgi are nearly the same. If I remember correctly, the development on fastcgi has stopped and the project has been reactivated by other developers under the name mod_fcgi. But the config options of both modules differ a bit.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #15  
Old 26th September 2006, 17:56
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

I got a step further:

I had to use this:
Quote:
Options FollowSymLinks ExecCGI
<Directory /var/www/web1>
AllowOverride All
</Directory>
instead of this:

Quote:
Options +ExecCGI +FollowSymLinks
AllowOverride all
at least I got a step further, still working on the whole setup...

then I had to do a :

Quote:
mkdir /var/www/rails
cd /var/www/rails/
rails test
the I renamed /var/www/rails/test/public to /var/www/rails/test/web and then moved /var/www/rails/test/web /var/www/web1/web

and then chown all files that I moved to the user/owner of that particular web1_postmaster:web1 (it did not work setting the suer to www-data as described in the howto as I use suexec (I only guess that is the reason)

now I can access the basic index.html generated by rails test but I guess to get it to run I will have to copy /var/www/rails/test into /var/www/web1 - can anyone confirm the logic I am trying to see here?

Last edited by Ovidiu; 26th September 2006 at 20:07.
Reply With Quote
  #16  
Old 27th September 2006, 21:46
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

ok, finally got ir up and running, still having problems getting it to run because I use the debian chroot tutorial, so for installing a first test site I had to remove a user from the chroot environment....

I have /usr/bin/ruby1.8 and /usr/bin/gem in the chroot, still it complains about rubygems,.... I'll be back with more info later
Reply With Quote
  #17  
Old 28th September 2006, 10:33
Simon Simon is offline
Junior Member
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

fastcgi development stopped several years ago and anyway fastcgi has a bad history with Apache 2. In our experience it should really be regarded as suitable for Apache < 1.3 only.

When we needed to configure a Fast CGI module for Ruby on Rails, we successfully used mod_fcgid - a binary compatible alternative. See: http://fastcgi.coremail.cn/index.htm. We struggled with he latest release, 1.10, but the previous release, 1.09, works very well indeed and seems completely stable. We successfuly host several production Rails sites now using ISPC, FC4, Apache2 and mod_fcgid.

Hope this helps.
Reply With Quote
  #18  
Old 28th September 2006, 10:43
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

I am a little confused, I followed the tutorial, especially this page: http://www.howtoforge.com/ruby_on_ra...tcgi_debian_p4

there it says:
Quote:
Install the FastCGI library

*Note 2.4.0 is the current version if it is not available visit www.fastcgi.com to get the latest.

cd /usr/local/src
wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar xvzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make install


Installation of mod_fastcgi.so for Apache2

Download the mod_fastcgi sources from http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz. If the Link is not working, try to get the latest mod_fastcgi sources instead. Make the mod_fastcgi module.

cd /usr/local/src
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
tar xvzf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
cp Makefile.AP2 Makefile
make top_dir=/usr/share/apache2
make install top_dir=/usr/share/apache2

Enable mod_fastcgi in Apache2

echo 'LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so' > /etc/apache2/mods-available/fastcgi.load
a2enmod fastcgi
I did that, am I using the right version/mod/whatever ?
Reply With Quote
  #19  
Old 29th September 2006, 12:27
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
Default

ok the first client got his site up and running with ruby on rails. http://www.hai-hui.eu/ if you want to have a look.

besides that I found an interesting article about tuning apache2 and ruby on rails: http://scottstuff.net/blog/articles/...ls-and-fastcgi I already implemented this and it works fine.

now I was thinking about this: /etc/apache2/mods-enabled/fastcgi.conf

Quote:
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
#FastCgiWrapper /usr/lib/apache2/suexec2
FastCgiIpcDir /var/lib/apache2/fastcgi
</IfModule>
what about the suexec directive? does it make sense? does it work?
and btw. can someone give me some hints how to make it work with a chrooted user according to the howto for debian? I alreaday included these apps but still no luck:
Quote:
/usr/bin/rails /usr/bin/gem /usr/bin/ruby1.8
here is another tutorial that gave me some hints - when I was looking for solutions: http://wiki.rubyonrails.com/rails/pa...FastCGI+Simply

how to get ruby on rails running in a jail?

Quote:
-bash-2.05b$ rails testt
/usr/bin/rails:9:in `require': no such file to load -- rubygems (LoadError)
from /usr/bin/rails:9
ruby and rails and gem are already in the jail...

Last edited by Ovidiu; 2nd October 2006 at 21:31.
Reply With Quote
  #20  
Old 10th October 2006, 11:36
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,262
Thanks: 78
Thanked 24 Times in 20 Posts
 
Default

ok, I have a vhost for which I start 2 statical processes, but today I found 3 processes running:

Quote:
init─┬─apache2─┬─apache2───2*[dispatch.fcgi]
│ ├─29*[apache2]
│ └─cronolog
├─atd
├─courierlogger───authdaemond.pla───5*[authdaemond.pla]
├─4*[courierlogger]
├─4*[couriertcpd]
├─cron
├─dccifd
├─dhcpcd-bin
├─dispatch.fcgi
could anyone explain why I have 2 processes started by apache like I wanted and a third one just like that? how can I find out where that one comes from?
how about getting fcgi processes to run as suexec group/user so the client can kill his own fcgi processes?

Last edited by Ovidiu; 14th October 2006 at 12:12.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.