directory directive for /var/www should be in 000-default.conf

Bug #1285101 reported by Jakob Lund
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Won't Fix
Low
Unassigned

Bug Description

After installing apache, the default site configuration file is /etc/apache2/sites-available/000-default.conf. The site defined therein serves files from /var/www, qua the

    DocumentRoot /var/www

The directive for that directory (the <Directory /var/www> block) is in a different config file (apache2.conf).

In order to serve from another directory (e.g. /home/me/public_html), I'd have to change /var/www to the new path in both locations. I suggest moving the <Directory /var/www> block to /etc/apache2/sites-available/000-default.conf because

1. it makes more sense to collect the /var/www stuff in one file
2. it'll easier to figure out how to move the document root
3. if you miss out on the "Require all granted" configuration, presently found only in apache2.conf, you'll get 403's that will drive you nuts--this is not documented in many tutorials found on the web, nor in https://help.ubuntu.com/13.10/serverguide/httpd.html

description: updated
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to file this bug and helping to make Ubuntu better.

I don't think it makes sense for Ubuntu to deviate from Debian's packaging on this point. Please can you check if your report also applies to Debian, and if so then file a bug against the apache2 package in Debian?

Also, are you aware that in Trusty, the document root has moved to /var/www/html? See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730382 for details.

Changed in apache2 (Ubuntu):
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

https://lists.debian.org/debian-devel/2012/04/msg00301.html is a better link for the /var/www -> /var/www/html move.

Revision history for this message
NGUYEN VAN LUONG (konal89) wrote :

Thanks you. It works for me

Revision history for this message
Robie Basak (racb) wrote :

Marking this as Won't Fix in Ubuntu for now, as there is no pending work for Ubuntu here. We won't do it unless Debian chooses to.

Changed in apache2 (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.