0

I am trying to have redmine running on my Ubuntu 12.04 / Apache/2.2.22 server. I am following this documentation which worked just fine on my laptop, but can't get it to work on my aws webserver. I'm guessing the problem is with apache because I simply get a 404 error when trying to reach the page www.mydomain.com/redmine

I followed the doc step by step but won't work. I'm not very familiar with VHost config so could anyone tell if there is anything wrong with mine:

<VirtualHost *:80>
    ServerAdmin admin@yourownpoet.com
    ServerName www.yourownpoet.com
    DocumentRoot /var/www/yourownpoet/web
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/yourownpoet/web>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.prod.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.prod.log combined
<IfModule mod_userdir.c>
    UserDir html/yourownpoet/web
</IfModule>

<Directory /home/ubuntu/html/yourownpoet/web>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
      Order allow,deny
      Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
    Order deny,allow
    Deny from all
  </LimitExcept>
</Directory>

<Directory /var/www/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>
</VirtualHost>

PS: I created the symlink to the redmine public directory in my DocumentRoot folder:

sudo ln -s /usr/share/redmine/public /var/www/yourownpoet/web

Is that correct?

fkoessler
  • 101
  • 6

1 Answers1

0

Problem solved!

The issue was that I had a rewrite rule set in my .htaccess in the DocumentRoot folder. This rule is necessary for running my Symfony2 website, but was messing with redmine.

I had to specifically turn off the RewriteEngine for redmine in the virtualhost configuration:

<VirtualHost *:80>
    ServerAdmin admin@yourownpoet.com
    ServerName www.yourownpoet.com
    DocumentRoot /var/www/yourownpoet/web
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/yourownpoet/web>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ /app.php [QSA,L]
        </IfModule>
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.prod.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.prod.log combined
<IfModule mod_userdir.c>
    UserDir html/yourownpoet/web
</IfModule>

<Directory /home/ubuntu/html/yourownpoet/web>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
      Order allow,deny
      Allow from all
    </LimitExcept>
</Directory>

<Directory /var/www/yourownpoet/web/redmine>
    <IfModule mod_rewrite.c>
        RewriteEngine off
    </IfModule>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>
</VirtualHost>

Hope this helps.

fkoessler
  • 101
  • 6