Monthly Archives: October 2011

Redmine SUB-URI and Apache configuration

While trying to setup Redmine in a sub-uri I run across an issue will trying to setup apache. Passenger would display the following error: No such file or directory – config/environment.rb while trying to access the Redmine webpage.

After trying a few suggestions on the issue I managed to get Redmine to work with the following configuration:

The passenger.load configuration file was the following (the paths will probably vary depending on the installation):

LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/passenger-3.0.9
PassengerRuby /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby
PassengerDefaultUser www-data

In the Virtual Host configuration I added the following:

        PassengerAppRoot /usr/local/lib/redmine-1.2/
        RailsBaseURI /redmine
        RailsEnv production

PassengerAppRoot represents the path that redmine is installed.
RailsBasedURI represents the sub directory in the URL that represents Redmine eg. www.example.org/redmine

(for this to work is also essential to have a symbolic link of the redmine-*.*/public inside the web root folder).

Also I changed ownership of the redmine-1.2 folder and the symlink redmine folder to the apache user/group (I am under the impression that it was necessary).

Use Resource files with Eclipse and wxWidgets

While developing with Eclipse  C++ CDT and wxWidgets & MinGW I run along an issue. In Windows wxWidgets requires an MS resource (.rc) file to be compiled along with the project. The file contains the location to the application icon along with an include to the wx resource file. One issue I came across when compiling without including the Resource file to the binary was the rendering of the toolbar. The application would render the toolbar in Windows 95 style.

The resource file content looks like the following:

aaaa ICON "wx/msw/std.ico"

#include "wx/msw/wx.rc"

In order to include the resource file in the binary you first have to use Windres (Windres should be in the PATH system variable as a part of the MinGW suite) through the command prompt:

windres --use-temp-file -isample.rc -osample_rc.o -Iincludepath

You have to replace includepath with the path to the wxWidgets header folder (parent of the wx folder which contains the msw folder).

After you successfully compile the resource file you have to go to Eclipse, right click on the project and open Properties. Once there go to C/C++ Build, and then choose Settings, then go to MinGW C++ linker, and select Miscellaneous. Then go to Other Objects and add the sample_rc.o file. After this you are done and the sample_rc.o should be part of the binary. If you kept the default wxWidgets Resource file, like above you should see the application icon being the default wxWidgets Icon. Also the toolbar should have the proper style, and not the Windows 95 one.

Follow

Get every new post delivered to your Inbox.