This explains how to deploy Rails
application using Apache and FastCGI.

Install ruby,gems,rails,databse and make a testapp ready. Test this
with the rails in-buit server ‘Webrick’. If you have not done this
before,refer http://www.arthurneil.com/rails-deployment-scgi/rails-deployment-scgi

Now lets start with Fastcgi and Apache.

Install the following

wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar -xzvf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure
make
make install

gem install fcgi

wget http://rubyforge.org/frs/download.php/11368/ruby-fcgi-0.8.7.tar.gz
tar -xzvf ruby-fcgi-0.8.7.tar.gz
cd ruby-fcgi-0.8.7
ruby install.rb config
ruby install.rb setup
ruby install.rb install

wget http://www.fastcgi.com/dist/mod_fastcgi-SNAP-0404142202.tar.gz
tar -xzvf mod_fastcgi-SNAP-0404142202.tar.gz
cd mod_fastcgi-SNAP-0404142202
wget
http://www.fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
tail +55 004060.html | head -52 | sed ’s/&/\&/g’ >
ap22.patch
patch -p 1 < ap22.patch
cp Makefile.AP2 Makefile
make
make install

mkdir /mnt/fcgi_ipc/
chmod 777 /mnt/fcgi_ipc/

If you get any permission error to store session details.
chown of tmp/ and log/ folders.

Make your Apche configuration file(httpd.conf) to …

This explains the configuraton
steps for deploying Rails application using Apache and SCGI. This worked
for me.

Hope you already installed the following items.

Fedora Core 4
Apache httpd 2.0.54
Database(mysql/postgres)
Installing Ruby, Gems and Rails:

yum install ruby
yum install ruby-devel
yum install rdoc
yum install irb

mkdir /var/www/files
cd /var/www/files
wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
tar xvf rubygems-0.9.0.tgz
cd rubygems-0.9.0
ruby setup.rb

gem install rails –include-dependencies

We have successfully installed Ruby, Gems and Rails. If you want to
check, the status create a application by issuing a command ‘rails
testapp’ and run the in-built
webrick server.(ruby script/server). Check localhost:3000. You should
see the rails app running.

Now Lets start with Apache and SCGI.

yum install httpd-devel
cd /var/www/files
wget http://www.mems-exchange.org/software/files/scgi/scgi-1.9.tar.gz
tar xvf scgi-1.9.tar.gz
cd scgi-1.9/apache2
apxs -i -c mod_scgi.c

This will …

We already saw how to develop web application
in C Language using ‘Get Method‘.

Now lets see the other method which most of the applications use to
transfer data.
Post Method:

create test.html as following and put it in apache htdocs
folder.

<html>
<head>
<title>Enter Ur Name</title>
<script type=”text/javascript”>

function FormString()
{
var Name=document.getElementById(’Name’).value;
var Place=document.getElementById(’Place’).value;
var string=Name+”^”+Place+”^”;
//alert(string);
submitform(string);
return true;
}

function submitform(String1)
{
document.getElementById(”WelcomeFormContents”).value = String1;
document.getElementById(”WelcomeForm”).submit();
}

</script>
</head>

<body>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>
</b></font></p>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>Enter
Ur Name </b></font><input type=”text” name=”Name”
size=”20″ id=”Name”value=”L.J.Arthur Neil”></p>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>Enter
Ur Place </b></font><input type=”text” name=”Place”
size=”20″ id=”Place” value=”Tuticorin”></p>
<p align=”center”>
<input type=”Button” value=”Submit” name=”SubmitButton”
onclick=”return FormString()”><input type=”reset” …

As we all know, C is a
general-purpose, block structured, procedural, imperative computer
programming language. With C Language we can also do web development.

Here are the steps to do so.

We can implement this in two ways.

1) Get Method

2) Post Method

Get Method:

create test.html as following and put it in apache htdocs
folder.

<html>
<head>
<title>Enter Ur Name</title>
<script type=”text/javascript”>

function FormString()
{
var Name=document.getElementById(’Name’).value;
var Place=document.getElementById(’Place’).value;
var string=Name+”^”+Place+”^”;
//alert(string);
submitform(string);
return true;
}

function submitform(String1)
{
document.getElementById(”WelcomeFormContents”).value = String1;
document.getElementById(”WelcomeForm”).submit();
}

</script>

</head>
<body>

<p align=”center”> </p>
<p align=”center”> </p>
<p align=”center”> </p>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>
</b></font></p>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>Enter
Ur Name </b></font><input type=”text” name=”Name”
size=”20″ id=”Name”value=”L.J.Arthur Neil”></p>
<p align=”center”><font face=”Book Antiqua” size=”6″
color=”#800000″><b>Enter
Ur Place …

Page 46 of 47« First...«4344454647»

Categories and Tags

Advertising