Friday, August 25, 2017

Ubuntu 14 04 Apache Changes

Ubuntu 14 04 Apache Changes


When you install the apache2 package on Ubuntu 14.04, it comes with Apache version 2.4.9 by default. This may cause some issues for people migrating from Ubuntu 12.04 as there were some configuration changes. You will know when you see a page like below:


All I needed to do was change the following config lines in

/etc/apache2/sites-enabled/000-default.conf


# Old
Order allow,deny
Allow from all

# New
Require all granted

# Old
Order allow,deny
Deny from all

# New
Require all denied

For reference, here is a template you can edit:


<VirtualHost *:80>
ServerAdmin webmaster@hostname.com
ServerName my.hostname.com

DocumentRoot /var/www/website-folder/public_html
<Directory /var/www/website-folder/public_html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

download file now