This forum is no longer active. Please post your questions to our new community site

Forums Redmine

Rewriting the Redmine URL on Windows

Subscribe to Rewriting the Redmine URL on Windows 18 post(s), 5 voice(s)

 
Avatar Cord Schneider 12 post(s)

Hi,

I have a Redmine installation running on Windows Server 2008. The default BitNami native installation works perfectly but I would like to do as so many others on this forum have done: I would like my users to be able to access http://myserver/ rather than http://myserver/redmine/.

I have followed the instructions found in this post https://bitnami.com/forums/forums/redmine/topics… with no success. At one point I managed to get Redmine to load in the browser (from http://myserver/) but with no stylesheets or javascript. When this happened, the Apache error log contained several lines similar to “No protocol handler was valid for the URL /favicon.ico. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.”

I am not very familiar with using .htaccess and seem to be completely unable to fathom this problem out. Can someone with a working solution on Windows please walk me through the process step by step (including which files need to be altered)?

Many thanks,
Cord

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Could you check in the Apache extensions if the rewrite modules are enabled? Check you /apache2/conf/httpd.conf file that the following lines are not commented:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so

 
Avatar Cord Schneider 12 post(s)

Hi beltran,

I’ve checked the httpd.conf file and all the rewrite modules are are enabled. As I mentioned above, I did manage to get the rewrite to work by doing the following:

1. changed /apps/redmine/conf/redmine.conf file (note: I added the spaces after http:// below so that the text would be displayed and not mangled by the forum) to:

ProxyPass / balancer://redminecluster
ProxyPassReverse / balancer://redminecluster
<Proxy balancer://rubystackcluster>
  BalancerMember http:// 127.0.0.1:3001
  BalancerMember http:// 127.0.0.1:3002
</Proxy>

2. Edited the /apps/redmine/scripts/serviceinstall.bat and removed the prefix entry " —prefix /redmine"

3. Reinstalled and restarted the services.

When I go to http://localhost/ I can see the contents of the Redmine application home page but it isn’t formatted at all by the CSS; the page looks very old school: in other words, it displays as a simple list of links, with an editbox.

Looking in the Apache error log I have the following lines:
[Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /stylesheets/application.css. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /javascripts/dragdrop.js. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /javascripts/prototype.js. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /stylesheets/jstoolbar.css. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /javascripts/effects.js. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /javascripts/application.js. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /javascripts/controls.js. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Jan 14 22:14:39 2010] [warn] proxy: No protocol handler was valid for the URL /stylesheets/csshover.htc. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

This suggests that something is missing from the Apache.conf file or the redmine.conf. My guess is that Apache knows how to handle the rewrites for the *.html files but not the rest (i.e. *.css, *.js, *.htc, etc.). I’ve also noticed that clicking on any of the links on the Redmine home page generates a “500 Internal Server Error” with an error message of:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

The following line have an extra space “BalancerMember http:// 127.0.0.1:3001”. It should not have any space between http:// and 127.0.0.1:3001.

 
Avatar Cord Schneider 12 post(s)

Hi beltran,

Yes I know about the extra spaces – I did it deliberately so that the forum can display it. As I said above, the extra spaces do not exist in my actual redmine.conf file….

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Oh sorry. Have you tried other configuration posted in the same thread?

 
Avatar Cord Schneider 12 post(s)

Yep, I’ve tried them all. No dice!

I still think that it’s got something to do with the .conf files but really don’t know mod_rewrite well enough to work it out on my own.

 
Avatar Cord Schneider 12 post(s)

Right, I’ve finally managed to get this working through sheer trial and error! Most of it is based on the examples found in the thread https://bitnami.com/forums/forums/redmine/topics… but with several errors corrected and some stuff removed.

If you’re running a native BitNami Redmine installation on Windows and you want to change the way that you access the Redmine web pages from http://your_server_name/redmine to http://your_server_name then you should follow these steps:

1) Stop and uninstall the BitNami Redmine Stack services:

> CD \<installdir>
> serviceinstall.bat UNINSTALL

