C
C
CarpeDiem2012-12-23 23:37:55
ruby
CarpeDiem, 2012-12-23 23:37:55

Correct rewrite for Ruby application (Redmine availability for more than one apache2 virtual host)

Hello everyone! Today I ran into a problem, I have little experience in server administration, so I decided to turn to the community for help :)

So. There are two folders, example and redmine, located on the same level of the file system hierarchy (/var/www). One of the folders (example) is set as a DocumentRoot for the virtual host in Apache2 and is available via the Internet: example.org

Task: you need to write a rewrite so that when you enter example.org/redmine , the server accesses the /var/www/redmine folder

Alias ​​directive did not work:

<VirtualHost *:80>

ServerAdmin [email protected]
ServerName www.example.org
ServerAlias example.org *.example.org
DocumentRoot /var/example

Alias /redmine/ "/var/www/redmine/"

<Directory /var/www/redmine>
AllowOverride all
Options -MultiViews
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>

<Directory /var/www/example>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

</VirtualHost>

I tried following this advice in the example folder to create the redmine folder, and make a symbolic link to /var/www/redmine/public in it:
ln -s /var/www/redmine/public /var/www/example/redmine
It did not help.

When visiting example.org/redmine with the configuration shown above, a Passenger error is thrown, "No such file or directory - config/environment.rb" - i.e. it doesn't see the correct path to run.

The difficulty also seems to be that Redmine is a Ruby application, and it is necessary to prescribe special directives for it. For example RailsBaseURI, which seems to be relative to the DocumentRoot directive.

Please help :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sdevalex, 2012-12-24
@sdevalex

This is easier to do at the Nginx level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question