Mod_rewrite is not enabled - Debian 10.x / Omeka 2.7.1

Hi everyone,
I’m trying to perform an installation of Omeka 2.7.1 on my webserver in Debian 10.
I’ve followed this particular guide: https://www.vultr.com/docs/how-to-install-omeka-classic-2-4-cms-on-a-debian-9-lamp-vps but I’ve also read a plethora of similar guides just to be sure that the suggested steps are okay.

After finishing the steps, when typing localhost/install on Firefox, a window with mod_rewrite error appears:

Installation Error
mod_rewrite is not enabled.

Apache's mod_rewrite extension must be enabled for Omeka to work properly. Please enable mod_rewrite and try again.

If I add /install.php to the URL, this error appears:

Installation Error

Before installation can continue, the following errors must be resolved:

    Missing .htaccess File

    Omeka's .htaccess file is missing. Please make sure this file has been uploaded correctly and try again.

This is the architecture of my folder, I don’t really know if I’m missing something but it doesn’t seem so:
image

I’ve enabled mod_rewrite through the command:

sudo a2enmod rewrite

and restarted the server with:

sudo systemctl restart apache2

So I’m pretty sure that mod rewrite is enabled.
I’ve also modified .htaccess and apache config according to guides/posts that I’ve found on this same problem:

.htaccess file stored in /var/www/html/omeka-2.7.1:

# ------------- #
# Rewrite Rules #
# ------------- #

RewriteEngine on

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

# Allow direct access to files (except PHP files)
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !\.(php[0-9]?|phtml|phps)$ - [C]
RewriteRule .* - [L]

RewriteRule ^install/.*$ install/install.php [L]
RewriteRule ^admin/.*$ admin/index.php [L]
RewriteRule .* index.php

# Block access to all .ini files.
<FilesMatch "\.ini$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Deny from all
    </IfModule>
</FilesMatch>

# --------#
# Caching #
# --------#

# Uncomment the lines below in order to enable caching of some files
# (after a finished site has gone live)
#
# <IfModule mod_expires.c>
#    <FilesMatch "\.(js|ico|gif|jpg|png|css)$">
#        ExpiresActive on
#        ExpiresDefault "access plus 10 day"
#    </FilesMatch>
# </IfModule>

# ------------ #
# PHP Settings #
# ------------ #

<IfModule mod_php5.c>
    php_flag register_globals off
    php_flag magic_quotes_gpc off
</IfModule>

000-default.conf stored in /etc/apache2/sites-available/

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        <Directory /var/www/html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I’ve also tried to perform an installation on Ubuntu 20.04 LTS with the same results.
Other threads on the same topic on this forum doesn’t seem to solve this problem properly.
Could you please help me to find a solution?

Thank you very much for your time.

1 Like

Are you installing in the root, or in the “omeka-2.7.1” subfolder? It looks like you’re trying to install at the root, which means the .htaccess file also needs to be at the root. It won’t work if it’s inside the “omeka-2.7.1” folder and nothing else is.

If you moved the contents of the omeka-2.7.1 folder up one level, you should have moved .htaccess as well (and the omeka-2.7.1 folder should then be totally empty and can be deleted).

Same probleme here. Could you solve the problem?

Sorry for the late reply but I have not been able to work on the project until now. I tested your solution and… it worked like a charm! Thank you very much @jflatnes!

@dagosalas don’t know if this may help you, but I’ve tried before with all the other solutions proposed here in the forums and none of them worked for me. So be careful at which level you put your .htaccess file.

This topic was automatically closed after 250 days. New replies are no longer allowed.