2) Edit <installdir>/apps/redmine/scripts/serviceinstall.bat and remove the prefix entry " —prefix /redmine"

3) Edit <installdir>/apps/redmine/conf/redmine.conf file so that it looks like the following:

<VirtualHost *:80>
  ServerAdmin webmaster@your_server_name
  ServerName your_server_name.your_domain_name.local
  ServerAlias your_server_name
  # this not only blocks access to .svn directories, but makes it                
  # appear as though they aren't even there, not just that they are              
  # forbidden                                                                    
  <DirectoryMatch "^/.*/\.svn/">
    ErrorDocument 403 /404.html
    Order allow,deny
    Deny from all
    Satisfy All
  </DirectoryMatch>
  # This passes through remote_user to mongrel                                  
  RewriteEngine On
  # Redirect non-static requests to cluster                                     
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
ProxyPass / balancer://redminecluster
ProxyPassReverse / balancer://redminecluster
<Proxy balancer://redminecluster>
  BalancerMember http:// 127.0.0.1:3001
  BalancerMember http:// 127.0.0.1:3002
</Proxy>

4) Install and restart the BitNami Redmine Stack services:

> CD \<installdir>
> serviceinstall.bat INSTALL

PLEASE NOTE:
The two lines that add BalancerMember in the <Proxy balancer://redminecluster> section of the redmine.conf have a space between http:// and 127.0.0.1:300n. These must be removed and were added above to prevent Beast (the forum software) from mangling them.

Also, I’m pretty sure that the <DirectoryMatch “^/.*/\.svn/”> bit can be left out if you have no intention of upgrading your Redmine installation to the latest Redmine trunk.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Thanks for posting the solution, I’m sure that this will be helpful for other users.

 
Avatar pekka 1 post

Thank you very much Cord for your detailed post, I got it working this way. I’d like to re-emphasize what got it working for me: No trailing slash in the BalancerMember lines. (Otherwise, every request will be a 404 served by the app.)

 
Avatar antulik 4 post(s)

That is all good now. But how to access phpMyAdmin when redmine is linked to the root directory?

 
Avatar antulik 4 post(s)

While I am still interested in your solution, here is my version of it:

in apps/phpmyadmin/conf/phpmyadmin.conf

add this block:
<VirtualHost 127.0.0.1> DocumentRoot "/opt/rubystack-2.1-0/apps/phpmyadmin/htdocs" ServerName 127.0.0.1 ServerAlias 127.0.0.1 < /VirtualHost >

so if you access localhost it will redirect you to phpmyadmin, otherwise to redmine

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Thanks for posting your solution.

 
Avatar kuscer 3 post(s)

I’m running redmine on BitNami RubyStack on windows 7 and I try your solution for configure phpmyadmin I change DocumentRoot but no sucess! ICan you help me?

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Take a look at the following guide to know how to change the Redmine URL. I hope it helps

http://wiki.bitnami.com/Applications/BitNami_Redmine_Stack#How_to_change_the_default_URL_to_the_root.3f

 
Avatar kuscer 3 post(s)

Hi,

I already follow the guide and I manage to set redmine on default URL but then I can’t acess phpmyadmin. I also try antulik posted solution for configure phpmyadmin but no sucess.

 
Avatar kuscer 3 post(s)

I have to poste my solution! I just change redmine.conf like this

ProxyPass /redmine balancer://redminecluster
ProxyPassReverse /redmine balancer://redminecluster

<Proxy balancer://redminecluster>
BalancerMember http://127.0.0.1:3001

and I edit /apps/redmine/scripts/serviceinstall.bat and remove the prefix entry " —prefix /redmine"

and make

> CD \
> serviceinstall.bat UNINSTALL

and

> CD \
> serviceinstall.bat INSTALL

now my redmine is running on localhost:3001 and I can sill access phpmyadmin on localhost/phpmyadmin.

Regards

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Thanks for posting your solution. This will be helpful for other BitNami users.

Forums Redmine