Forum: Ruby on Rails rails + apache question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-02-06 22:32
(Received via mailing list)
Hi all,

I've read the symlinks wiki and some other wiki pages relating to Apache
but I'm just not "getting it".

Mandrake Linux (kernel 2.6.8)
Apache 1.3.3

DocumentRoot is "/home/httpd/html"
Application is physically located in
"/home/httpd/applications/foo-1.0.0"
I would like the URL to be "http://host.domain.com/foo"

I've created a "/home/httpd/html/foo" directory.
I've created a link using "ln -s
/home/httpd/applications/foo-1.0.0/public /home/httpd/html/foo"
I added "RewriteBase /foo" to the .htaccess file in
/home/httpd/applications/foo-1.0.0/public

However, when I try to visit http://host.domain.com/foo I get a "cannot
find server" error.  The apache error log shows this:

File does not exist: /home/httpd/html/foo:3000

What am I doing wrong? And how do I get it to just use port 80? I'd
rather not create a separate Apache process, btw, if possible.

Regards,

Dan
F68e4842b0a5487678e26046fdb2fdf3?d=identicon&s=25 softwareengineer 99 (Guest)
on 2006-02-06 22:44
(Received via mailing list)
Not that my post answers your question, but it may be useful:

  I have a mass hosting setup using mod_rewrite and the following lines
of code did the magic for me in routing requests to dispatch.fcgi (I
edited some rules for images and javascripts to keep it short):

  I placed them in a .conf for apache.

  AddHandler fastcgi-script .fcgi
  AddHandler cgi-script .cgi
  # .....
  RewriteCond  ${lowercase:%{SERVER_NAME}}  domain.com$
  RewriteRule  ^/(.*)$  /path/to/domain.com/docs/public/dispatch.fcgi
[QSA,L]

  Just thought it *may* be helpful.
  Thanks
  Frank


"Berger, Daniel" <Daniel.Berger@qwest.com> wrote:  Hi all,

I've read the symlinks wiki and some other wiki pages relating to Apache
but I'm just not "getting it".

Mandrake Linux (kernel 2.6.8)
Apache 1.3.3

DocumentRoot is "/home/httpd/html"
Application is physically located in
"/home/httpd/applications/foo-1.0.0"
I would like the URL to be "http://host.domain.com/foo"

I've created a "/home/httpd/html/foo" directory.
I've created a link using "ln -s
/home/httpd/applications/foo-1.0.0/public /home/httpd/html/foo"
I added "RewriteBase /foo" to the .htaccess file in
/home/httpd/applications/foo-1.0.0/public

However, when I try to visit http://host.domain.com/foo I get a "cannot
find server" error.  The apache error log shows this:

File does not exist: /home/httpd/html/foo:3000

What am I doing wrong? And how do I get it to just use port 80? I'd
rather not create a separate Apache process, btw, if possible.

Regards,

Dan
95badc8378de83a449ff75027e67e9ed?d=identicon&s=25 David Genord II (Guest)
on 2006-02-07 18:28
(Received via mailing list)
Try making the sym link "ln -s
/home/httpd/applications/foo-1.0.0 /home/httpd/html/foo"
and change the document root in apache to /home/httpd/html/foo/public
rails is probably having a hard time finding itself because it cannot
use ../environment since the environment directory is not in
/home/httpd/html
Let me know if this helps
David
95badc8378de83a449ff75027e67e9ed?d=identicon&s=25 David Genord II (Guest)
on 2006-02-07 18:38
(Received via mailing list)
I need to correct what I just said because that won't work but if you
look in the .htaccess file in the public directory you will have your
answer.
Here is what you need in the apache config file:
Alias /foo /home/httpd/applications/foo-1.0.0/public

Then add the following line in the .htaccess file:
RewriteBase /foo

That should do you.
David
This topic is locked and can not be replied to.