Omeka S is installed, PHP works, but every omeka URL resolves to "The requested URL was not found on this server."

Ubuntu 22.04
Apache 2.4.52
PHP 8.1

I followed the instructions here: Installing - Omeka S User Manual

using the zip file to install. The default web page works. PHP works; if I point it to the standard phpinfo.php file, it resolves properly. I changed the ownership of all the omeka-s files to www-data.www-data.
AllowOverride all is set globally. ~/config/database.ini is configured.

However, if I navigate to any omeka-s URL (e.g. https:/site/omeka-s/admin) I get a 404 error. If I try to go to https://site/omeka-s, it redirects me to ~/omeka-s/install and then gives a 404 error.

I’m at a loss for what to try next – any ideas?

The site basically working on the front page but only the front page (it can do the redirect but then there’s a 404 after) is almost always a sign of issues with the .htaccess file and/or Apache’s mod_rewrite.

You say you’ve checked AllowOverride, but make sure there’s not other AllowOverride directives that change the setting elsewhere. Sometimes the config files will set AllowOverride separately globally, on a per-directory basis, and on a per-virtual-host basis, if you’re using virtual hosts.

The other thing would be just ensuring that the .htaccess file is there in the Omeka S directory like it should be. It can be easy to accidentally lose it when moving things since it’s a “hidden” file.

One simple test to see if the server is reading your .htaccess is to edit it and make it invalid: something like a line that just says abc at the top of the file will do. If the server is reading the file, when you’ve made it invalid you should get an Internal Server Error on every page inside Omeka S’s directory. If there’s no change and you still just get 404 errors, then it’s pretty much certain the server is not reading the .htaccess and you’d want to look closer at AllowOverride, permissions, and things like that.

Hi John -

Thanks for the heads up; that set me in the right direction. The problem seems to be that apache2 doesn’t like AllowOverride All configured on the / Directory. This didn’t work:

  <Directory />
     Require all allowed
     AllowOverride all

The solution was to move this directive to the DocumentRoot:

  <Directory />
     Require all denied
     AllowOverride none

  <Directory /var/www/html>
     AllowOverride all
     Require all granted

An additional problem was that you need the PHP mbstring module enabled, which I couldn’t find mentioned in the Omeka documentation. For Ubuntu 22.04:

# apt install php8.1-mbstring

Then enable the mbstring module in /etc/php/8.1/apache2/php.ini and /etc/php/8.1/cli/php.ini.

After that, everything seems to be working.