0

This is a new server build...

me@server:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

Apache...

me@server:~$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2019-09-16T12:58:48

I downloaded the Drupal 8.7.8 tar.gz and installed using the Standard installation profile into an Apache VirtualHost. The visitor portion of the site displays and functions as expected, however the admin portion has issues. The main page, /admin, displays styled. However, clicking on the various links, Content, Structure, Appearance, etc, result in a page with no style. Inspect's Network tab shows...

http://my.server/admin/sites/default/files/css/css_<snip-long-random-string>.css?0
...
http://my.server/admin/core/assets/vendor/modernizr/modernizr.min.js?v=3.3.1
http://my.server/admin/sites/default/files/js/js_<snip-long-random-string>.js
...

Still in Inspect on the Network tab, the CSS files show a Status of "(cancelled)" and the JS files are all 404.

Maybe I have something wrong with URL rewriting. During installation in the "Requirements review" I received the warning about clean URLs - the server is capable but not enabled. Well, mod_rewrite is enabled and I have the following in my VirtualHost config...

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

With setting RewriteEngine off the visitor site only partially works. For example, the contact form is 404 while search works but has no CSS.

All other prerequisites passed.

I removed the whole Drupal filesystem and dropped the database. Another new installation yields the same results. Further suggesting that this is an Apache config issue.

Your time and help in resolving this is appreciated, thank you.

== Edit ==
The more I investigate the more I feel this is rewrite related. I moved all of the Rewrite statements into the top <Directory> and the site, visitor and admin, is 100% broken and I now receive the following in Apache's error log...

AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
AH00121: r->uri = /index.php
AH00122: redirected from r->uri = /index.php

The last entry is repeated a number of times. I have LogLevel debug.

I understand the result but I'm not sure what the Rewrite statements should be and where they belong. My [current] vhost...

<VirtualHost *:80>
    ServerName [redacted]
    DocumentRoot /var/www/html/test
    <Directory /var/www/html/test>
            Require all granted
            RewriteEngine on
            RewriteBase /
            RewriteOptions inherit
            RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
            RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
    </Directory>
</VirtualHost>
New contributor
user1801810 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Did you RewriteBase /? – leymannx Oct 9 at 22:28
  • Yes, it didn't help. – user1801810 Oct 9 at 22:35
  • Does it fix when you turn off aggregate css and js in /admin/config/development/performance? – No Sssweat Oct 9 at 23:06
  • @NoSssweat, yes it happens with aggregation on or off. – user1801810 Oct 10 at 0:44
  • I meant .htaccess not vhost conf. – leymannx Oct 10 at 7:25
2

Don't forget AllowOverride All if your Apache is defaulted to AllowOverride None. The missing directive was prohibiting rewriting from working [properly?] since I had, lastly, moved the rules to .htaccess (where they are in a default installation). Added it to the "main" <Directory> in my <VirtualHost> and all is well.

New contributor
user1801810 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

user1801810 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.