Hi Pak Hendri,

Sorry, I'm not too fluent yet in bahasa Indonesia.
Make sure you double check the passenger configuration. For Phusion Passenger 
to work, you need to point to the "public" folder of your RAILS app.

Let's say your rails app is in /srv/www/staging
Then you have

staging/README
staging/app
staging/db
...
staging/public
...

Then you need to config your virtualhost as following

<VirtualHost *:80>
     ServerAdmin squ...@...
     ServerName staging.net
     ServerAlias www.staging.net
     DocumentRoot /srv/www/staging/public
     ErrorLog /srv/www/staging.net/logs/error.log
     CustomLog /srv/www/staging.net/logs/access.log combined
</VirtualHost>

Also make sure you actually have the passenger module loaded in your apache 
config. The install apache module script of Passenger gives you instructions on 
what to paste into your apache config to load the passenger module.

On a sidenote, I'm using Vlad the Deployer for deployment. I've never worked 
with capistrano.

http://rubyhitsquad.com/Vlad_the_Deployer.html

I've read your message again and try to translate a bit better :)

If you go to your apache webserver using IP address, it will NOT use a virtual 
host. It will load the default documentroot instead.
Anyway this definitely seems an apache config problem.
If you want me to take a look at it, no worries, just re post your question in 
English and also post your Apache config.

As for the workings of capistrano, you're right, it uses a symlinking system 
(same like Vlad). This is absolutely nice because it allows you to quickly 
revert to the previous deployment, should something go wrong with your current 
one. Usually (Vlad does) there are some rake tasks in capistrano that do this.

In vlad i.e. you can do a rake vlad:deploy and if it screws up your server, you 
can just do a rake vlad:rollback and you're back to where you are.

Oh another important thing when you use a deployment package like Vlad or 
capistrano, you need to keep some folders that contain files that are needed 
between releases symlinked.
For example. If you use attachment_fu, you need to have your
RAILS_APP/public/attachments folder (where attachment fu saves your 
attachments) symlinked to every release (you need to do this in your deploy 
script). Otherwise every time you deploy your app to your production server, 
your app is put in a new releases folder and that one will not contain the 
attachments! (they will stay in the previous releases folder).
Since your database is shared through the releases, you end up with an 
inconsistent state because your records point to files on the hard disk that 
are not there!

So you have to make the attachments folder in the shared folder of your 
capistrano setup, like this (vlad example, but I assume similar to capistrano):

deploy dir /srv/staging looks like this:
/srv/staging/releases
/srv/staging/current (symlink to ./releases/timestamp)
/srv/staging/shared/attachments (where your attachments are saved)
/srv/staging/current/public/attachments (symlink to ../../shared/attachments

That's one type of symlinking you've got to do.

Hey I hope any of this answers your questions. If not, just post more 
questions, no problem!

Regards,

Michael



--- In [email protected], Hendri <h_firm...@...> wrote:
>
> hai para master, 
> sebelumnya minta maaf jika OOT, saya baru 2 bulan belajar ROR, sekarang lagi 
> berusaha untuk deployment project latihan ke server ubuntu. applikasi sudah 
> berhasil disimpan di sever, saya dapat masalah, yaitu
> 1. ketika membukanya di browser dengan mengetikan "IP" yang tampak adalah 
> index dari directory folder applikasi (folder public). saya pakai modul 
> passenger di apache2...dan membuat virtual host-nya.
> 2. saya tidak mengerti dengan folder yang digenerate oleh capistrano yaitu: 
> current, releases dan shared, untuk sementara sy membuat symlink dari current 
> ke public folder virtual host sy, dibenarkankah cara seperti itu ?
> 
> maaf jika terlalu panjang. semoga tidak berkeberatan untuk memberi tahu saya.
> 
> nb : sebagian file deploy sy: 
> set :application, "staging.net"
> set :domain, "192.168.1.99"
> set :rails_env, "production"
> 
> set :deploy_to, "/srv/www/#{application}"
>  file vhost-nya:
> 
> <VirtualHost *:80>
>      ServerAdmin squ...@...
>      ServerName staging.net
>      ServerAlias www.staging.net
>      DocumentRoot /srv/www/staging/public_html
>      ErrorLog /srv/www/staging.net/logs/error.log
>      CustomLog /srv/www/staging.net/logs/access.log combined
> </VirtualHost>
> 
> regards
> ~hendri
> 
> 
>    
> 
> 
> 
>       Apakah wajar artis ikut Pemilu? Temukan jawabannya di Yahoo! Answers. 
> http://id.answers.yahoo.com
> 
> [Non-text portions of this message have been removed]
>


Kirim email ke