By stevieg83
I’ve followed the DO tutorial to prep putting a local Drupal site onto DO. However, I’m running into an issue where neither my images or CSS are loading.
Browser error is
You don't have permission to access /sites/default/files/css/css_61lFZluJMFLY7Y9wlzSCNhfELFBCk95Gx8CMTJ-PHik.css on this server.
Looking at the Apache error logs I see
Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /var/www/html/sites/default/files/css/css_Ym1XJtNgZHXd-a2-_28qWIl4WeSufObTpGk2jgFS0uI.css
I’ve followed the Ubuntu setup & LAMP setup tutorials to this point. My site does load, just sans images and styles which are kind of important.
Apache host config like so
<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.
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Order deny,allow
Allow from all
</Directory>
# 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
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Anyone have any ideas?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Drupal installs an .htaccess. It should be found in the document root. Depending on the version the SymLink options may not be explicitly enabled. See the discussion in this Drupal bug report and the ones linked from it. You can enable it by adding Options +SymLinksIfOwnerMatch to your .htaccess or in your Apache config by adding:
<Directory /var/www/html>
Options +SymLinksIfOwnerMatch
AllowOverride All
Order deny,allow
Allow from all
</Directory>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.