Options FollowSymLinks and SymLinksIfOwnerMatch are both off

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
	# 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

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

Anyone have any ideas?

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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