Forums » Another mod_rewrite issue with Apache

RSS feed for this topic

Info

  1. Just tried installing Omeka 1.4.1 and a single issue with my install, is that mod_rewrite isn't being recognized.

    This server is CentOS 6, running Apache-2.2.15 and PHP-5.3.2. I have other sites that rely on mod_rewrite (Wordpress, Drupal) on this same server and they work fine.

    I've set AllowOverride to "All", and have tried the install with both "RewriteBase" set and not set. The Apache config for that virtual host is identical to the drupal and wordpress sites, which all have the same settings (via Puppet).

    The URL being used to access the site is http://idhmc.tamu.edu/gallery . The domain in that path is for Wordpress and I'm using an Alias in Apache to redirect /gallery to Omeka.

    When I set the RewriteBase I used /gallery/ for root's file and /install's was "/gallery/install/".

    The only error in Apache logs is the test,

    [Mon Sep 12 14:08:40 2011] [error] [client 165.91.253.250] File does not exist: /var/www/idhmcomeka.tamu.edu/html/install/check-mod-rewrite.html

    Any other steps to troubleshoot are welcome, thanks!

    - Trey

  2. The RewriteBase directives you mentioned should be the correct ones (/gallery/ for the root .htaccess, and /gallery/install/ for the one in install/).

    Your use of an Alias directive means that you probably do need to specify the RewriteBase for the rewrites to work.

    To make sure we're avoiding the simple problems, I'll ask some stupid questions:

    • Are your files named exactly .htaccess, with the leading period?
    • When you set the RewriteBase in each file, did you remove the pound sign from the front of the line?

    I've included a RewriteBase question, but your problem appears to be at a higher level: it seems that the .htaccess file isn't being processed by Apache at all.

    Omeka's .htaccess file includes some directives that should deny any web access to some types of files, and I'm able to see these.

    I know you mentioned you've got the correct AllowOverride setting, but I'd ask you to double-check it (many Apache config files set AllowOverride in more than one place, particularly when you have many different DocumentRoots (since AllowOverride must be set in a Directory section).

    The other possible culprit for this would be the AccessFileName directive, which sets what the name of ".htaccess" files should be. If you've used this directive in your server config, you'll either need to remove the directive, or rename Omeka's .htaccess files to the proper name for your server setup.

  3. * Yes the files are named exactly .htaccess
    * Yes the pound sign is removed (uncommented).

    .htaccess

    # If know that mod_rewrite is enabled, but you are still getting mod_rewrite errors,
    # uncomment the line below and replace "/" with your base directory.
    RewriteBase /gallery/

    install/.htaccess

    # If know that mod_rewrite is enabled, but you are still getting mod_rewrite errors,
    # uncomment the line below and replace "/install/" with your install directory.
    RewriteBase /gallery/install/

    I've also declared the following for the virtualhost that is the domain portion for this Alias,

    <Directory "/gallery">
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

    The only instance of "AccessFileName" is as follows

    AccessFileName .htaccess

    I also checked all instances of AllowOverride for Apache's configuration and the only ones set to "None" and not "All" are for the default docroot which is "/var/www/html" and it's sub-directories, but my Virtualhost and Alias are under /var/www/idhmc.tamu.edu...so they don't inherit from the default.

    Upon further troubleshooting, it seems that the problem here is the "Alias". What I don't understand is what about the mod_rewrite check is breaking it. I created a fake virtualhost and commented out the RewriteBase lines , and the install proceeds. I'd like to use "Alias", but right now this is all I get in the logs (LogLevel debug) when going to http://idhmc.tamu.edu/gallery/install/

    File does not exist: /var/www/idhmcomeka.tamu.edu/html/install/check-mod-rewrite.html

    Could that be the problem? That the modrewrite is somehow being broken by Alias?

    Thanks
    - Trey

  4. Sorry for quick double-post. Quick update. I removed the Alias, and created a symbolic link to the Wordpress install's docroot, and the install proceeds. So it's definitely the use of Alias that's the culprit.

    Thanks
    - Trey

  5. A possible issue:

    The Directory section needs to refer to the actual filesystem path of the directory where Omeka is, not a relative directory or a URL, and I'm pretty sure you don't have Omeka located at "/gallery" on your filesystem.

Reply

You must log in to post.