Hey guys. I'm asking this question here as a last resort, since I've been trying to solve the issue for almost two days now.
I'm trying to enable clean URL's on my Drupal web application. I have visited several public questions such as this one, but to no avail. My sincerest apologies if this is thus a repost.
Some (relevant) context:
- The project involves automatically setting up a VM using a Vagrant script.
- The VM has no GUI.
- Vagrant uses VirtualBox.
- Vagrant uses bento/centos-7.9 as a base box.
- I use WSL on my physical device whenever I need a terminal for PS or Linux commands.
I'm setting up a LAMP stack on the VM using the following:
- CentOS 7.9, as mentioned up above.
- Apache 2.4.6, as in:
yum -y install httpd
- MariaDB 10.5.9, as in:
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
./mariadb_repo_setup
yum -y install mariadb-server
- PHP 7.4.16, as in:
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php74
yum -y install php php-mysql
I'm storing the extracted contents of Drupal (index.php, update.php, core, sites ...) under
/var/www/drupal/
. I have given Apache recursive ownership of that folder as to not create a hassle having to set up permissions. It's not a production project anyway.In the
/etc/httpd/conf/httpd.conf
file, I have only touched the DocumentRoot, which I set toDocumentRoot "/var/www/drupal"
. I do not want to use .htaccess.When I run
httpd -M | grep rewrite
, I receive the output rewrite_module (shared). When I runphpinfo();
on a test page, mod_rewrite is present among the loaded modules.
Running the application, everything goes fine, and the following output is produced:
I'm aware of the other two warnings, but those are a worry for another day. When I continue despite the warnings, Apache loads index.php just fine:
However, the moment I click any button, this happens:
Screenshot of yet another problem
I suspect this is a consequence of the clean URL's not being enabled. However, as far as I know, all necessary modules have been installed.
What I have tried so far:
- In
/etc/httpd/conf/httpd.conf
, trying everything that's suggested here. - In
/etc/httpd/conf/httpd.conf
, setting every AllowOverride option to All. - Checking for compability issues.
- Moving the document root around.
- Much more...
Help would be greatly appreciated. Many thanks in advance. If you require any more information, I will respond as soon as possible.