Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question