Hello everybody.
I know, I know, another post about Apache 2, but I have looked a lot on
the internet and I haven’t found the answer to my problem.
I have a Linux Fedora Core 5 box, with Apache 2.2.2 (compiled and
installed), Ruby 1.8.4 (compiled and installed), RubyGems 0.8.11
(compiled and installed) and Rails… I don’t know what version as this
one I haven installed with gem.
This is what I want to achieve.
I have a personal website (www.troccoli.it) which contains HTML only. I
want to have another website (spagnolo.troccoli.it) where I use Rails.
Both URL are resolved to the same IP: my Linux box.
I have managed to change httpd.conf to use mod_fcgid as follows
…
LoadModule fcgid_module modules/mod_fcgid.so
IPCCommTimeout 40
IPCConnectTimeout 10
…
I have also changed httpd-vhosts.conf (which is include in httpd.conf)
as follows:
…
NameVirtualHost *
VirtualHost example:
Almost any Apache directive may go into a VirtualHost container.
The first VirtualHost section is used for all requests that do not
match a ServerName or ServerAlias in any block.
<VirtualHost :>
ServerAdmin [email protected]
DocumentRoot /home/webmaster/troccoli.it
ServerName www.troccoli.it
ErrorLog logs/troccoli.it-error_log
CustomLog logs/troccoli.it-access_log common
<VirtualHost :>
ServerAdmin [email protected]
DocumentRoot /home/webmaster/troccoli.it/spagnolo
ServerName spagnolo.troccoli.it
ErrorLog logs/spagnolo-error_log
CustomLog logs/spagnolo-access_log common
<Location /journal>
RewriteEngine On
# Let Apache handle purely static files like images by itself.
RewriteCond %{REQUEST_FILENAME} !-f
# Send Everything else to Rails
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
<Directory /home/webmaster/troccoli.it/spagnolo/journal>
# ExecCGI is required for mod_fcgid to work.
Options Indexes FollowSymLinks ExecCGI
# Disable .htaccess files.
AllowOverride None
Order allow,deny
Allow from all
# This tells mod_fcgid to run the dispatch.fcgi script as a
FastCGI
AddHandler fcgid-script .fcgi
…
Now, while my personal website (www.troccoli.it) works fine, if you go
to the other one (spagnolo.troccoli.it) instead of the expected “Welcome
aboard You’re riding the Rails!” I have the content of my DocumentRoot
directory (which is not a big deal at the moment as I haven’t done
anything yet). Try it yourself, you should be able to see it yourself.
I know that I could run Apache for www.troccoli.it and WEBBrick for
spagnolo.troccoli.it because they can run on different ports (and this
is noather thing I don’t understand, do I have to use port 3000 if I use
Apache???) but I’d like to have only one web server, possibly Apache.
I am also not sure about the journal directory in the httpd-vhosts.conf.
I have copied from a how-to post I found, but
/home/webmaster/troccoli.it/spagnolo/journal does not exist. I have
however tried also with
but this time I have an error and the log says
[Thu Jun 22 21:26:08 2006] [error] [client 192.168.69.22] Request
exceeded the limit of 10 internal redirects due to probable
configuration error. Use ‘LimitInternalRecursion’ to increase the limit
if necessary. Use ‘LogLevel debug’ to get a backtrace.
I am really stuck guys, could you help me please?
Thanks
Giulio